@extends('layouts.master')

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

    </section>
    <br/>
    @if( auth()->user()->is_superadmin )
    <a href="{{ url('/supplier/create') }}"  class="btn btn-success">Create New Supplier </a>
    <a href="{{ url('/waste_supplier/create') }}"  class="btn btn-success"> <strong>Add Waste To Supplier </strong></a>
    @else
	    <span>&nbsp;&nbsp;</span>
    @endif
    <br/><br/>
<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;">  الاسم  </th>
                  <th style="text-align:center;vertical-align: middle;">  العنوان   </th>
                  <th style="text-align:center;vertical-align: middle;"> رقم الهاتف  </th>
                  
        				  
                  <th style="text-align:center;vertical-align: middle;">  الفاكس  </th>
                  <th style="text-align:center;vertical-align: middle;">  الايميل   </th>
                  <th style="text-align:center;vertical-align: middle;">  المسؤل البيئي  </th>

                  <th style="text-align:center;vertical-align: middle;">  دور المسؤل  </th>
                  <th style="text-align:center;vertical-align: middle;">  رقم الهاتف المسؤل   </th>
                  <th style="text-align:center;vertical-align: middle;">  ايميل المسؤل  </th>

                  <th style="text-align:center;vertical-align: middle;">  رقم التسجيل التجاري  </th>
                  <th style="text-align:center;vertical-align: middle;">  رقم الضريبي   </th>
                  <th style="text-align:center;vertical-align: middle;">  رخصة التشغيل  </th>

                  <th style="text-align:center;vertical-align: middle;">  رقم التسجيل الصناعي  </th>
                  <th style="text-align:center;vertical-align: middle;">  المدينة الصناعية   </th>

                  <th style="text-align:center;vertical-align: middle;"> Actions  </th>
                </tr>
                </thead>
                <tbody>
                 @foreach( $suppliers as $supplier )   
                
                 
                
                 <tr>
                  
                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$supplier->name}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$supplier->address}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$supplier->phone}}  </td>

                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$supplier->fax}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$supplier->email}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$supplier->environmental_response}}  </td>

                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$supplier->resp_position	}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$supplier->resp_phone}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$supplier->resp_email}}  </td>

                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$supplier->commertial_registration_no}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$supplier->tax_card_no}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;"> {{$supplier->operating_licence_no}}  </td>


                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$supplier->industrial_registration_no}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{$supplier->city->name }} </td>


                  <td style="text-align:center; width:50px;word-break: break-word;" > 
                  @if( auth()->user()->is_superadmin )
                  <a   href='{{url("/supplier/edit/$supplier->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()->is_superadmin )
                  <a   href='{{url("/supplier/delete/$supplier->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
