<?php $__env->startSection('middle'); ?>
<section class="content">
<?php if(Session::has('msg')): ?>
<div class="alert alert-success" id="success-alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<p align="center" style="font-weight: bold; font-size: 13px; color: white"> Success: <?php echo e(Session::get('msg')); ?> </p>
</div>
<br>
<?php endif; ?>
<?php if(Session::has('msg2')): ?>
<div class="alert alert-danger" id="success-alert">
<button type="button" class="close" data-dismiss="alert">x</button>
<p align="center" style="font-weight: bold; font-size: 13px; color: white"> Success: <?php echo e(Session::get('msg2')); ?> </p>
</div>
<br>
<?php endif; ?>
<a href="<?php echo e(url('add_product')); ?>"><button class="btn btn-primary" style="float: right"><i class="glyphicon glyphicon-plus"></i>Add New Product</button></a>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Products List <?php if(!empty($categories)): ?>
(<?php echo e($categories[0]->name); ?>)
<?php endif; ?>
</h3>
</div>
<!-- /.box-header -->
<div class="box-body" >
<table id="example1" class="table table-bordered table-striped" >
<thead>
<tr>
<th>SR #</th>
<th>Name</th>
<th>Category Name</th>
<th>Image</th>
<th>In Stock</th>
<th>New Arrival</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $count=1; ?>
<?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($count); ?></td>
<td><?php echo e($product->name); ?></td>
<td><?php echo e($product->cat_name); ?></td>
<td>
<img src="<?php echo e(url('public/uploads/products')); ?>/<?php echo e($product->image_name); ?>" style="width: 100px; height: 100px">
</td>
<td>
<?php if($product->in_stock=='Y'): ?>
<span><input type="checkbox" class="stock_checkbox" checked value="<?php echo e($product->product_id); ?>"></span>
<?php else: ?>
<span><input type="checkbox" class="stock_checkbox" value="<?php echo e($product->product_id); ?>"></span>
<?php endif; ?>
</td>
<td>
<?php if($product->new_arrival=='Y'): ?>
<span><input type="checkbox" class="arrival_checkbox" checked value="<?php echo e($product->product_id); ?>"></span>
<?php else: ?>
<span><input type="checkbox" class="arrival_checkbox" value="<?php echo e($product->product_id); ?>"></span>
<?php endif; ?>
</td>
<td style="width: 20%">
<a style="margin: 5px;" href="<?php echo e(url('edit_product')); ?>/<?php echo e($product->product_id); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i></a>
<!-- <a style="margin: 5px;" href="<?php echo e(url('#')); ?>/<?php echo e($product->product_id); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i></a>-->
<a data-toggle="modal" data-target="#confirm-delete" data-href="<?php echo e(url('delete_product')); ?>/<?php echo e($product->product_id); ?>" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i></a></td>
</tr>
<?php $count=$count+1; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('.stock_checkbox').on('change',function(){
var value=$(this).val();
if ($(this).prop('checked')) {
$.get("<?php echo e(url('product_is_in_stock')); ?>"+'/'+value,function(response){
});
}
else {
$.get("<?php echo e(url('product_not_in_stock')); ?>"+'/'+value,function(response){
});
}
});
$('.arrival_checkbox').on('change',function(){
var value=$(this).val();
if ($(this).prop('checked')) {
$.get("<?php echo e(url('product_is_new_arrival')); ?>"+'/'+value,function(response){
});
}
else {
$.get("<?php echo e(url('product_not_new_arrival')); ?>"+'/'+value,function(response){
});
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.head', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]