<?php $__env->startSection('page_title'); ?>
	Manage Items
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_header_title'); ?>
	Manage Items
<?php $__env->stopSection(); ?>
<?php ($label_list = EF::getWhiteLabel()); ?>

<?php $__env->startSection('page_body'); ?>
<?php echo e(Breadcrumbs::render('items')); ?>

<div class="row row-cards row-deck" style="background: white;">
	<div class="col-12">

		<ul class="nav nav-tabs" id="myTab" role="tablist" style="padding-left: 2%;">
		  <li class="nav-item">
		    <a class="nav-link active" id="home-tab" data-toggle="tab" href="#productdiv" role="tab" aria-controls="servicediv" aria-selected="true">Products</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</a>
		  </li>

		</ul>

<div class="tab-content">


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

					    <?php if(Auth::user()->hasAnyPermission(['All','Add Service'])): ?>

					     <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;
             <?php endif; ?>

					     <h3 class="card-title">Add Service</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>Code</th>
                          <th>Category</th>
                          <th>Description</th>
                          <th>Unit</th>
                          <th>Min Quantity</th>
                          <th>Max Quantity</th>
                          <!-- <th>Project</th> -->

                   <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php if(isset($service_list)): ?>
                        <?php ($pass_data = []); ?>
                        <?php $__currentLoopData = $service_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php ($branch_curr = $rows->branch); ?>
                        <?php (
                        $pass_data = array(
                        'service'              => Crypt::encrypt($rows->id),
                        'service_name'             => $rows->name,
                        'service_code'             => $rows->code,
                        'service_description'      => $rows->description,
                        'service_unit'             => $rows->unit,
                        'service_minimum'          => $rows->minimum,
                        'service_maximum'          => $rows->maximum,
                        'service_category'         => $rows->inventoryCategory->name,
                        'service_unit'             => $rows->inventoryUnit->name,

                        EF::branchWhiteLabel()['module']               => $branch_curr->code.' '.$branch_curr->name,
                                )
                            ); ?>
                        <tr>
                        <td><?php echo e($loop->iteration); ?></td>
                        <td><?php echo e($rows->name); ?></td>
                        <td><?php echo e($rows->code); ?></td>
                        <td><?php echo e($rows->inventoryCategory->name); ?></td>
                        <td><?php echo e($rows->description); ?></td>
                        <td><?php echo e($rows->inventoryUnit->name); ?></td>
                        <td><?php echo e(EF::numberFormat($rows->minimum)); ?></td>
                        <td><?php echo e(EF::numberFormat($rows->maximum)); ?></td>
                        <!-- <td><?php echo e($rows->branch->name); ?></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">

                                    <?php if(Auth::user()->hasAnyPermission(['All','Update Service'])): ?>
                                      <a onclick="update(event,'<?php echo e(json_encode($pass_data)); ?>','form_update_service','md_update_service')" href="#" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
                                      <?php endif; ?>
                                    </div>

                                  </div>
                               </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      <?php endif; ?>
                      </tbody>
                    </table>
                  </div>
                </div>





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

											<?php if(Auth::user()->hasAnyPermission(['All','Add Product'])): ?>

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

											 <h3 class="card-title">Add Product</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>Code</th>
																	<th>Category</th>
																	<th>Description</th>
																	<th>Unit</th>
																	<th>Min Quantity</th>
																	<th>Max Quantity</th>


													 <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
																</tr>
															</thead>
															<tbody>
																<?php if(isset($product_list)): ?>
																<?php ($pass_data = []); ?>
																<?php $__currentLoopData = $product_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
																<?php ($branch_curr = $rows->branch); ?>
																<?php (
																$pass_data = array(
																'product'              => Crypt::encrypt($rows->id),
																'product_name'             => $rows->name,
																'product_code'             => $rows->code,
																'product_description'      => $rows->description,
																'product_unit'             => $rows->unit,
																'product_minimum'          => $rows->minimum,
																'product_maximum'          => $rows->maximum,
																'product_category'         => $rows->inventoryCategory->name,
                                  'product_unit'         => $rows->inventoryUnit->name,


																EF::branchWhiteLabel()['module']               => $branch_curr->code.' '.$branch_curr->name,
																				)
																		); ?>
																<tr>
																<td><?php echo e($loop->iteration); ?></td>
																<td><?php echo e($rows->name); ?></td>
																<td><?php echo e($rows->code); ?></td>
																<td><?php echo e($rows->inventoryCategory->name); ?></td>
																<td><?php echo e($rows->description); ?></td>
																<td><?php echo e($rows->inventoryUnit->name); ?></td>
																<td><?php echo e(EF::numberFormat($rows->minimum)); ?></td>
																<td><?php echo e(EF::numberFormat($rows->maximum)); ?></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">

																						<?php if(Auth::user()->hasAnyPermission(['All','Update Product'])): ?>
																							<a onclick="update(event,'<?php echo e(json_encode($pass_data)); ?>','form_update_product','md_update_product')" href="#" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
																							<?php endif; ?>
																							<?php if(Auth::user()->hasAnyPermission(['All','Product'])): ?>
																								<a href="<?php echo e(route('product.details', Crypt::encrypt($rows->id))); ?>" class="dropdown-item"><i class=" dropdown-icon  fa fa-eye"></i>View Details</a>
																								<?php endif; ?>
																						</div>



																					</div>
																			 </td>
																</tr>
																<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
															<?php endif; ?>
															</tbody>
														</table>
													</div>
												</div>


											</div>
									</div>

</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_modal'); ?>
  <?php echo $__env->make('inventory_module.item.modals.add_service', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('inventory_module.item.modals.update_service', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
	<?php echo $__env->make('inventory_module.item.modals.add_product', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('inventory_module.item.modals.update_product', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <div class="modal fade" id="md_add_category" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <?php echo e(Form::open(array('route' => 'inventory_category.store' , 'id' => 'form_add_category', 'class' => 'cls_form' , 'method' => 'POST' , 'enctype'=>'multipart/form-data'
))); ?>

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Category</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class ="card">
          <div class = "card-body form-fieldset">
          <div class="row">


            <div class="col-sm-12">
            <label class="label-color"> Name: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="name" class="form-control " required id="name" />
            </div>
            </div>

						<div class="col-sm-12">
            <label class="label-color"> Code: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="category_code" class="form-control " required id="code" />
            </div>
            </div>


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

      <div class="modal-footer">

          <input type ="hidden" name="category_type" class="category_type" value=""/>

        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

        <button type="submit" onClick="storeInventoryCategory(event,this)" class="btn btn-primary"   content="add category">Add Category</button>

      </div>
      <?php echo e(Form::close()); ?>

    </div>
  </div>

</div>

  <div class="modal fade" id="md_add_unit" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <?php echo e(Form::open(array('route' => 'inventory_unit.store' , 'id' => 'form_add_unit', 'class' => 'cls_form' , 'method' => 'POST' , 'enctype'=>'multipart/form-data'
))); ?>

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Unit</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class ="card">
          <div class = "card-body form-fieldset">
          <div class="row">


            <div class="col-sm-12">
            <label class="label-color"> Name: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="name" class="form-control " required id="name" />
            </div>
            </div>


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


      <div class="modal-footer">



        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

        <button type="submit" onClick="storeInventoryUnit(event,this)" class="btn btn-primary"   content="add unit">Add Unit</button>

      </div>
      <?php echo e(Form::close()); ?>

    </div>
  </div>

</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_script'); ?>
 <?php echo $__env->make('inventory_module.scripts.item', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/inventory_module/item/manage_item.blade.php ENDPATH**/ ?>