<?php $__env->startSection('content'); ?>
<?php

$Group = Auth::user()->group_id;
$Email = Auth::user()->email;

?>



<div class="page-header" style="background-color: #6382a6;;">
  <div class="modulo"><img class="imagenmodulo1" src="<?php echo e(URL::asset('dashboardimage/trabajo3.png')); ?>">
  <img class="imagenmodulo2" src="<?php echo e(URL::asset('dashboardimage/linea.png')); ?>">&nbsp   CONTROL DE TRABAJOS </div>
  </div>

	<?php echo Form::open(array('url'=>'controldetrabajo?return='.$return, 'class'=>'form-horizontal form-material validated sximo-form','files' => true ,'id'=> 'FormTable' )); ?>

	<div class="toolbar-nav">
		<div class="row">
			
			<div class="col-md-6 " >
				
					<button type="submit" class="btn btn-sm  " name="save" style="border-color:#7fb3e3;">GUARDAR</button>
					<a href="<?php echo e(url($pageModule.'?return='.$return)); ?>" class="tips btn btn-sm " style="border-color:#ff7a7a;" >SALIR</a>
				
			</div>
			<div class="col-md-6 text-right " >
				<!--<a href="<?php echo e(url($pageModule.'?return='.$return)); ?>" class="tips btn btn-secondary  btn-sm "  title="<?php echo e(__('core.btn_back')); ?>" ><i class="fa  fa-times"></i></a>--> 
			</div>
		</div>
	</div>	


	<div class="card"style="margin-bottom:320px;">
			<div class="card-body" style="overflow-y: scroll;">
		
		
	<div class="row"><div class="col-md-12">
							<fieldset style="border-color:#7fb3e3;"><legend> Información General</legend>
				<?php echo Form::hidden('OrdenID', $row['OrdenID']); ?>					
									  <div class="form-group row  " >
										<label for="Titulo" class=" control-label col-md-4 text-left" style="font-weight:600;" > Titulo :</label>
										<div class="col-md-6">
										  <input  type='text' name='Titulo' id='Titulo' value='<?php echo e($row['Titulo']); ?>' 
						     class='form-control form-control-sm ' /> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Condominio" class=" control-label col-md-4 text-left" style="font-weight:600;" > Condominio :</label>
										<div class="col-md-6">
										  <select name='Condominio' rows='5' id='Condominio' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Residencia" class=" control-label col-md-4 text-left" style="font-weight:600;" > Residencia :</label>
										<div class="col-md-6">
										  <select name='Residencia' rows='5' id='Residencia' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Tipo de orden" class=" control-label col-md-4 text-left" style="font-weight:600;" > Tipo de orden :</label>
										<div class="col-md-6">
										  
					<?php $Tipodeorden = explode(',',$row['Tipodeorden']);
					$Tipodeorden_opt = array( 'Mantenimiento' => 'Mantenimiento' ,  'Reparacion' => 'Reperacion' ,  'Instalacion' => 'Instalacion' , ); ?>
					<select name='Tipodeorden' rows='5'   class='select2 '  > 
						<?php 
						foreach($Tipodeorden_opt as $key=>$val)
						{
							echo "<option  value ='$key' ".($row['Tipodeorden'] == $key ? " selected='selected' " : '' ).">$val</option>"; 						
						}						
						?></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Descripción" class=" control-label col-md-4 text-left" style="font-weight:600;" > Descripción :</label>
										<div class="col-md-6">
										  <textarea name='Descripcion' rows='5' id='Descripcion' class='form-control form-control-sm '  
				           ><?php echo e($row['Descripcion']); ?></textarea> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  
									  
									  
									<?php if($Group =='4'): ?>
				<div style="pointer-events: none;">
			    <?php else: ?>
			    <div>
			    <?php endif; ?>	  
									  
									  
									  <div class="form-group row  " >
										<label for="Fecha de inicio" class=" control-label col-md-4 text-left" style="font-weight:600;" > Fecha de inicio Programada:</label>
										<div class="col-md-6">
										  
				
					<?php echo Form::text('Fechadeinicio', $row['Fechadeinicio'],array('class'=>'form-control form-control-sm date')); ?> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Fecha final" class=" control-label col-md-4 text-left" style="font-weight:600;" > Fecha final Programada:</label>
										<div class="col-md-6">
										  
				
					<?php echo Form::text('Fechafinal', $row['Fechafinal'],array('class'=>'form-control form-control-sm date')); ?> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  
									  
									  
									  
					</div>				  
									  
									  
									  
									  <div class="form-group row  " >
										<label for="Fecha de inicio" class=" control-label col-md-4 text-left" style="font-weight:600;" > Fecha de inicio Actual :</label>
										<div class="col-md-6">
										  
				
					<?php echo Form::text('Fechadeiniciore', $row['Fechadeiniciore'],array('class'=>'form-control form-control-sm date')); ?> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 					
									  <div class="form-group row  " >
										<label for="Fecha final" class=" control-label col-md-4 text-left" style="font-weight:600;" > Fecha final Actual:</label>
										<div class="col-md-6">
										  
				
					<?php echo Form::text('Fechafinalre', $row['Fechafinalre'],array('class'=>'form-control form-control-sm date')); ?> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div>   
									  
									  
									  
									  
								
									  
									  
									  
									  <?php if($Group == '4'): ?>
									  
									   <div class="form-group row  " >
										<label for="Asignado" class=" control-label col-md-4 text-left" style="font-weight:600;" > Asignado :</label>
										<div class="col-md-6">
										  <input  type='text' name='Asignado' id='Asignado' value='<?php echo e($Email); ?>' 
						                 readonly    class='form-control input-sm ' />  
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  
									  <?php else: ?>
									  
									  
									  <div class="form-group row  " >
										<label for="Asignado" class=" control-label col-md-4 text-left" style="font-weight:600;" > Asignado :</label>
										<div class="col-md-6">
										  <select name='Asignado' rows='5' id='Asignado' class='select2 '   ></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  
									  <?php endif; ?>
									  
									<?php if($Group == '2'): ?>
                                    <input  type='hidden' name='Asignado2' id='Asignado2' value='Si' 
						                   class='form-control input-sm ' />
						            <?php else: ?>
                                    <?php endif; ?>
									  
									  
									  
									  
									  <?php if($Group == '4'): ?>
									  
									  <div class="form-group row  " >
										<label for="Estatus" class=" control-label col-md-4 text-left" style="font-weight:600;" > Estatus :</label>
										<div class="col-md-6">
										  
					<?php $Status = explode(',',$row['Status']);
					$Status_opt = array( 'En Revision' => 'En Revision' ,  'En Progreso' => 'En Progreso' ,  'Completada' => 'Completada' ,  'Cancelada' => 'Cancelada' ,'Reprogramar' => 'Reprogramar' ,); ?>
					<select name='Status' rows='5'   class='select2 '  > 
						<?php 
						foreach($Status_opt as $key=>$val)
						{
							echo "<option  value ='$key' ".($row['Status'] == $key ? " selected='selected' " : '' ).">$val</option>"; 						
						}						
						?></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 
									  
							<?php else: ?>
							
					  	<div class="form-group row  " >
										<label for="Estatus" class=" control-label col-md-4 text-left" style="font-weight:600;" > Estatus :</label>
										<div class="col-md-6">
										  
					<?php $Status = explode(',',$row['Status']);
					$Status_opt = array( 'En Revision' => 'En Revision' ,  'En Progreso' => 'En Progreso' ,  'Completada' => 'Completada' ,  'Cancelada' => 'Cancelada' ,  'No Enviada' => 'No Enviada' ,'Revisada' => 'Revisada' ,'Reprogramar' => 'Reprogramar' , ); ?>
					<select name='Status' rows='5'   class='select2 '  > 
						<?php 
						foreach($Status_opt as $key=>$val)
						{
							echo "<option  value ='$key' ".($row['Status'] == $key ? " selected='selected' " : '' ).">$val</option>"; 						
						}						
						?></select> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> 	
							
									  
					  <?php endif; ?>				  
									  
									  
									 
									  
									  
									  
									  <div class="form-group row  " style="margin-bottom:-25px;">
										<label for="Comentarios" class=" control-label col-md-4 text-left" style="font-weight:600;" > Comentarios :</label>
										<div class="col-md-6">
										  <textarea name='Comentarios' rows='5' id='Comentarios' class='form-control form-control-sm '  
				           ><?php echo e($row['Comentarios']); ?></textarea> 
										 </div> 
										 <div class="col-md-2">
										 	
										 </div>
									  </div> </fieldset></div></div>
	
		</div>
		
		<input type="hidden" name="action_task" value="save" />
		
		
		</div>
	</div>		


	<?php echo Form::close(); ?>

	<?php echo $__env->make('sximo.module.template.ajax.formjavascript', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
   <script type="text/javascript">
	$(document).ready(function() { 
		
		
		
	
		
		
		$("#Condominio").jCombo("<?php echo url('controldetrabajo/comboselect?filter=condominios:Nombre:Nombre'); ?>",
		{ initial_text: "-- Seleccionar --",selected_value : '<?php echo e($row["Condominio"]); ?>' });
		
	    $("#Residencia").jCombo("<?php echo url('controldetrabajo/comboselect?filter=residencia:Nombre:Nombre'); ?>&parent=Condominio:",
		{  parent: '#Condominio',initial_text: "-- Seleccionar --", selected_value : '<?php echo e($row["Residencia"]); ?>' });
		
		
		
		$("#Asignado").jCombo("<?php echo url('controldetrabajo/comboselect?filter=supervisores:Email:Email'); ?>",
		{  initial_text: "-- Seleccionar --",selected_value : '<?php echo e($row["Asignado"]); ?>' });
		 	
		 	 

		$('.removeMultiFiles').on('click',function(){
			var file =  $(this).attr('url') ;
			var removeUrl = '<?php echo e(url( $pageModule."/removefiles?file=")); ?>'+ file;
			$(this).parent().remove();
			$.get(removeUrl,function(response){});
			$(this).parent('div').empty();	
			return false;
		});
	});
$('.date').bootstrapMaterialDatePicker({ format:'YYYY-MM-DD',lang :'es',time: false, cancelText: 'Cancelar'});		
	
	</script>
	
	<style>
	.btn:focus,.btn:active {
   outline: none !important;
   box-shadow: none;    
	    
	    
	    
	</style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/tempdpe5/public_html/intelpropertyrd/aplicacionmobile/resources/views/controldetrabajo/form.blade.php ENDPATH**/ ?>