@extends('layouts.master')

@section('content')
<section class="content-header"  >
      <h1>
      Sell Store  
     <small>عرض مخازن البيع</small>
      </h1>
      <img   src="{{asset('dist/img/store.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('/store/branch/create') }}"  class="btn btn-success">Create Sell store </a><br/><br/>
    @else
	    <span>&nbsp;&nbsp;</span>
    @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;">  مخزن بيع رقم  </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>
        				 @if( auth()->user()->id  == 54 ) <th style="text-align:center;vertical-align: middle;"> Actions  </th>
        				 @endif
                </tr>
                </thead>
                <tbody>
                 @foreach( $store_branches as $store_branche )   
                
                 
                
                 <tr>
                 <td style="text-align:center; width:50px;word-break: break-word;" >  <b>{{$store_branche->id}}</b> </td>
                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$store_branche->branch_id ? $store_branche->branch->name:''}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;">{{ $store_branche->store_id ?  $store_branche->store->store_name :''}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$store_branche->quantity}} </td>
                  <td style="text-align:center; width:50px;word-break: break-word;" >  {{$store_branche->unit_price}} </td>
                  @if( auth()->user()->id  == 54 )
                  <td style="text-align:center; width:50px;word-break: break-word;" > 
                  @if( auth()->user()->edit_ )
                  <a   href='{{url("/store/branch/edit/$store_branche->id")}}'  > <i class="fa fa-edit" style="font-size:18px"></i>  </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  @else
	                  <span>&nbsp;&nbsp;</span>
                  @endif
                </td>
                @endif
                </tr>
                @endforeach
                </tbody>
                
              </table>
            </div>
            <!-- /.box-body -->
          </div>

@endsection
