<?php $__env->startSection('page_title'); ?>
	Manage <?php echo e(ucwords(str_replace('_',' ',$plot_labels['module']))); ?>

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

<?php $__env->startSection('page_header_title'); ?>
	Manage Inventory
<?php $__env->stopSection(); ?>


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



	<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                  <div class="card-header">
              <div class="col-sm-6 col-md-3">
             
               <?php if(Auth::user()->hasAnyPermission(['All','Store Inventory'])): ?>

               <button  class="float-left btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_inventory" ><i class="fa fa-plus"></i>Add <?php echo e(ucwords(str_replace('_',' ',$plot_labels['module']))); ?></button>

          
               <?php endif; ?>

                <?php if(Auth::user()->hasAnyPermission(['All','Update Inventory Bulk'])): ?>

                 <button    class="float-left btn btn-sm btn-outline-primary ml-3" data-toggle="modal" data-target="#md_update_bulk" ><i class="fas fa-edit"></i> Bulk Update</button> 

               <?php endif; ?>
              </div>
         
              <div class="col-md-3"></div>
               <div class="col-md-3">
                <?php ($datatable_key = Crypt::encrypt('Plot')); ?>
                
                <select onchange="renderPlotsTable(), showBlocksInDropDown(event,this,'<?php echo e($datatable_key); ?>','block_drop_down')" name="branch" class="form-control form-control-sm float-right branch_list">
                  <option value="<?php echo e(Crypt::encrypt(0)); ?>">Select <?php echo e(ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))); ?></option>

                  <?php $__currentLoopData = $branch; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e(Crypt::encrypt($rows->id)); ?>"><?php echo e($rows->name); ?> (<?php echo e($rows->code); ?>)</option>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
              </div>

              <div class="col-md-3">
                    
                    <select name="block" class="form-control form-control-sm float-right block_drop_down block" onchange="renderPlotsTable();">
                      <option value="<?php echo e(Crypt::encrypt(0)); ?>">Select Block</option>
                    </select>
                </div>

            </div>

                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table id="plots_table" class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>
                          
                          <th>#</th>

                        <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['branch']))); ?> </th>

                       <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['block']))); ?></th>

                     

                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['plot_name']))); ?> </th>

                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['type']))); ?></th>
                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['category']))); ?></th>
                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['size']))); ?></th>

                       

                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['dimension']))); ?></th>

                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['feature_charges']))); ?></th>


                          <th><?php echo e(ucwords(str_replace('_',' ',$plot_labels['rate']))); ?></th>
                          <th>STATUS</th>

                          <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                          
                        </tr>
                      </thead>
                    
                      <tbody id="show_plots">
                        
                      </tbody>

                    </table>
                  </div>
                </div>
              </div>
          </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_modal'); ?>
  <?php echo $__env->make('inventory.modals.add_inventory', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <div id="update_plot_modal"></div>
  <?php echo $__env->make('inventory.modals.bulk_update', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

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

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

  <script type="text/javascript">
  var table = $('#plots_table');

    function renderPlotsTable()
    {
      table.DataTable().clear();
      table.DataTable().destroy();


      var branch  = $(".branch_list").val();
      var block  = $(".block").val();

      table.DataTable( {
        "regex": true ,
        columnDefs: [
                    { "type": "numeric-comma", targets: 0 }
                ],
        cache:true,
        responsive: true,
        bProcessing: true,
        bServerSide: true,
        deferRender: true,
        select: true,
        stateSave: true,
        responsive: true,
        pageLength:100,
        "ajax": {
                "url": "<?php echo e(route('showdatatableplots')); ?>",
                "type": "GET",
                'data': {
                  'branch': branch,
                  'block': block,
                },
                  },
        "columns": [
           {
    name: 'count',
    data: 'count'
   },
   {
    name:'branch_name',
    data:'branch_name'
   },
   {
    name: 'block_name',
    data: 'block_name'
   },
   {
    name: 'article_no',
    data: 'article_no'
   },
   {
     name: 'type',
     data: 'type'
    },
   {
    name: 'category',
    data: 'category'
   },
   {
    name: 'size',
    data: 'size'
   },
   {
    name: 'dimensions',
    data: 'dimensions'
   },
   {
    name: 'featurecharges',
    data: 'featurecharges'
   },
   {
    name: 'rate',
    data: 'rate'
   },
   {
    name: 'status',
    data: 'status'
   },
    {
        name: 'action',
        data: 'action'
    },
        ],

    });
    }

    $(document).ready(function(){

      renderPlotsTable();

    });

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

  
<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/skylite/resources/views/inventory/manage_inventory.blade.php ENDPATH**/ ?>