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 Coupon <a href="<?=base_url('admin/add_coupon')?>"><button type="button" class="btn btn-success btn-sm m-2">Add Coupon</button></a></h5>
<div class="form-element mt-2">
<table class="table table-bordered" id="example">
<thead>
<tr>
<th>SNo </th>
<th>Coupon Type</th>
<th>Discount Type</th>
<th>discount</th>
<th>Promo Code</th>
<th>Min Value</th>
<th>Start</th>
<th>Expire</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(isset($coupon_res) && $coupon_res==true):
$sno = 1;
foreach($coupon_res as $row){?>
<tr>
<td><?=$sno++?></td>
<td><?=$row->coupon_type?></td>
<td><?php
if($row->discount_type==1){
echo "Flat Discount (Rs)";
}else if($row->discount_type==2){
echo "Flat (%)";
}else if($row->discount_type==3){
echo "Buy One Get One Offer (50%)";
}else if($row->discount_type==4){
echo "One time(%)";
}?></td>
<td><?=$row->discount?></td>
<td><?=$row->promo_code?></td>
<td><?=$row->min_value?></td>
<td><?=date("d-m-Y", strtotime($row->start));?></td>
<td><?=date("d-m-Y", strtotime($row->expire))?></td>
<td><?php
if($row->status==0){?>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox coupon_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 coupon_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_coupon/'.base64_encode($row->id))?>"><button type="button" class="btn btn-primary btn-sm">Edit</button>
<a href="<?=base_url('admin/delete_coupon/'.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">
$(".coupon_status").change(function() {
var isChecked=$(this).prop("checked");
var main_cat_id=$(this).attr("id");
if(isChecked){
$.ajax({
url:"coupon_status_changer",
method:"post",
data:{"c_id_for_status":main_cat_id,"status":1},
success: function(res){//for response
alert("True");
}
});
}else{
$.ajax({
url:"coupon_status_changer",
method:"post",
data:{"c_id_for_status":main_cat_id,"status":0},
success: function(res){//for response
alert("True");
}
});
}
});
</script>
</body>
</html>