@extends('layouts.dashboard')
@section('page_title')
	BOQ Details
@endsection
@section('page_header_title')
	BOQ Details
@endsection
@section('page_body')
{{ Breadcrumbs::render('boqdetails',Crypt::encrypt($boq_detail->id)) }}
@php($label_list = EF::getWhiteLabel())
 <div class="my-3 my-md-5">
          <div class="container">
            <div class="row">
              <div class="col-md-12">
                <div class="card">
                  <div class="card-header">
                    <h3 class="card-title"><b>BOQ({{$boq_detail->status}})</b> </h3>
                  </div>

                  <div class="card-body">
                    <div class = "card">
                      <div class ="card-body">
                        <div class ="row">
                          <div class="col-md-5">
                            <div class="row">
                            <h4 class="col-md-12" style="background:#1c35b6;padding:5px;color:white">BOQ Details</h4>
                            <div class="col-md-12">
                              <table style="width:100%">
                                <tr>
                                  <th>Project</th>
                                  <td>{{$boq_detail->branch->name}}</td>
                                </tr>
                                 <tr>
                                  <th>Floor</th>
                                  <td>{{$boq_detail->floor}}</td>
                                </tr>
                                <tr>
                                  <th>BOQ #</th>
                                  <td>{{$boq_detail->sr_no}}</td>
                                </tr>
                                <tr>
                                  <th>Remarks</th>
                                  <td>{{$boq_detail->remarks}}</td>
                                </tr>
                                <tr>
                                  <th>Created At</th>
                                  <td>{{EF::dateFormat($boq_detail->created_at)}}</td>
                                </tr>

                              </table>
                            </div>
                          </div>
                        </div>
                        </div>
                      </br>
                        <!-- <hr style="width:100%;border-top:1px solid #1c35b6"> -->
                        <div class ="row">
                          <div class="col-md-12">
                            <table style="width:100%" class="table table-bordered">
                              <thead>
                                <tr>
                                  <th>#</th>
                                  <th>Item</th>
                                  <th>Type</th>
                                  <th>Quantity</th>
                                  <th>Unit</th>
                                  <th>Category</th>
                                  <th>Remarks</th>
																	<th>Required Date</th>
                                  <th>Status</th>
                                </tr>
                              </thead>

                              <tbody>
                                @foreach($boq_detail->getBoqItems as $rows)
                                <tr>
                                  <td>{{$loop->iteration}}</td>
                                  <td>{{$rows->item->name}}</td>
                                  <td>{{$rows->item->type}}</td>
                                  <td>{{$rows->quantity}}</td>
                                  <td>{{$rows->item->inventoryUnit->name}}</td>
                                  <td>{{$rows->item->inventoryCategory->name}}</td>
                                  <td>{{$rows->item_description}}</td>
																	<td>{{EF::dateFormat($rows->created_at)}}</td>
                                  <td>{{$rows->boq->status}}</td>
                                </tr>
                                @endforeach
                              </tbody>
                            </table>
                          </div>
                        </div>

                                  <div class="row">
                          <div class="col-md-2 pull-right">

                            @if($rows->boq->status == 'Pending' && Auth::user()->hasAnyPermission(['All','Accept BOQ']))
                                   <a  href="{{route('boqrequest.accept',['id' => Crypt::encrypt($boq_detail->id)])}}"  class="btn btn-success" content="accept boq" style="width:100%;"><i class="dropdown-icon fa fa-check "></i> Accept</a>
                                   @endif

                         </div>
                         <div class="col-md-2 pull-right">
                             @if($rows->boq->status == 'Pending' && Auth::user()->hasAnyPermission(['All','Reject BOQ']))
                                   <a  href="{{route('boq.reject',['id' => Crypt::encrypt($boq_detail->id)])}}"  class="btn btn-danger cls_delete" content="reject boq"  style="width:100%;"><i class="dropdown-icon fa fa-times "></i> Reject</a>
                                   @endif

                         </div>
                        </div>

                      </div>
                    </div>
                </div>
                </div>
              </div>
            </div>
            </div>
          </div>


@endsection

@section('page_modal')

@endsection

@section('page_script')

   @include('inventory_module.scripts.boq')

@endsection
