@extends('layouts.master')

@section('content')



<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>
                  <th >الـكـمـيـة / كـجـم</th>
                  <th >الـكـمـيـة / عـدد</th>
                  <th >سـعـر الـوحـدة</th>
                  <th >الأجـمالـي</th>
            </tr>
            </thead>
            <tbody>
             
             
            @foreach( $mains as  $key=>$main )

                 
                 <tr>
                 
                   <td>{{ $main->driver->name}} </td>
                   <td>{{ $main->vehicle->vehicle_num}} </td>
                   <td>{{ $main->created_at}} </td>
                   
                   <td > {{ $main->supplier->name}} </td>
                  <td > {{ $main->waste->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
 
                  <td >{{$main->price ? $main->price : ''}} </td>
                 <td  >{{$main->price ? $main->price * $main->quantity: ''}} </td>

                   
                 </tr>
                 @endforeach



                  
            </tbody>

             

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



 
 



      
</section>




@endsection
