@extends('layouts.master')

@section('content')

<section class="invoice" style="border: 0px solid #f4f4f4; padding:30px" dir="rtl" >

    <div class = "col-md-12" style="padding-bottom:20px"> 

        <div class = "col-md-6" style="font-size:25px; font-weight:bold">
        تقرير
        </div>
        <div class = "col-md-6" style="font-size:18px;">
        {{ \Carbon\Carbon::now()->toDateString() }} 
        </div>
    </div>

<div style="margin-right:30px; font-size:16px;font-weight:bold">
  
  تقرير شركة إعادة تدوير 
  |
{{$customer}}
 |
الفترة من&nbsp;  
{{ $dateFrom }} 
&nbsp; الـي   &nbsp;
 {{ $dateTo}}
 &nbsp;
</div>
<div style="margin-right:30px; font-size:16px; font-weight:bold; margin-top:10px">
@foreach ($selected_suppliers as $supplier  )
        {{ $supplier->name  }} &nbsp; - &nbsp;  
@endforeach
 </div>
</section>

<section class="invoice" style="border: 0px solid #f4f4f4;" >
      <!-- title row -->

     


       
     

       

      <!-- Table row -->
      <div class="row">
        <div class="col-xs-12 table-responsive">
          <table class="table table-striped">
            <thead>
            <tr>
                  <th > اسم شـركـة الـتـدويـر   </th>
                  <th >الـصنـف</th>
                  
                  <th >المـورد</th>
                  <th >الـكـمـيـة / كـجـم</th>
                  <th >الـكـمـيـة / عـدد</th>
                  
            </tr>
            </thead>
            <tbody>
             
             
            @foreach( $mains as  $key=>$main )
                 <tr>
                  <td > {{$customer }} </td>
                   
                  <td > {{ $main->waste->name }}</td>
                  <td > {{ $main->supplier->name}} </td>
                   
                   @if ( $main->waste->unit == "كجم")
                   <td > {{ $main->quantity }}  </td>
                   @else
                   <td > </td>
                   @endif
                   @if ( $main->waste->unit == "عدد")
                   <td > {{ $main->quantity }}  </td>
                   @else
                   <td > </td>
                   @endif
 
                 </tr>
                 @endforeach



                  
            </tbody>

            <tfoot>
              <tr>
              <td>  </td>
              <td>  </td>
                <td style="font-weight: bold;font-size: 20px;">   الأجمالي</td>
                 
                <td style="font-weight: bold;font-size: 20px;">كجم   {{$sum_kg}}  </td>
                <td style="font-weight: bold;font-size: 20px;"> عدد   {{$sum_num}}   </td>
              
              </tr>
            </div>

          </table>
        </tfoot>
        <!-- /.col -->
      </div>
       
    



 
 



      
</section>




@endsection
