@extends('layout')
@section('title','Situation paiement hopital ')
@section('description','Situation paiement hopital')
@section('content')
			<br/>
          <div class="section-body">
		  <div class="row">
              <div class="col-12">
			  @if (session('status'))
            <div class="alert alert-warning" style="font-size: 15px; background-color: #328039; color: white">
                <i class="fa fa-check"></i> &nbsp; {{ session('status') }}
            </div>
        @endif

        @if (session('error'))
            <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white">
                <i class="ti-na"></i> {{ session('error') }}
            </div>
        @endif
        @if ($errors->any())
            <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white" >
                <ul>
                    @foreach ($errors->all() as $error)
                        <li> <i class="ti-na"></i> {{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
			  </div>
		  </div>
			<div class="row">
              <div class="col-12">
                <div class="card">
                  <div class="card-header">
                    <h4>Situation paiement hopital</h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th style="text-align:center;margin-top:-20px;" rowspan="2">Date</th>
							<th style="text-align:center;" rowspan="2">Libelle</th>
							<th style="text-align:center;" colspan="2">Mouvement</th>
							<th style="text-align:center;" rowspan="2">Solde</th>
                          </tr>
                        </thead>
                         <tbody>
	@foreach($transaction as $transactions)
	<tr>
        <td style="text-align:center;font-size:13px;">{{$transactions->date}}</td>
        <td style="text-align:center;font-size:13px;">{{$transactions->libelle}}</td>
		<td style="text-align:center;font-size:13px;">
		    <!--DEBIT -->
			@php
			if ($transactions->type =="Débit"){
				$lh = $transactions->montant;
				$lh1 =  number_format($lh, 0, ' ', ' ');
				echo $lh1."&nbsp;F";
			}
			@endphp
        </td>
		<td style="text-align:center;font-size:13px;">
			<!--CREDIT -->
			@php
			if ($transactions->type =="Crédit"){
			$lh = $transactions->montant;
			$lh1 =  number_format($lh, 0, ' ', ' ');
			echo $lh1."&nbsp;F";
			}
		@endphp
        </td>
		<td style="text-align:center;font-size:13px;">
		    <!--Différence valeur -->
			@php
		$lhhh = $transactions->solde;
		$lhhh1 =  number_format($lhhh, 0, ' ', ' ');
		echo $lhhh1."&nbsp;F";
		@endphp
        </td>
    </tr>
	@endforeach
    </tbody>
    </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
		
@endsection