<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.23/css/jquery.dataTables.css">
<!-- <link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap4.min.css">  -->

<?php $__env->startSection('content'); ?>
<div class="common-content">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Category Approval List</h6>
                    </div>
                </div>
                 
                <div class="hack1">
                    <div class="hack2 hk3">
                        <div class="tableBox wraper">
                            <table id="example" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th>Id</th>
                <th>Category Name</th>
                <th>Category Description</th>
                <th>Vendor/Manufacturer</th>    
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
        <?php $__currentLoopData = $category_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
       
            <tr>
                <td><?php echo e($key+1); ?></td>
                
                <td><?php echo e($category->category); ?></td>                  
                <td><?php echo e($category->request_description); ?></td>            
                <td><?php echo e($category->name); ?></td>
                <?php if($category->request_status == '0'): ?>
                <td>
                   <!-- <a href="<?php echo e(url('admin/vendorcategoryapprove')); ?>/<?php echo e($category->request_id); ?>" onclick="return confirm('Are you sure?')"><button class="btn">Approve</button></a>-->
                    <a href="<?php echo e(url('admin/vendorcategoryapprove')); ?>/<?php echo e($category->request_id); ?>/<?php echo e($category->requested_from); ?>" ><button class="btn common-btn green-btn">Approve</button></a>
                    <!--<a href="<?php echo e(url('admin/vendorcategoryreject')); ?>/<?php echo e($category->request_id); ?>" onclick="return confirm('Are you sure?')"><button class="btn">Reject</button></a>-->
                    <button class="btn common-btn red-btn"  data-toggle="modal" data-target="#myModalmessage" data-id="<?php echo e($category->request_id); ?>" data-vid="<?php echo e($category->requested_from); ?>" >Reject</button>
                    
                </td>
                <?php else: ?>
                <td><?php if($category->request_status == '0'): ?> Pending <?php elseif($category->request_status == '1'): ?> Approved <?php else: ?> Rejected <?php endif; ?></td>
                <?php endif; ?>
            </tr>
            
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>    
            
            
            
        </tbody>
        <!-- <tfoot>
            <tr>
                <th>Id</th>
                <th>Product Name</th>
                <th>Product Code</th>
                <th>Action</th>
            </tr>
        </tfoot> -->
    </table>
                        </div>
                    </div>
              </div>

<!-- Modal -->
    <div class="modal fade" id="myModalmessage" role="dialog"  >
		<div class="modal-dialog modal-dialog-centered">
        <!-- Modal content-->
			<div class="modal-content">
				<div class="modal-body">
					<button type="button" class="close close_message" data-dismiss="modal">&times;</button>
                        <form id="add_msg" method="POST" action="<?php echo e(url('admin/vendorcategoryreject')); ?>">
                        <?php echo csrf_field(); ?>
	                       
   	                        <div class="col-sm-12 col-xs-12">
              	                <div class="form-inputs">
           		                    <div class="form-group">
        			                    <label>Reason</label>
         				                    <textarea style="width:100%;border: 1px solid #cacaca;border-radius: 5px;" class="rejectreason" class="form-control" name="rejectreason" rows="4" cols="50" required></textarea>
         				                    <!--<input class="messagedetails" class="form-control" name="messagedetails" value="" >-->
         				                    <input type="hidden" id="categoryid" name="categoryid" value="">
         				                    <input type="hidden" id="vendorid" name="vendorid" value="">
                                            
           		                    </div>
        	                    </div>
      	                    </div>
	                        <div class="modal-footer">
		                        	<button class="submit-popup sendmessage">Reject</button>
	                        </div>
                        </form>
				</div>

			</div>

		</div>
	</div>
<!-- Modal -->
          </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<!-- <script src = "https://code.jquery.com/jquery-3.5.1.js"></script>
<script src = "https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<script src = "https://cdn.datatables.net/1.10.23/js/dataTables.bootstrap4.min.js"></script> -->
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.js"></script>

<script>
$(document).ready(function() {
 // executes when HTML-Document is loaded and DOM is ready
 $(".pageloader").show();
$(".pageloader").delay(200).fadeOut("slow");
});
$(document).ready(function() {
    $('#example').DataTable();
} );
</script>
<script>
    $('#myModalmessage').on('show.bs.modal', function (event) {
  var button = $(event.relatedTarget) // Button that triggered the modal
  var id = button.data('id') // Extract info from data-* attributes
  var vendorid = button.data('vid')
  //alert(vendorid);
  var modal = $(this)
  modal.find('.modal-body input[name="categoryid"]').val(id);
  modal.find('.modal-body input[name="vendorid"]').val(vendorid);
})
</script>
<script>
$(".close_message").click(function(){
    $('.rejectreason').val('');
    $('#categoryid').val('');
    $('#vendorid').val('');
});
</script>
<script>
<?php if(Session::has('message')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('message')); ?>",
        type: "success",
        showCancelButton: false,
        dangerMode: false,
        confirmButtonText: 'OK',

    });
<?php endif; ?>
<?php if(Session::has('errormessage')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('errormessage')); ?>",
        type: "error",
        showCancelButton: false,
        dangerMode: true,
        confirmButtonText: 'OK',

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




<?php echo $__env->make('layouts.main_admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/meddbot/public_html/resources/views/admin/categoryapprovallist.blade.php ENDPATH**/ ?>