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

@section('page_body')
{{ Breadcrumbs::render('gin.view') }}
<div class="row row-cards row-deck" style="background: white;">
	<div class="col-12">

		<ul class="nav nav-tabs" id="myTab" role="tablist">
		  <li class="nav-item">
		    <a class="nav-link active pl-5" id="home-tab" data-toggle="tab" href="#productdiv" role="tab" aria-controls="servicediv" aria-selected="true">Products GIN</a>
		  </li>
      {{--
		  <li class="nav-item">
		    <a class="nav-link" id="profile-tab" data-toggle="tab" href="#servicediv" role="tab" aria-controls="productdiv" aria-selected="false">Services GIN</a>
		  </li>
      --}}

		</ul>

<div class="tab-content">

{{--
                <div class="tab-pane fade " id="servicediv" role="tabpanel" aria-labelledby="servicediv-tab">
                	  <div class="card-header">

					    @if(Auth::user()->hasAnyPermission(['All','Add Service GIN']))

					     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_service" ><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
             @endif

					     <h3 class="card-title">Create Service GIN</h3>
					  </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>Name</th>
                          <th>Contractor</th>
                          <th>Remarks</th>
                          <th>Project</th>
													<th>Floor</th>
													<th>PO Number</th>
                          <th>issuance_date</th>



                        </tr>
                      </thead>
                      <tbody>
                        @foreach($service_note as $sn_row)
                        <tr>
                          <td>{{$loop->iteration}}</td>
                          <td>{{$sn_row->item->name}}</td>

													<td>{{$sn_row->user->name}}</td>
                          <td>{{$sn_row->remarks}}</td>
                          <td>{{$sn_row->project->name}}</td>
													<td>{{$sn_row->floor}}</td>
													<td>{{$sn_row->p_number}}</td>
                          <td>{{EF::dateFormat($sn_row->created_at)}}</td>

                        </tr>
                        @endforeach
                      </tbody>
                    </table>
                  </div>
                </div>
           --}}

            <div class="tab-pane fade show active" id="productdiv" role="tabpanel" aria-labelledby="productdiv-tab">
              <div class="card-header">

                @if(Auth::user()->hasAnyPermission(['All','Add Product GIN']))

                  <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_gin_product" ><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
                @endif

											 <h3 class="card-title">Create Product GIN</h3>
										</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</th>
                                  <th>Quantity</th>
                                  <th>Remarks</th>
                                  <th>Project</th>
																	<th>Floor</th>
																	<th>PO Number</th>
                                  <th>Issued To</th>
                                  <th>Issuance Date</th>
                                  <th>Action</th>
																	<th>Details</th>


																</tr>
															</thead>
															<tbody>
                                @foreach($product_note as $pn_row)
																<tr>
                                  <td>{{$loop->iteration}}</td>
                                  <td>{{$pn_row->item->name}}</td>
                                  <td>{{$pn_row->quantity}}</td>
                                  <td>{{$pn_row->remarks}}</td>
                                  <td>{{$pn_row->project->name}}</td>
																	<td>{{$pn_row->floor}}</td>
																	<td>{{$pn_row->p_number}}</td>
                                  <td>{{$pn_row->user->name}}</td>
                                  <td>{{EF::dateFormat($pn_row->created_at)}}</td>
                                  <td>
                                      @if(Auth::user()->hasAnyPermission(['All','GIN Document']))
                                    <a href="{{ route('downloadPDF.gin', Crypt::encrypt($pn_row->id))}}" target="_blank"><i class="fa fa-print"></i></a>
                                    @endif
                                  </td>
																	<td>
                                      @if(Auth::user()->hasAnyPermission(['All','GIN Document']))
                                    <a href="{{ route('viewdetail.gin', Crypt::encrypt($pn_row->id))}}" target="_blank"><i class="fa fa-eye"></i></a>
                                    @endif
                                  </td>
																</tr>
                                @endforeach

															</tbody>
														</table>
													</div>
												</div>


											</div>
									</div>

</div>

@endsection

@section('page_modal')
@include('inventory_module.issuance_notes.modals.gin_service')
@include('inventory_module.issuance_notes.modals.gin_product')
@endsection

@section('page_script')

@endsection
