<?php if (isset($component)) { $__componentOriginal2a47292f4e4050071cfddfd6ba8e2a3a4c127757 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Admin\Header::class, []); ?>
<?php $component->withName('admin.header'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2a47292f4e4050071cfddfd6ba8e2a3a4c127757)): ?>
<?php $component = $__componentOriginal2a47292f4e4050071cfddfd6ba8e2a3a4c127757; ?>
<?php unset($__componentOriginal2a47292f4e4050071cfddfd6ba8e2a3a4c127757); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginalf876cca3a28f659cd5d542fa68eb46dbaafc0d1d = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Admin\Sidebar::class, []); ?>
<?php $component->withName('admin.sidebar'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf876cca3a28f659cd5d542fa68eb46dbaafc0d1d)): ?>
<?php $component = $__componentOriginalf876cca3a28f659cd5d542fa68eb46dbaafc0d1d; ?>
<?php unset($__componentOriginalf876cca3a28f659cd5d542fa68eb46dbaafc0d1d); ?>
<?php endif; ?>
<div class="main-content">
<div class="graph-card card-table" id="ProductList">
<div class="card-head">
<div class="text-content">
<h5>Product</h5>
</div>
<div class="card-drp">
<div class="btn-content btn-group" role="group" aria-label="Basic example">
<?php if(Auth::user()->type == 'admin'): ?>
<a href="<?php echo e(url('/add_product')); ?>"><button type="button" class="btn active">Add New</button></a>
<?php endif; ?>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive table-scroll">
<table class="table-management">
<thead>
<tr>
<th>#</th>
<th>Product Category</th>
<th>Product Title</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($key+1); ?></td>
<td>
<?php if($product->catName): ?>
<?php echo e($product->catName); ?>
<?php else: ?>
Uncategorized
<?php endif; ?>
</td>
<td><?php echo e($product->product_front_title); ?></td>
<?php if($product->product_status == 1): ?>
<td>Active</td>
<?php else: ?>
<td>Un-Active</td>
<?php endif; ?>
<td>
<a href="<?php echo e(url('edit_product').$product->product_id); ?>" ><button class="refresh-btn edit-btnn" data-tooltip="Edit">
<i class="fa-regular fa-pencil"></i>
</button></a>
<button class="delete-btn btn_del" value="<?php echo e($product->product_id); ?>" data-tooltip="Delete">
<i class="fa-regular fa-xmark"></i>
</button>
<button></button>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<div class="pagination">
</div>
</div>
</div>
</div>
<!-- Delete Work Start Here -->
<script>
$(document).ready(function(){
$('body').on('click', '.btn_del', function(e){
e.preventDefault();
var id = $(this).val();
$.ajax({
url: "<?php echo e(url('/delete_product')); ?>",
method: "GET",
data: {'id':id},
cache: false,
success:function()
{
toastr.success("Product Deleted Successfully","Deleted",{timeOut:1500});
$("#ProductList").load(location.href+" #ProductList>*","");
},
error:function()
{
toastr.error("SomeThing Went Wrong","Error",{timeOut:1500});
false;
},
});
});
});
</script>
<!-- Delete Work End Here -->
<?php if (isset($component)) { $__componentOriginal273b99c895545dc613f61f0747b5dd769beb60e4 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Admin\Footer::class, []); ?>
<?php $component->withName('admin.footer'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal273b99c895545dc613f61f0747b5dd769beb60e4)): ?>
<?php $component = $__componentOriginal273b99c895545dc613f61f0747b5dd769beb60e4; ?>
<?php unset($__componentOriginal273b99c895545dc613f61f0747b5dd769beb60e4); ?>
<?php endif; ?><?php /**PATH D:\Qasim Khan\easy-buyer\resources\views/admin/product.blade.php ENDPATH**/ ?>