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');
$data_pr= $this->Curd->all_fetcher_order("tb_weight","DESC");
?>
<?php
$a_pro_js='';
if($data_pr){
foreach($data_pr as $ro){
$a_pro_js.='<option value="'.$ro->name.'">'.$ro->name.'</option>';
}
}else{
$a_pro_js='<option value="1000">1000 g</option><option value="500">500 g</option><option value="250">250 g</option><option value="200 ">200 g</option><option value="100">100 g</option>';
}
?>
<div class="main-content">
<div class="dash-block">
<h5 class="border-bottom pb-3">View Product <a href="<?=base_url('admin/view_product')?>"><button type="button" class="btn btn-success btn-sm m-2">View Product</button></a></h5>
<form action="<?=base_url('admin/update_product_price')?>" method="post">
<div class="form-element table-responsive mt-2">
<input type="hidden" name="product_id" value="<?=$product_id?>" />
<!-- <table class="table table-bordered" >
</table>-->
<?php
$this->db->where('id',$product_id);
$query=$this->db->get('tb_product');
if($query->num_rows()>0){
$color_li=$query->row()->color_list;
$all_color_di =json_decode($color_li);
}
$this->db->where_in('id',$all_color_di);
$query1=$this->db->get('tb_colors');
if($query1->num_rows()>0){
foreach($query1->result() as $ro3w){
?>
<table class="table table-bordered" id="data_<?=$ro3w->id?>">
<tr>
<th >Product Size</th>
<th>Price</th>
<th>Discount %</th>
<th>Sale Price</th>
<th>Quantity</th>
<th>Action</th>
</tr>
<tr>
<td colspan="3">
<?=$ro3w->name;?>
<input type="hidden" name="color_id[]" value="<?=$ro3w->id?>" />
</td>
<td colspan="3" class="">
<input type="button" value="Add More" class="btn btn-primary pull-right" id="add-btn_<?=$ro3w->id?>">
</td>
</tr>
<?php
$res = $this->Curd->fetch_where("tb_product_price",array("*"),array("product_id"=>$product_id,"color_id"=>$ro3w->id));
$i=0;
if($res==true){
foreach($res as $row){
$i++;?>
<tr>
<td>
<select class="form-control" name="weight[<?=$ro3w->id?>][]">
<?php
// print_r($data_pr);
if($data_pr){
foreach($data_pr as $ro){
$sel_ac='';
if($row->weight==$ro->name) { $sel_ac="selected";}
echo "<option value='$ro->name' $sel_ac>$ro->name </option>";
}
}else {
?>
<option value="1000" <?php if($row->weight=='1000'){ echo 'selected';}?>>1000 g</option>
<option value="500" <?php if($row->weight=='500'){ echo 'selected';}?>>500 g</option>
<option value="250" <?php if($row->weight=='250'){ echo 'selected';}?>>250 g</option>
<option value="200" <?php if($row->weight=='200'){ echo 'selected';}?>>200 g</option>
<option value="100" <?php if($row->weight=='100'){ echo 'selected';}?>>100 g</option>
<?php } ?>
</select>
</td>
<td>
<input type="text" value="<?=$row->price?>" name="price[<?=$ro3w->id?>][]" class="form-control price">
</td>
<td>
<input type="text" value="<?=$row->reg_discount?>" name="reg_discount[<?=$ro3w->id?>][]" class="form-control reg_discount">
</td>
<td>
<input type="text" value="<?=$row->reg_sale_price?>" name="reg_sale_price[<?=$ro3w->id?>][]" class="form-control reg_sale_price">
</td>
<td>
<input type="text" name="qty[<?=$ro3w->id?>][]" class="form-control qty" value="<?=$row->qty?>">
</td>
<td>
<input type="button" class="btn btn-danger remove_field" value="Close">
</td>
</tr>
<?php
}
}
?>
<script type="text/javascript">
var maxField = 50-<?=$i?>;
var x=1;
$("#add-btn_<?=$ro3w->id?>").click(function(){
if(x<maxField){
$("#data_<?=$ro3w->id?>").append('<tr><td><select class="form-control" name="weight[<?=$ro3w->id?>][]"><?php echo $a_pro_js;?></select></td><td><input type="" name="price[<?=$ro3w->id?>][]" class="form-control price"></td><td><input type="text" name="reg_discount[<?=$ro3w->id?>][]" class="form-control reg_discount"></td><td><input type="text" name="reg_sale_price[<?=$ro3w->id?>][]" class="form-control reg_sale_price"></td><td><input type="text" name="qty[<?=$ro3w->id?>][]" class="form-control qty"></td><td><input type="button" class="btn btn-danger remove_field" value="Remove"></td></tr><tr>');
x++;
}else{
alert("Max 1 Input box allowed");
return false;
}
})
$("#data_<?=$ro3w->id?>").on('click','.remove_field',function(){
$(this).closest("tr").remove();
x--;
})
$("#data_<?=$ro3w->id?>").on('keyup','.reg_discount',function(){
var price = $(this).closest("tr").find('.price').val();
var reg_discount = $(this).val();
var reg_sale_pirce = price - ((price*reg_discount)/100);
$(this).closest("tr").find('.reg_sale_price').val(reg_sale_pirce);
})
$("#data_<?=$ro3w->id?>").on('keyup','.corp_discount',function(){
var price = $(this).closest("tr").find('.price').val();
var corp_discount = $(this).val();
var corp_sale_pirce = price - ((price*corp_discount)/100);
$(this).closest("tr").find('.corp_sale_price').val(corp_sale_pirce);
})
</script>
</table> <?php
}
}
?>
<input type="submit" name="submit" value="Submit" class="btn btn-success submit">
</div>
</form>
</div>
</div>
<?php $this->load->view('admin/footer');?>
</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>
</body>
</html>