Uname:
Linux server.thebazaar99.com 5.14.0-687.17.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 22 07:21:26 EDT 2026 x86_64
Software:
Apache
PHP version:
8.3.32 [ PHP INFO ] PHP os:
Linux
Server Ip:
163.227.92.254
Your Ip:
216.73.217.24
User:
gutlooks (1003) | Group:
gutlooks (1005)
Safe Mode:
OFF
Disable Function:
exec,passthru,shell_exec,system
<?php $this->load->view('admin/sidebar.php');?>
</div>
<div class="content-right">
<?php $this->load->view('admin/header.php');?>
<div class="main-content">
<div class="dash-block">
<h5 class="border-bottom pb-3">View Product <a href="<?=base_url('admin/add_product')?>"><button type="button" class="btn btn-success btn-sm m-2">Add Product</button></a></h5>
<div class="form-element table-responsive mt-2">
<table class="table table-bordered" id="example">
<thead>
<tr>
<th>SNo</th>
<th>Title</th>
<th>Main Category</th>
<th>Category</th>
<th>SKU</th>
<th>Status</th>
<th>Featured Product</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(isset($product_res) && $product_res==true):
$sno = 1;
foreach($product_res as $row){?>
<tr>
<td><?=$sno++?></td>
<td><?=$row->title?></td>
<td><?php
$res_main_cat = $this->Curd->fetch_where("tb_main_category",array("name"),array("id"=>$row->main_cat_id));
if($res_main_cat==true){
echo $res_main_cat[0]->name;
}?>
<td><?php
$res_cat = $this->Curd->fetch_where("tb_category",array("name"),array("id"=>$row->cat_id));
if($res_cat==true){
echo $res_cat[0]->name;
}?></td>
<td><a href="<?=base_url('home/product_detail/'.base64_encode($row->id))?>" target="_blank"><?=$row->sku?></a></td>
<td><?php
if($row->status==0){?>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox product_status" id="<?=$row->id?>">
<label class="onoffswitch-label" for="<?=$row->id?>">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
<?php
} else {?>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox product_status" id="<?=$row->id?>" checked>
<label class="onoffswitch-label check" for="<?=$row->id?>">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
<?php
} ?>
</td>
<td>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox featured_product_changer" id="a<?=$row->id?>" <?php if($row->featured_product==1){ echo 'checked'; }?>>
<label class="onoffswitch-label" for="a<?=$row->id?>">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
<td><a href="<?=base_url('admin/add_product/'.base64_encode($row->id))?>"><button type="button" class="btn btn-primary btn-sm">Edit</button></a>
<a href="<?=base_url('admin/delete_product/'.base64_encode($row->id))?>"><button type="button" class="btn btn-danger btn-sm">Trash</button></a>
<a href="<?=base_url('admin/view_product_weight/'.base64_encode($row->id))?>"><button type="button" class="btn btn-warning btn-sm">Price</button></a>
</td>
</tr>
<?php
}
endif;
?>
</tbody>
</table>
</div>
</div>
</div>
<?php include'footer.php';?>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/bootstrap.min.js')?>"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/select2.min.js')?>"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/custom.js')?>"></script>
<script src="<?=base_url('admin_assets/js/css3-animate-it.js')?>"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#example').DataTable();
});
</script>
<script type="text/javascript">
$(".product_status").change(function() {
var isChecked=$(this).prop("checked");
var product_id=$(this).attr("id");
if(isChecked){
$.ajax({
url:"product_status_changer",
method:"post",
data:{"product_id_for_status":product_id,"status":1},
success: function(res){//for response
alert("True");
}
});
}else{
$.ajax({
url:"product_status_changer",
method:"post",
data:{"product_id_for_status":product_id,"status":0},
success: function(res){//for response
alert("True");
}
});
}
});
$(".featured_product_changer").change(function() {
var isChecked=$(this).prop("checked");
var product_id=$(this).attr("id").split("a");
if(isChecked){
$.ajax({
url:"<?=base_url('admin/featured_product_changer')?>",
method:"post",
data:{"product_id_for_status":product_id[1],"status":1},
success: function(res){//for response
alert("True");
}
});
}else{
$.ajax({
url:"<?=base_url('admin/featured_product_changer')?>",
method:"post",
data:{"product_id_for_status":product_id[1],"status":0},
success: function(res){//for response
alert("True");
}
});
}
});
</script>
</body>
</html>