
<?php $__env->startSection('morecss'); ?>
<style>
.messages{font-size:small}
.fnt_w{
	font-weight: 400 !important;
}
.fnt_m{color: #f6a940 !important;}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('head'); ?>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css">
   
<!-- Scripts -->
    
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/mdb.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript">
   $(document).ready(function() {
   
$('#example').DataTable();
	   jQuery('#datepicker').datepicker({
	  format: 'dd-mm-yyyy',
	  startDate: '+1d'
  });
   } );
</script>
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
<div class="container mt-5">
            <div class="row">
               <div class="col-lg-7 col-sm-12 col-12">
                  <div class="mendas-data">
                     <h4 class="text-center mb-5">Demandes <?php if(request()->user): ?><br><small>de <?php echo e(\App\User::find(request()->user)->fullname); ?></small> <?php endif; ?></h4>
					 <form action="<?php echo e(route('demandes.index')); ?>" method="get">
                		<?php if(request()->user): ?> <input type="hidden" name="user" value="<?php echo e(request()->user); ?>" /><?php endif; ?>
                     <div class="row mb-5">
                        <div class="col-lg-6 col-sm-6 col-12">
                           <div class="form-group row mb-0">
                              <label class="col-3">
                                 <div class="label-text">
                                   <span id="basic-addon1"> <i class="fas fa-calendar-week mr-2"></i> DU</span>
                                 </div>
                              </label>
                              <div class="col-9">
								 <input type="text" class=" calendar form-control"   value="<?php echo e(request()->datedeb); ?>" id="datedeb" name="datedeb" placeholder="jj/mm/aaaa" aria-label="nom" aria-describedby="basic-addon2">
                                 <hr class="mt-1 mb-1">
                              </div>
                           </div>

                           <div class="form-group row mb-0">
                              <label class="col-3">
                                 <div class="label-text">
                                    <i class="fas fa-calendar-week mr-2"></i> AU
                                 </div>
                              </label>
                              <div class="col-9">
							  <input type="text" class="form-control calendar" value="<?php echo e(request()->datefin); ?>" id="datefin" name="datefin" placeholder="jj/mm/aaaa" aria-label="nom" aria-describedby="basic-addon2">
                                 </div>
                           </div>
						
                        </div>

                        <div class="col-lg-6 col-sm-6 col-12">
                           <div class="form-group row mb-0">
                              <label class="col-2">
                                 <div class="label-text">
                                    <i class="fas fa-clock"></i>
                                 </div>
                              </label>
                              <div class="col-10">
                                 <input type="checkbox"> Matin&eacute;e
                              </div>
                           </div>

                           <div class="form-group row mb-0">
                              <label class="col-2">
                                 <div class="label-text">
                                    <i class="fas fa-clock"></i>
                                 </div>
                              </label>
                              <div class="col-10">
                                 <input type="checkbox"> Apr&egrave;s-midi
                              </div>
                           </div>
                        </div>
				    	<div class="col-9 filter_div">
<button class="btn-color filter" type="submit"><i class="fas fa-search"></i> Filtrer</button>
<button onclick="document.getElementById('datedeb').value=document.getElementById('datefin').value='';" class="float-right btn-color cancel" type="submit"><i class="fas fa-window-close"></i> Annuler</button>
                        </div>
                     </div>
</form>
<?php if(session('status')): ?>
                    <div class="alert alert-success" role="alert">
                        <?php echo e(session('status')); ?>

                    </div>
                <?php endif; ?>
                <?php if($errors->any()): ?>
    				<ul class="alert alert-warning">
    					<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
				<li><?php echo e($error); ?></li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    				</ul>
				<?php endif; ?> 
				<?php if(session()->has('message')): ?>
    				<div class="alert alertToolsBar alert-info alert-dismissible fade show }}"> 
                    <?php echo session('message'); ?>

                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                      </button>
                    </div>
    			<?php endif; ?>
                     <div class="table-responsive">
                       <table  class="table" style="width:100%">
                        <thead>
                           <tr>
                               <th><strong>DATES</strong></th>
                               <th><strong>TITRE</strong></th>
                               <th><strong>STATUT</strong></th>
							   <?php if(!Auth::user()->isClient()): ?>
				                <th><strong>CLIENT</strong></th>
				                <?php endif; ?>
                               <th><strong>MESSAGE</strong></th>
                           </tr>
                        </thead>
                        <tbody>
						<?php $__currentLoopData = $demandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $demande): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                           <tr <?php if($demande->current_status_id=='PAYEE' && (\Carbon\Carbon::now()->diffInDays($demande->created_at_date_object)<7)): ?> class="table-warning"
			                <?php elseif($demande->current_status_id=='PAYEE'): ?> class="table-danger" 
			                	<?php endif; ?>>
			                	<td><?php echo e($demande->created_at_date); ?> à <?php echo e($demande->created_at_time); ?></td>
								<td>
									<a href="<?php echo e(route('demandes.show',$demande->id)); ?>" class="fnt_w"><?php echo e($demande->libelle); ?></a>
								</td>
								<td><?php if($demande->current_status): ?> <?php echo e($demande->current_status->libelle); ?> <?php endif; ?></td>
			                    <?php if(!Auth::user()->isClient()): ?>
			                    <td><?php echo e($demande->user->fullname); ?></td>
			                    <?php endif; ?>
                               
                               <td class="text-orange">
							   <?php if(count($demande->messages)): ?> 
							   <a class="dropdown-toggle fnt_w fnt_m" data-toggle="dropdown" href="#" ><?php echo e(count($demande->messages)); ?> messages dont <?php echo e(count($demande->messages->where('lu','=',null))); ?> non lus
                    				<span class="caret"></span></a>
                            		<div class="dropdown-menu messages">
                                	<?php $__currentLoopData = $demande->messages->where('lu','=',null); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            							<a class="dropdown-item" href="<?php echo e(route('demandes.show',$demande->id)); ?>#<?php echo e($message->id); ?>">le <?php echo e($message->created_at_date); ?> à <?php echo e($message->created_at_time); ?> par <?php echo e($message->user->fullname); ?></a>
                                	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        	    	</div>
                            	
                            	<?php endif; ?>

							   </td>
                           </tr>
						   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                          
                        </tbody>
                     </table>
					 <?php echo e($demandes->links()); ?>

                     </div> 
					 <?php if(Auth::user()->isClient()): ?>
                    <h2><a href="<?php echo e(route('demandes.create')); ?>" class="btn btn-warning btn-lg"><i class="fas fa-comment"></i> Faire une demande d'intervention</a></h2>
                    <?php endif; ?>
                  </div>
				  <p class="pt-4"><a href="javascript:history.back()" class="text-dark"><i class="fas fa-chevron-left mr-2"></i>Retour</a></p>
               </div>
            </div>
         </div>
		

         <img src="image/PersonnageMecanicien.png" class="comman-image-all1">
      </div>
   
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/younguxc/hellodjo.younggeeks.co.in/resources/views/demandes/index.blade.php ENDPATH**/ ?>