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
$title = "";
$main_cat_id = "";
$cat_id = $sub_cat="";
$pack_type = "";
$origin = "";
$sku =$hsn_no= $tax_per="";
$desc = "";
$meta_title = "";
$meta_keyword = "";
$meta_desc = "";
$video_link = "";
$featured_product = $exclusive_product=$pro_short="";
$color_list = array();
if(isset($product_res)){
$btnname = "Update";
foreach($product_res as $row){
$product_id = $row->id;
$title = $row->title;
$main_cat_id = $row->main_cat_id;
$cat_id = $row->cat_id;
$sub_cat = $row->sub_cat;
$pack_type = $row->pack_type;
$origin = $row->origin;
$sku = $row->sku;
$desc = $row->description;
$meta_title = $row->meta_title;
$meta_keyword = $row->meta_keyword;
$meta_desc = $row->meta_desc;
$featured_product = $row->featured_product;
$exclusive_product = $row->exclusive_product;
$tax_per = $row->tax_per;
$hsn_no = $row->hsn_no;
$pro_short = $row->pro_short;
$video_link = $row->video_link;
$color_list = json_decode($row->color_list);
}
$method = "admin/product_update/".base64_encode($product_id);
}else{
$method = "admin/product_process";
$btnname = "Submit";
}
?>
<?php $this->load->view('admin/sidebar');?>
</div>
<div class="content-right">
<?php $this->load->view('admin/header');?>
<div class="main-content">
<div class="dash-block">
<h5 class="border-bottom pb-3">Add Product</h5>
<div class="form-element">
<?=$this->session->flashdata('success_msg')?>
<form method="post" action="<?=base_url($method)?>" enctype= 'multipart/form-data'>
<div class="row">
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Title </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputPassword" placeholder="Enter Product Title" name="p_title" value="<?=$title?>">
<span class="text-danger"><?=form_error("p_title")?></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Select Main Category </label>
<div class="col-sm-8">
<select class="form-control select_main_cat" name="p_maincat" >
<option value="">Select Main Category</option>
<?php if(isset($main_cat_res)):
foreach($main_cat_res as $row):
if($row->id==$main_cat_id){?>
<option value="<?=$row->id?>" selected><?=$row->name?></option>
<?php
continue;
}
?>
<option value="<?=$row->id?>"><?=$row->name?></option>
<?php
endforeach;
endif; ?>
</select>
<span class="text-danger"><?=form_error("p_maincat")?></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Select Category </label>
<div class="col-sm-8">
<select class="form-control select_cat_name" name="p_cat" >
<option value="">Select Category</option>
<?php
$this->db->where('main_cat_id',$main_cat_id);
// $this->db->where('status','1');
$query1=$this->db->get('tb_category');
if($query1->num_rows()>0){
foreach($query1->result() as $row){
if($row->id==$cat_id){ ?>
<option value="<?=$row->id?>" selected><?=$row->name?></option>
<?php
}else{
?>
<option value="<?=$row->id?>"><?=$row->name?></option>
<?php
}
?>
<?php
}
}; ?>
</select>
<span class="text-danger"><?=form_error("p_cat")?></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Select Sub Category </label>
<div class="col-sm-8">
<select class="form-control select_sub_cat_name" name="sub_cat" >
<option value="">Select Sub Category</option>
<?php
$this->db->where('category_id',$cat_id);
$this->db->where('status','1');
$query=$this->db->get('tb_sub_category');
if($query->num_rows()>0){
foreach($query->result() as $row3){
if($row3->id==$sub_cat){ ?>
<option value="<?=$row3->id?>" selected><?=$row3->name?></option>
<?php
}else{
?>
<option value="<?=$row3->id?>"><?=$row3->name?></option>
<?php
}
?>
<?php
}
} ?>
</select>
<span class="text-danger"><?=form_error("p_cat")?></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Type of Pack: </label>
<div class="col-sm-8">
<input type="text" class="form-control" id="" placeholder="Enter Type of pack" name="p_pack_type" value="<?=$pack_type?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Origin: </label>
<div class="col-sm-8">
<input type="text" class="form-control" id="" placeholder="Enter Origin" name="p_origin" value="<?=$origin?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> SKU </label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="Enter SKU" name="p_sku" value="<?=$sku?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> NEW ARRIVALS</label>
<div class="col-sm-8">
<select class="form-control" name="featured_product" >
<option value="0">No</option>
<option <?php if($featured_product =='1') { echo "selected";}?> value="1">Yes</option>
</select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> TOP COLLECTION </label>
<div class="col-sm-8">
<select class="form-control" name="exclusive_product" >
<option value="0">No</option>
<option <?php if($exclusive_product =='1') { echo "selected";}?> value="1">Yes</option>
</select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> HSN No </label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="Enter HSN No" name="hsn_no" value="<?=$hsn_no?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Tax % </label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="Enter Tax %" name="tax_per" value="<?=$tax_per?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Youtube Link </label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="Enter Youtube link" name="video_link" value="<?=$video_link?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Size Chart</label>
<div class="col-sm-8">
<input type="file" class="form-control" placeholder="Enter" name="size_chart" value="">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Color List </label>
<div class="col-sm-8">
<select name="color_list[]" multiple="" required="" class="form-control">
<?php
$this->db->order_by('id','asc');
$query=$this->db->get('tb_colors');
if($query->num_rows()>0){
foreach($query->result() as $ro3w){
$sl3="";
if(in_array($ro3w->id,$color_list)){
$sl3="selected";
}
echo "<option $sl3 value='$ro3w->id'>$ro3w->name</option>";
}
}
?>
</select>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Product Short Description </label>
<div class="col-sm-10">
<textarea class="form-control ckeditor" style="height: 80px !important;" name="pro_short" ><?=$pro_short?></textarea>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Product About</label>
<div class="col-sm-10">
<textarea class="form-control ckeditor" style="height: 80px !important;" name="p_desc" ><?=$desc?></textarea>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Meta Title </label>
<div class="col-sm-10">
<input type="text" name="meta_title" class="form-control" placeholder="Enter Meta Title" value="<?=$meta_title?>">
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Meta Keyword </label>
<div class="col-sm-10">
<input type="text" name="meta_keyword" class="form-control" placeholder="Enter Meta Keyword" value="<?=$meta_title?>">
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label">Meta Description </label>
<div class="col-sm-10">
<textarea class="form-control " style="height: 80px !important;" name="meta_desc" ><?=$meta_desc?></textarea>
</div>
</div>
</div>
<div class="col-md-12">
<div class="row">
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"> Image </label>
<div class="col-sm-8">
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input p_image" id="inputGroupFile04" name="productfile[]" multiple="multiple" <?php if($title==""){ echo "required"; }?>>
<label class="custom-file-label file_name" for="inputGroupFile04">Choose file</label>
</div>
</div>
<small>File format should be valid JPG,PNG. <strong style="color:red">(1080*1350)</strong></small><br>
<?php
if(isset($gallery_res) && $gallery_res==true):
foreach($gallery_res as $g_row){?>
<img style="width:50px;" src="<?=base_url('uploads/gallery/'.$g_row->name)?>" />
<?php
}
endif;
?>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8 offset-md-2 mt-2">
<button class="btn btn-submit"><?=$btnname?></button>
</div>
</div>
</form>
</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 src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>-->
<script src="<?=base_url('admin_assets/ckeditor/ckeditor.js')?>"></script>
<script src="<?=base_url('admin_assets/ckeditor/samples/js/sample.js')?>"></script>
<script src="<?=base_url('admin_assets/summernote.min.js')?>"></script>
<script type="text/javascript">
$(".select_main_cat").change(function(){
var id = $(this).val();
$.ajax({
url: "<?=base_url('admin/get_cat_ajax')?>",
type: "POST",
data: {"main_cat_id":id},
success: function(data){
$(".select_cat_name").html(data);
$(".select_sub_cat_name").html("<option>No Subcategory</option");
}
});
});
$(".select_cat_name").change(function(){
var id = $(this).val();
$.ajax({
url: "<?=base_url('admin/get_sub_cat_ajax')?>",
type: "POST",
data: {"cat_id":id},
success: function(data){
$(".select_sub_cat_name").html(data);
}
});
});
// $(document).ready(function () {
// $('#editor1111').summernote({ height: 200 });
//
// });
// $(document).ready(function() {
// $('.js-example-basic-multiple').select2();
// });
$(document).ready(function(){
var _URL = window.URL || window.webkitURL;
$('.p_image').change(function(e){
var fileName = e.target.files[0].name;
$(".file_name").text("Uploaded");
var file, img;
if ((file = this.files[0])) {
img = new Image();
// img.onload = function () {
// if(this.width>1080 || this.width<1080){
// alert(this.width + " " + this.height);
// return false;
// }
// };
img.src = _URL.createObjectURL(file);
}
});
});
</script>