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

<?php
$email = Auth::user()->email;
$Group = Auth::user()->group_id;

?>
<div class="page-header" style="background-color: #6382a6;;">
  <div class="modulo"><img class="imagenmodulo1" src="dashboardimage/trabajo3.png">
  <img class="imagenmodulo2" src="dashboardimage/linea.png">&nbsp   CONTROL DE TRABAJOS </div>
</div>
<div class="toolbar-nav" >   
	<div class="row">
		<div class="col-md-8"> 	
			<?php if($access['is_add'] ==1): ?>
			<a href="<?php echo e(url('controldetrabajo/create?return='.$return)); ?>" class="btn  btn-sm"  
				title="<?php echo e(__('core.btn_create')); ?>"style="border-color:#f29f41;" ><i class=" fa fa-plus "></i> NUEVO </a>
			<?php endif; ?>

			<div class="btn-group">
				<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="border-color:#f29f41;"><i class="fa fa-bars"></i> Acciones </button>
		        <ul class="dropdown-menu">
		       
		        <?php if($access['is_remove'] ==1): ?>
					<li class="nav-item"><a href="javascript://ajax"  onclick="SximoDelete();" class="nav-link tips" title="<?php echo e(__('core.btn_remove')); ?>">
					Remover </a></li>
				<?php endif; ?> 
				
				<?php if($access['is_add'] ==1): ?>
					<!-- <li class="nav-item"><a href="javascript://ajax" class=" copy nav-link " title="Copy" > Copy selected</a></li>
					<div class="dropdown-divider"></div>
					<li class="nav-item"><a href="<?php echo e(url($pageModule .'/import?return='.$return)); ?>" onclick="SximoModal(this.href, 'Import CSV'); return false;" class="nav-link "> Import CSV</a></li>

					
				<?php endif; ?>
				<div class="dropdown-divider"></div>
		        <?php if($access['is_excel'] ==1): ?>
					<li class="nav-item"><a href="<?php echo e(url( $pageModule .'/export?do=excel&return='.$return)); ?>" class="nav-link "> Export Excel </a></li>	
				<?php endif; ?>
				<?php if($access['is_csv'] ==1): ?>
					<li class="nav-item"><a href="<?php echo e(url( $pageModule .'/export?do=csv&return='.$return)); ?>" class="nav-link "> Export CSV </a></li>	
				<?php endif; ?>
				<?php if($access['is_pdf'] ==1): ?>
					<li class="nav-item"><a href="<?php echo e(url( $pageModule .'/export?do=pdf&return='.$return)); ?>" class="nav-link "> Export PDF </a></li>	
				<?php endif; ?>
				<?php if($access['is_print'] ==1): ?>
					<li class="nav-item"><a href="<?php echo e(url( $pageModule .'/export?do=print&return='.$return)); ?>" class="nav-link "> Print Document </a></li>	
				<?php endif; ?>
				<div class="dropdown-divider"></div>-->
				<li class="nav-item"><a href="<?php echo e(url($pageModule)); ?>"  class="nav-link "> Limpiar busqueda </a></li>
		        <li class="nav-item"><a href="<?php echo e(url('dashboard')); ?>"  class="nav-link "> Salir </a></li>  	
		        
		          
		        </ul>
		    </div> <button type="button" class="btn btn-default btn-sm " 
			        onclick="SximoModal('<?php echo e(url($pageModule."/search")); ?>','Busqueda'); " style="border-color:#7fb3e3;" ><i class="fa fa-filter"></i> Filtro </button>   
		</div>
		<div class="col-md-4 text-right">
		<!--<div class="input-group ">
			      <div class="input-group-prepend">
			        <button type="button" class="btn btn-default btn-sm " 
			        onclick="SximoModal('<?php echo e(url($pageModule."/search")); ?>','Advance Search'); " ><i class="fa fa-filter"></i> Filter </button>
			      </div><!-- /btn-group 
			      <input type="text" class="form-control form-control-sm onsearch" data-target="<?php echo e(url($pageModule)); ?>" aria-label="..." placeholder=" Type And Hit Enter ">
			    </div>-->
		</div>    
	</div>	

