<?php $__env->startSection('morecss'); ?>
<style>
<!--
ul li{list-style:none;margin-bottom:0.5em;}
ul.demandes{margin-left:0;padding-left:0}
ul.demandes li:first-child{font-weight:600}
ul.demandes > li:first-child > a:first-child{font-size:x-large;}
ul.demandes li a.dropdown-toggle,ul ul li {font-size:small}
.dropdown-menu.messages{font-size:small}
.flex-item{width:150px;margin-bottom:2em;align-items: center;
    display: flex;
    justify-content: center;}
.flex-item a{text-align:center;color:#6666aa}
.flex-item a:hover{color:#6666ff}
.flex-item i{width:100%;font-size: 120px}
.text-shadow{text-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important }

-->
.coman-bg{
	background-image:none !important;
}
.pb-4, .py-4 {
    padding-bottom: 0rem!important;
}
.banner{
padding: 85px 0px;
}
.guest-home {
    background-image: url(../image/horizental-img.png);
    padding: 100px 0px 100px 0px;
    margin-top: 30px;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
}
.request{
	text-align: center;
    padding: 35px 0px;
}
.scroll-request{
	height: 375px;
    overflow-y: auto;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="banner">
         <div class="container">
            <div class="row">
               <div class="col-12">
                  <div class="banner-text">
                     <h1>Tableau de bord</h1>
                     <div class="banner-col-text-row d-flex">
                        <div class="banner-text-col-img">
                           <img src="<?php echo e(asset('image/PersonnageMecanicien.png')); ?>">
                        </div>
                        <div class="banner-text-col-text">
						<?php if(Auth::user()->prestataire): ?>
                    <h6>Connecté en tant qu'prestataire</h6>
                    <?php endif; ?>
					<?php if(Auth::user()->admin): ?>
                        <h6>Connecté en tant qu'admin</h6>
						<?php endif; ?>
                           <h2>Tableau de bord</h2>
                        </div>
						<?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>
                  </div>
               </div>
            </div>
         </div>
      </div>
	  <?php if(Auth::user()->admin): ?>
      <div class="container"  style="margin-top: 7%;">
         <div class="row">
            <div class="col-lg-3 col-sm-3 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('demandes.index')); ?>">
                     <img src="image/pictodemande.png">
                     <h5 class="mt-3">Demandes</h5>
                  </a>
                </div>
            </div>

            <div class="col-lg-3 col-sm-3 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('interventions.index')); ?>">
                     <img src="image/Pictodevis.png">
                     <h5 class="mt-3">Devis</h5>
                  </a>
                </div>
            </div>

            <div class="col-lg-3 col-sm-3 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('factures.index')); ?>">
                     <img src="image/PictoFactures.png">
                     <h5 class="mt-3">Picto Factures</h5>
                  </a>
                </div>
            </div>
			<div class="col-lg-3 col-sm-3 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('clients.index')); ?>">
                     <img src="image/clients.PNG">
                     <h5 class="mt-3">Clients</h5>
                  </a>
                </div>
            </div>
         </div> 
      </div>

      <div class="assistent-home">

         <div class="container">
         <div class="row pb-100">
            <div class="col-lg-4 col-sm-4 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('prestataires.index')); ?>">
                     <img src="image/pictoprestataire.png">
                     <h5 class="mt-3 text-white">Prestataires</h5>
                  </a>
                </div>
            </div>

            <div class="col-lg-4 col-sm-4 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('assistants.index')); ?>">
                     <img src="image/pictoassistants.png">
                     <h5 class="mt-3 text-white">Assistants</h5>
                  </a>
                </div>
            </div>

            <div class="col-lg-4 col-sm-4 col-12">
               <div class="demeandes-col text-center mt-3">
                  <a href="<?php echo e(route('communes.index')); ?>">
                     <img src="image/Pictocommunes.png">
                     <h5 class="mt-3 text-white">Communes</h5>
                  </a>
                </div>
            </div>

			</div> 
			<?php endif; ?>
			<?php if(Auth::user()->assistant): ?>
			<div class="guest-home">
					<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
		<div class="card request scroll-request">
                    	<h2>Connecté en tant qu'assistant</h2>
                    
                    	<h3>Demandes en cours</h3>
                    	<ul class="demandes"><?php $__currentLoopData = $demandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $demande): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    	<li><?php echo e($demande->created_at_date); ?> à <?php echo e($demande->created_at_time); ?> : 
                    			<a href="<?php echo e(route('demandes.show',$demande->id)); ?>"><?php echo e($demande->libelle); ?></a> 
                    			par <?php echo e($demande->user->fullname); ?> 
                    	<?php if(count($demande->messages)): ?> 
            				<a class="dropdown-toggle" 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; ?>
                    	</li>
                    	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    	</ul>
</div>
</div>
</div>
</div>
                	<?php endif; ?>
                	<?php if(Auth::user()->prestataire): ?>
					<div class="guest-home">
					<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
		<div class="card request">
                    	<h2>Mes interventions programmées</h2>
                    	<ul class="demandes">
                    	<?php $__currentLoopData = $demandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $intervention): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    		<li><a href="<?php echo e(route('interventions.show',$intervention->id)); ?>"><?php echo e($intervention->demande->libelle); ?></a> 
                    		<?php if($intervention->scheduled_at): ?>
                    		<small>programmée le <?php echo e(\Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $intervention->scheduled_at)->isoFormat('LLLL')); ?> </small>
                    		<?php endif; ?>
                    		</li>
                    	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    	</ul>
</div>
</div>
</div>
</div>
</div>
                    <?php endif; ?>
                    
                    <?php if(!(Auth::user()->admin || Auth::user()->assistant || Auth::user()->prestataire)): ?>
					<div class="guest-home">
					<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
		<div class="card request">
                    	<h2><a href="<?php echo e(route('demandes.create')); ?>" class="btn btn-click btn-lg font-weight-bold bg-warning  "><i class="fas fa-comment"></i> <span class="">Faire une demande d'intervention</span></a></h2>
                    	<?php if(count($demandes)): ?>
                        	<h3>Mes demandes</h3>
                        	<ul class="demandes">
                        	<?php $__currentLoopData = $demandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $demande): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        	<li><?php echo e($demande->created_at_date); ?> à <?php echo e($demande->created_at_time); ?> : 
                        			<a href="<?php echo e(route('demandes.show',$demande->id)); ?>"><?php echo e($demande->libelle); ?></a> 
                        			par <?php echo e($demande->user->fullname); ?> 
                			<?php if(count($demande->messages)): ?> 
                				<a class="dropdown-toggle" 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; ?>
                        	</li>
                        	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        	</ul>
                    	<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
                    <?php endif; ?>
                   <?php if(count($demandes)): ?>
                   <a href="<?php echo e(route('demandes.index')); ?>"><button class='btn btn-click'>voir toutes</button></a>
                   <?php endif; ?>
         </div> 
</div>

</div>


<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\HelloDjo_Source\resources\views/home.blade.php ENDPATH**/ ?>