@extends('layouts.master')

@section('content')
<section class="content-header"  >
      <h1>
     Waste Show  
     <small>عرض المخلفات</small>
      </h1>
      <img   src="{{asset('dist/img/waste.png')}}"  alt="User Image" style="width: 200px;height: 150px;position: absolute;top: -9px;z-index: 1;right: 150px;">

    </section>
    <br/>
    @if( auth()->user()->create_ )
    <a href="{{ url('/waste/create') }}"  class="btn btn-success">Create New Waste </a><br/><br/>
    @else
    <span>&nbsp;&nbsp;</span><br/><br/>
    @endif
<div class="box" >
            <div class="box-header">
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1"  class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th style="text-align:center;vertical-align: middle;"> Name-الاسم  </th>
                  <th style="text-align:center;vertical-align: middle;"> Unit - الوحدة   </th>
                  <th style="text-align:center;vertical-align: middle;"> Class - الفئة  </th>
                  <th style="text-align:center;vertical-align: middle;"> Group - المجموعة  </th>
                  <th style="text-align:center;vertical-align: middle;"> Classification - التصنيف  </th>

                  <th style="text-align:center;vertical-align: middle;"> Recycle Methods - طرق التخلص المعتمد  </th>
        				  <th style="text-align:center;vertical-align: middle;"> Store - المخزن  </th> 
        				  
        				 <th style="text-align:center;vertical-align: middle;"> price   </th>
        				 <th style="text-align:center;vertical-align: middle;"> Actions  </th> 
        				  
                </tr>
                </thead>
                <tbody>
                 @foreach( $wastes as $waste )   
                
                 
                
                 <tr>
                  
                  <td style="text-align:center; width:50px;word-break: break-word;" >{{$waste->name}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$waste->unit}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->class_->name}}  </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->group->name}}  </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->classification->name}}  </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->res_method->name}}  </td>
                 <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->store_id? $waste->store->store_name:NULL}} </td>
                
                <td style="text-align:center; width:50px;word-break: break-word;"> {{$waste->price}}  </td>
                
                  <td style="text-align:center; width:50px;word-break: break-word;" > 
                  @if( auth()->user()->edit_ )
                  <a   href='{{url("/waste/edit/$waste->id")}}'  > <i class="fa fa-edit" style="font-size:18px"></i>  </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  @else
	                  <span>&nbsp;&nbsp;</span>
                  @endif
                  @if( auth()->user()->delete_ )
                  <a   href='{{url("/waste/delete/$waste->id")}}' onclick="return confirm('Are you sure you want to delete this item?');" > <i class="fa fa-trash" style="font-size:18px; color:red"></i>  </a>
                  @else
	                  <span>&nbsp;&nbsp;</span>
                  @endif
                </td>
                </tr>
                @endforeach
                </tbody>
                
              </table>
            </div>
            <!-- /.box-body -->
          </div>

@endsection