</div>	
<div class="card" >
	<div class="card-body"  >

			<!-- Table Grid -->
			
 			<?php echo Form::open(array('url'=>'controldetrabajo?'.$return, 'class'=>'form-horizontal m-t' ,'id' =>'SximoTable' )); ?>

			<div class="table-responsive" >
			<?php if(count($rowData)>=1): ?>    
		    <table class="table  table-hover table-striped" id="<?php echo e($pageModule); ?>Table" >
		        <thead>
					<tr>
						<th style="width: 3% !important;" class="number"> No </th>
						<th  style="width: 3% !important;"> 
							<!--<input type="checkbox" class="checkall filled-in" id="checked-all"  />-->
							<label for="checked-all"style="font-weight: 600;" > Selección</label>
						</th>
						<th  style="width: 10% !important;"><?php echo e(__('core.btn_action')); ?></th>
						
						<?php $__currentLoopData = $tableGrid; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<?php if($t['view'] =='1'): ?>				
								<?php $limited = isset($t['limited']) ? $t['limited'] :''; 
								if(SiteHelpers::filterColumn($limited ))
								{
									$addClass='class="tbl-sorting" ';
									if($insort ==$t['field'])
									{
										$dir_order = ($inorder =='desc' ? 'sort-desc' : 'sort-asc'); 
										$addClass='class="tbl-sorting '.$dir_order.'" ';
									}
									echo '<th align="'.$t['align'].'" '.$addClass.' width="'.$t['width'].'">'.\SiteHelpers::activeLang($t['label'],(isset($t['language'])? $t['language'] : array())).'</th>';				
								} 
								?>
							<?php endif; ?>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
						
					  </tr>
		        </thead>

		        <tbody>        						
		            <?php $__currentLoopData = $rowData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
		                <tr>
							<td class="thead"> <?php echo e(++$i); ?> </td>
							<?php if($row->Asignado2 !='Si' && $row->Status != 'Completada' && $row->Status != 'Revisada'): ?>
							
							<td class="tcheckbox">
							    <div style="margin-top:6px;margin-right:-4px;">
								<input type="checkbox" class="ids filled-in" name="ids[]" value="<?php echo e($row->OrdenID); ?>" id="val-<?php echo e($row->OrdenID); ?>" /> 
								<label for="val-<?php echo e($row->OrdenID); ?>"></label>
								</div>
							</td>
						
							<?php elseif($Group == '2'): ?>
							<td class="tcheckbox">
							    <div style="margin-top:6px;margin-right:-4px;">
								<input type="checkbox" class="ids filled-in" name="ids[]" value="<?php echo e($row->OrdenID); ?>" id="val-<?php echo e($row->OrdenID); ?>" /> 
								<label for="val-<?php echo e($row->OrdenID); ?>"></label>
								</div>
							</td>
							
							<?php else: ?>
							<td ><img class="imagen" src="dashboardimage/cerrada2.png"></td>
		                   
							<?php endif; ?>
							
						
							<td>

							 	<div class="dropdown" >
								  <button class="btn dropdown-toggle" type="button" data-toggle="dropdown"> <?php echo e(__('core.btn_action')); ?> </button>
								  <ul class="dropdown-menu">
								   
								      
								    <button class="btn dropdown-toggle" type="button" data-toggle="dropdown"> Accesos </button>
								    <ul class="dropdown-menu" style="margin-left:200px;background-color: #f5f5f5;" >
								 	<?php if($access['is_detail'] ==1): ?>
									<li class="nav-item"><a href="<?php echo e(url('controldetrabajo/'.$row->OrdenID.'?return='.$return)); ?>" class="nav-link tips" title="<?php echo e(__('core.btn_view')); ?>"> <?php echo e(__('core.btn_view')); ?> </a></li>
									<?php endif; ?>
									<li class="nav-item"><a href="<?php echo e(url('uploadot?Email='.$email.'&id='.$row->OrdenID.'&Grupo='.$Group.'')); ?>" class="nav-link tips"> Anexar Documento</a></li>
									</ul>
									
									
									
										<?php if($row->Status != 'Completada' && $row->Status != 'Revisada'): ?>
										
										<?php if($access['is_edit'] ==1): ?>
									    <li class="nav-item"><a  href="<?php echo e(url('controldetrabajo/'.$row->OrdenID.'/edit?return='.$return)); ?>" class="nav-link  tips" title="<?php echo e(__('core.btn_edit')); ?>"> <?php echo e(__('core.btn_edit')); ?> </a></li>
									    <?php endif; ?>
									
									
									    <?php elseif($Group == '2'): ?>
									
										<?php if($access['is_edit'] ==1): ?>
									    <li class="nav-item"><a  href="<?php echo e(url('controldetrabajo/'.$row->OrdenID.'/edit?return='.$return)); ?>" class="nav-link  tips" title="<?php echo e(__('core.btn_edit')); ?>"> <?php echo e(__('core.btn_edit')); ?> </a></li>
									    <?php endif; ?>
								    
									    <?php else: ?>
									
									
									
									   <?php endif; ?> 
									
									
									
									
									
									
									
									
									
					
									
									<?php if($Group =='4'): ?>
                                    <?php else: ?>
									
									<?php if($row->Status =='En Progreso'||$row->Status =='Completada' || $row->Status =='Cancelada'||$row->Status =='Revisada'  ): ?>
									<li class="nav-item"><a href="#" onclick="function cuota(){$.get('sendtrabajomobile.php',{Email:'<?php echo $email; ?>', ID:'<?php echo e($row->OrdenID); ?>'})} cuota();cuota3(); return false;" class="nav-link tips"> Enviar Orden de Trabajo </a></li>
									<?php else: ?>
									<?php endif; ?>
								
									<?php endif; ?>
									<!--<div class="dropdown-divider"></div>-->
									
									<?php if($row->Asignado2 !='Si' && $row->Status != 'Completada' && $row->Status != 'Revisada'): ?>
										
										<?php if($access['is_remove'] ==1): ?>
										<!--<li class="nav-item"><a href="javascript://ajax"  onclick="SximoDelete();" class="nav-link  tips" title="<?php echo e(__('core.btn_remove')); ?>">
										Remover </a></li>-->
										<?php endif; ?> 
									
									
									<?php elseif($Group == '2'): ?>
									
										<?php if($access['is_remove'] ==1): ?>
									    <!--<li class="nav-item"><a href="javascript://ajax"  onclick="SximoDelete();" class="nav-link  tips" title="<?php echo e(__('core.btn_remove')); ?>">
										Remover </a></li>-->
										<?php endif; ?> 
								    
									<?php else: ?>
									
									
									
									<?php endif; ?> 
									
									
								  </ul>
								</div>

							</td>														
						 <?php $__currentLoopData = $tableGrid; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							 <?php if($field['view'] =='1'): ?>
							 	<?php $limited = isset($field['limited']) ? $field['limited'] :''; ?>
							 	<?php if(SiteHelpers::filterColumn($limited )): ?>
							 	 <?php $addClass= ($insort ==$field['field'] ? 'class="tbl-sorting-active" ' : ''); ?>
								 <td style="word-wrap: break-word;min-width: 90px;max-width: 90px;" align="<?php echo e($field['align']); ?>" width=" <?php echo e($field['width']); ?>"  <?php echo $addClass; ?> >					 
								 	<?php echo SiteHelpers::formatRows($row->{$field['field']},$field ,$row ); ?>						 
								 </td>
								<?php endif; ?>	
							 <?php endif; ?>					 
						 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>			 
		                </tr>
						
		            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		              
		        </tbody>
		      
		    </table>
		    <?php else: ?>

	<div style="margin:100px 0; text-align:center;">
	
		<p> No existen datos !</p>
	</div>
	
	<?php endif; ?>
		    </div>
			<input type="hidden" name="action_task" value="" />
			
			<?php echo Form::close(); ?>

			
			
			<!-- End Table Grid -->

	</div>
	<?php echo $__env->make('footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div>
<!-- Modal -->
  <div class="modal fade p-5 " id="myModal" role="dialog" style="margin-top:-60px;">
    <div class="modal-dialog modal-dialog-centered">
    
      <!-- Modal content-->
      <div class="modal-content modal-sm text-center" >
       
        <div class="modal-body">
        	<img src="sximo5/images/send2.png" style="width: 40%;" />
          <H5>Proceso de Env&iacute;o Completado !</H5>
          <button type="button" class="btn btn-default" data-dismiss="modal" style="border-color: #f29f41;margin-bottom: -1px;margin-top: 5px;font-size:13px;">Cerrar</button>
        </div>
        
      </div>
      
    </div>
  </div>
<!-- Modal -->
</div>
<script>
$(document).ready(function(){
	$('.copy').click(function() {
		var total = $('input[class="ids"]:checkbox:checked').length;
		if(confirm('are u sure Copy selected rows ?'))
		{
			$('input[name="action_task"]').val('copy');
			$('#SximoTable').submit();// do the rest here	
		}
	})	
	
});	

function cuota3() {
  $("#myModal").modal()
    
}

</script>	
<style>
    
    td,th { text-align: center;
   

    }
    
 .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/index.blade.php ENDPATH**/ ?>