@extends('layouts.dashboard')
@section('page_title')
	Items Details
@endsection
@section('page_header_title')
	 Items Details
@endsection
@php($label_list = EF::getWhiteLabel())

@section('page_body')
{{ Breadcrumbs::render('items') }}
<div class="row row-cards row-deck" style="background: white;">
	<div class="col-12">
    <div class ="row">
      <div class="col-md-4">
        <div class="row">
        <h4 class="col-md-12" style="background:#656877;padding:5px;color:white">Product Detail</h4>
        <div class="col-md-12">
          <table style="width:100%">
            <tr>
              <th>Product Code</th>
              <td>{{$product_list->code}}</td>
            </tr>
            <tr>
              <th>Product Name</th>
              <td>{{$product_list->name}}</td>
            </tr>
						<tr>
							<th>Unit</th>
							<td>{{$product_list->inventoryUnit->name}}</td>
						</tr>
            <tr>
              <th>Category</th>
              <td>{{$product_list->inventoryCategory->name}}</td>
            </tr>
            <tr>
              <th>Stock</th>
              <td>{{$product_list->quantity}}
                @if($product_list->quantity == 0)
                <span class="label label-danger">Out Of Stock</span>
                @endif
              </td>
            </tr>
            <tr>
              <th>Description</th>
              <td>{{$product_list->description}}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <hr style="width:100%;border-top:1px solid #1d55a5 !important">
    <div class="col-md-12">

      <div class="row">

        @foreach($branch as $bl)
        <div class="col-md-3 col-sm-6">
          <div class="card box" style="height:100px;">
                <div class="card-status card-status-left bg-blue"></div>
            <div class="card-body report-card text-center">
              <?php
                $qty = $bl->getQty($product_list->id,$bl->id);
              ?>
              <div class ="col-md-12">
                  <h4>{{$bl->name}} ({{$qty}})</h4>
             </div>
            </div>
          </div>
        </div>
        @endforeach
      </div>

    </div>
        </div>
    <hr style="width:100%;border-top:1px solid #1d55a5 !important">

    <div class="row">
      <div class="col-md-12">
        <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
          <thead>
            <tr>

              <th>#</th>
              <th>Quantity</th>
              <th>From Project</th>
              <th>To Project</th>
              <th>Dated</th>
            </tr>
          </thead>
         <tbody>
          @if(isset($stock_list))
          @foreach($stock_list as $rows)
          <tr>
            <td>{{$loop->iteration}}</td>
						<td>{{$rows->stock_in_qty}}</td>
            <td>{{$rows->from_branch->name}}</td>
            <td>{{$rows->to_branch->name}}</td>
            <td>{{EF::dateFormat($rows->created_at)}}</td>

          </tr>
          @endforeach
          @endif
          </tbody>
        </table>
      </div>
    </div>
</div>
</div>

@endsection

@section('page_modal')


@endsection

@section('page_script')
 @include('inventory_module.scripts.item')
@endsection
