<html>
    <meta charset="utf-8"/>
	<link rel="stylesheet" href="css/style.css" />
    <head>
      <title>Bulletin de paie</title>
	  <style>


	.bloc2{
		display:inline-block;
		position:relative;
		text-align:center;
		margin-top:-25px;
		width:100%;
		padding-top: -10px;
		border-bottom:1px solid #000;
	}
	
		
		</style>
    </head>
    <body>
	<div class="bloc"> 
		   @php
			$ig = DB::table('magasin')->orderBydesc('id')->take(1)->first()->logo_fichier;
			@endphp
			<div class="bloc2">
				<p style="margin-top:15px;color:#000;font-size:16px;">
				<img src="{{public_path('/storage/'.$ig)}}" style="height:75px"> <br/>
				<b><u>{{DB::table('magasin')->orderBydesc('id')->take(1)->first()->nom}}</u></b><br>
				{{DB::table('magasin')->orderBydesc('id')->take(1)->first()->telephone}} {{DB::table('magasin')->orderBydesc('id')->take(1)->first()->email}} <br/>
				</p>
				
		    </div>
		    </div>
			<br/><br/>
	<div class="entete">
            @php
            $mois = (new \Carbon\Carbon($salaire->date_debut))->locale('fr')->monthName;

            $today = date('d/m/Y');
            $today= explode('-', $today);
            $today= array_reverse($today);
            $today= implode('/', $today);

            $dated = $salaire->date_debut;
            $dated= explode('-', $dated);
            $dated= array_reverse($dated);
            $dated= implode('/', $dated);

        

            $datef = $salaire->date_fin;
                        $datef= explode('-', $datef);
                        $datef= array_reverse($datef);
            $datef= implode('/', $datef);

        @endphp
		<b>BULLETIN DE PAIE</b><br/>
    Mois de : {{ucfirst($mois)}}<br/>
    Du      : {{$dated}}<br/>
    Au      : {{$datef}}<br/>
    </div>
		<br/><br/>
        <div class="etat">
		    <table class="t0">
            <tr><td width="160px;"><strong>Nom :</strong></td><td  width="150px;">{{$employe->nom}}</td><td width="150px;"><strong>Fonction :</strong></td><td>{{$employe->fonction}}</td></tr>
			<tr><td><strong>Prénoms :</strong></td><td>{{$employe->prenoms}}</td><td><strong></strong></td><td></td></tr>
			</table>
			<br/>
			<table class="t1" border="1" style="border-collapse:collapse;width:650px">
			    <tr>
				   <th align="center">Code</th>
				   <th align="center">Libellé</th>
				   <th align="center">Base</th>
				   <th align="center">Retenues</th>
                </tr>
                @php
                     $totalretenu = $salaire->retenue;
                     $totalprime = $salaire->total_prime;
                     $net = $salaire->net_a_payer ;

                @endphp
				<tr><td height="20px" align="center">0550</td><td>Salaire de base</td><td align="center">{{number_format($employe->salaire_base, 0, ' ', ' ')}} </td><td align="center">{{number_format($salaire->retenue, 0, ' ', ' ')}}</td></tr>

                </table>
                <br>
                <table class="t1" border="1" style="border-collapse:collapse;width:400px">
                    <tr>
                        <td align="center" height="30px"><b>Primes</b></td>
                        <td align="center" height="30px"><b>Montant</b></td>
                    </tr>
                    @foreach($prime as $primes)
                    <tr>
                        <td height="30px" align="center">{{$primes->type}} </td>
                        <td height="30px" align="center">{{number_format($primes->montant, 0, ' ', ' ')}} </td>
                    </tr>
                    @endforeach
                    <tr>
                        <td align="center" height="20px"><b>Total prime</b></td>
                    <td align="center" height="20px"><b>{{number_format($totalprime, 0, ' ', ' ')}}</b></td>
                    </tr>
                </table>
                <table border="1" style="border-collapse:collapse;margin-left:435px;">
                    <tr>
                        <td align="center" height="30px"><b>Total avance sur salaire</b></td>
                        <td align="center" height="30px"><b>{{number_format($salaire->avance, 0, ' ', ' ')}}</b></td>
                    </tr>
                   
                </table>
                <br>
            <table class="t1" border="1" style="border-collapse:collapse;width:400px">
				
				<tr><td align="center"><b>Net à payer</b></td><td align="center"><font color="brown"><b>{{number_format($net, 0, ' ', ' ')}} </b></font></td></tr>
			</table>
			<br/>
			 <p style="text-align:center;font-size: 13px;">
              <br/>
              <strong> <font color="brown">POUR TOUTE RÉCLAMMATION CONCERNANT VOTRE BULLETIN, VEUILLEZ CONTACTER LE SERVICE RH </font></strong></p>
             <p style="margin-right: 5px;font-size: 13px;" align="right"><strong>Délivré le : {{$today}}</strong></p>
            </div>
			<footer style="position:fixed;bottom:50px;text-align:center;">
        <p align="center">
		<hr/>
				{{DB::table('magasin')->orderBydesc('id')->take(1)->first()->adresse}}<br/>
		<strong>&copy; {{DB::table('magasin')->orderBydesc('id')->take(1)->first()->nom}} 2019-2020 </strong>  </p>
        </footer>
    </body>

</html>
