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 Main Category <a href="<?=base_url('admin/add_main_category')?>"><button type="button" class="btn btn-success btn-sm m-2">Add Main Category</button></a></h5>
<div class="form-element mt-2">
<table class="table table-bordered" id="example">
<thead>
<tr>
<th>SNo </th>
<th>Main Category</th>
<th>Image</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(isset($main_cat_res) && $main_cat_res==true):
$sno = 1;
foreach($main_cat_res as $row){?>
<tr>
<td><?=$sno++?></td>
<td><?=$row->name?></td>
<td><img src="<?=base_url('uploads/main_category/'.$row->image)?>" width="100"></td>
<td><?php
if($row->status==0){?>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox main_cat_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 main_cat_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><a href="<?=base_url('admin/add_main_category/'.base64_encode($row->id))?>"><button type="button" class="btn btn-primary btn-sm">Edit</button></a>
<a href="<?=base_url('admin/delete_main_category/'.base64_encode($row->id))?>"><button type="button" class="btn btn-danger btn-sm">Trash</button></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">
$(".main_cat_status").change(function() {
var isChecked=$(this).prop("checked");
var main_cat_id=$(this).attr("id");
if(isChecked){
$.ajax({
url:"main_category_status_changer",
method:"post",
data:{"mc_id_for_status":main_cat_id,"status":1},
success: function(res){//for response
alert("True");
}
});
}else{
$.ajax({
url:"main_category_status_changer",
method:"post",
data:{"mc_id_for_status":main_cat_id,"status":0},
success: function(res){//for response
alert("True");
}
});
}
});
</script>
</body>
</html>