@extends('layouts.dashboard')
@section('page_title')
Manage Stocks
@endsection
@section('page_header_title')
Manage Stock
@endsection
@php($label_list = EF::getWhiteLabel())

@section('page_body')
{{ Breadcrumbs::render('stock.view') }}
<style>
.blinking {
  -webkit-animation: 1s blink ease infinite;
  -moz-animation: 1s blink ease infinite;
  -ms-animation: 1s blink ease infinite;
  -o-animation: 1s blink ease infinite;
  animation: 1s blink ease infinite;

}

@keyframes "blink" {
  from, to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@-moz-keyframes blink {
  from, to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@-webkit-keyframes "blink" {
  from, to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@-ms-keyframes "blink" {
  from, to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@-o-keyframes "blink" {
  from, to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
</style>
	<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                	  <div class="card-header">



					     <h3 class="card-title">Stocks</h3>
							 <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_tansfer_stock_product" ><i class="fa fa-share"></i> Transfer Stock</button> &nbsp;&nbsp;
					  </div>
                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>

                          <th>#</th>
                          <th>Product Code</th>
                          <th>Name</th>
                          <th>Unit</th>
                          <th>Stock</th>
                   <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                        </tr>
                      </thead>
                     <tbody>
                      @if(isset($product_list))
                      @foreach($product_list as $rows)
                      <tr>
                        <td>{{$loop->iteration}}</td>
                        <td>{{$rows->code}}</td>
                        <td>{{$rows->name}}</td>
                        <td>{{$rows->inventoryUnit->name}}</td>
                        <td>
                        @if($rows->quantity == "0")
                          <span class="badge badge-danger"> Out Of Stock</span>
                        @else
                          <span class="badge badge-success"> {{$rows->quantity}}</span>
                        @endif
                        @if($rows->quantity < $rows->minimum)
                        <svg height="40" width="40" class="blinking">
                          <circle cx="20" cy="20" r="5" fill="red" />
                          Sorry, your browser does not support inline SVG.
                        </svg>
                        @endif
                        </td>
                        <td class="text-center">
                          <div class="item-action dropdown">
                          <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
                          <div class="dropdown-menu dropdown-menu-right">
                          @if(Auth::user()->hasAnyPermission(['All','Stock Details']))
                          <a  href="{{route('stock.details',['id' => Crypt::encrypt($rows->id)])}}"  class="dropdown-item" content="accept boq"><i class="dropdown-icon fa fa-eye "></i> View Stockwise Details</a>

                          <a href="{{ route('product.details', Crypt::encrypt($rows->id))}}" class="dropdown-item"><i class="dropdown-icon fa fa-eye"></i>View Projectwise Details</a>

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

@section('page_modal')
@include('inventory_module.stock.modals.transfer')
@endsection

@section('page_script')

@endsection
