File "product.php"
Full Path: /home/krishnamexports/public_html/panel/pages/product.php
File size: 39.6 KB
MIME-type: text/x-php; charset=us-ascii
Charset: utf-8
<?php
include_once("fckeditor/fckeditor.php");
if(isset($_POST['add']))
{
$polish_id = "";
$category_id = $_POST['category_id'];
$subcategory_id = $_POST['subcategory_id'];
$name = $_POST['name'];
$weight = $_POST['weight'];
$min_order = $_POST['min_order'];
$max_order = $_POST['max_order'];
$skucode = $_POST['skucode'];
$price = $_POST['price'];
$orignalprice = $_POST['orignalprice'];
$stock = $_POST['stock'];
$featured_type = 0;
if(isset($_POST['featured_type'])){
$featured_type = $_POST['featured_type'];
}
$bulk_order = $_POST['bulk_order'];
if($bulk_order==0)
{
$polish_id = implode('$',$_POST['polish_id']);
}
$size_id = implode('$',$_POST['size_id']);
$small_description = $_POST['small_description'];
$imagesCount = count($_FILES['image']['name']);
$producImage = array();
if($imagesCount > 0)
{
for($i=0;$i<$imagesCount;$i++)
{
if(!empty($_FILES['image']['name'][$i])){
$imgPro = rand()."_".$_FILES['image']['name'][$i];
move_uploaded_file($_FILES['image']['tmp_name'][$i],"../products/".$imgPro);
array_push($producImage,$imgPro);
}
}
}
$image = implode('$',$producImage);
$product_title_1 = $_POST['product_title_1'];
$product_description_1 = $_POST['product_description_1'];
$product_title_2 = $_POST['product_title_2'];
$product_description_2 = $_POST['product_description_2'];
$product_title_3 = $_POST['product_title_3'];
$product_description_3 = $_POST['product_description_3'];
$product_title_4 = $_POST['product_title_4'];
$product_description_4 = $_POST['product_description_4'];
$product_title_5 = $_POST['product_title_5'];
$product_description_5 = $_POST['product_description_5'];
$product_title_6 = $_POST['product_title_6'];
$product_description_6 = $_POST['product_description_6'];
$product_title_7 = $_POST['product_title_7'];
$product_description_7 = $_POST['product_description_7'];
$product_title_8 = $_POST['product_title_8'];
$product_description_8 = $_POST['product_description_8'];
$product_title_9 = $_POST['product_title_9'];
$product_description_9 = $_POST['product_description_9'];
$product_title_10 = $_POST['product_title_10'];
$product_description_10 = $_POST['product_description_10'];
$delivery_charge = $_POST['delivery_charge'];
$slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']);
$sqlUrl = mysqli_query($cn, "select * from tbl_product where slug_url='$slug_url'");
if(mysqli_num_rows($sqlUrl)>0)
{
echo '<div class="alert alert-danger"><strong>Danger!</strong> Slug Url Already Exist.</div>';
}
else
{
$sqlSubject = mysqli_query($cn, "insert into `tbl_product` set `category_id`='".$category_id."', `subcategory_id`='".$subcategory_id."', `name`='".$name."', `image`='".$image."', `min_order`='".$min_order."', `max_order`='".$max_order."', `weight`='".$weight."', `skucode`='".$skucode."', `price`='".$price."', `orignalprice`='".$orignalprice."', `stock`='".$stock."', `featured_type`='".$featured_type."', `bulk_order`='".$bulk_order."', `polish_id`='".$polish_id."', `size_id`='".$size_id."', `small_description`='".$small_description."', `delivery_charge`='".$delivery_charge."', `slug_url`='".$slug_url."', `product_title_1`='".$product_title_1."', `product_description_1`='".$product_description_1."', `product_title_2`='".$product_title_2."', `product_description_2`='".$product_description_2."', `product_title_3`='".$product_title_3."', `product_description_3`='".$product_description_3."', `product_title_4`='".$product_title_4."', `product_description_4`='".$product_description_4."', `product_title_5`='".$product_title_5."', `product_description_5`='".$product_description_5."', `product_title_6`='".$product_title_6."', `product_description_6`='".$product_description_6."', `product_title_7`='".$product_title_7."', `product_description_7`='".$product_description_7."', `product_title_8`='".$product_title_8."', `product_description_8`='".$product_description_8."', `product_title_9`='".$product_title_9."', `product_description_9`='".$product_description_9."', `product_title_10`='".$product_title_10."', `product_description_10`='".$product_description_10."'");
if($sqlSubject)
{
echo '<div class="alert alert-success"><strong>Success!</strong> Product Added Successfully.</div>';
}
else
{
echo '<div class="alert alert-danger"><strong>Danger!</strong> Product Not Added. Try Again.</div>';
}
}
}
if(isset($_POST['edit']))
{
$polish_id = "";
$id = $_POST['id'];
$category_id = $_POST['category_id'];
$subcategory_id = $_POST['subcategory_id'];
$name = $_POST['name'];
$weight = $_POST['weight'];
$min_order = $_POST['min_order'];
$max_order = $_POST['max_order'];
$skucode = $_POST['skucode'];
$price = $_POST['price'];
$orignalprice = $_POST['orignalprice'];
$stock = $_POST['stock'];
$featured_type = 0;
if(isset($_POST['featured_type'])){
$featured_type = $_POST['featured_type'];
}
$bulk_order = $_POST['bulk_order'];
if($bulk_order==0)
{
$polish_id = implode('$',$_POST['polish_id']);
}
$size_id = implode('$',$_POST['size_id']);
$small_description = $_POST['small_description'];
$sql = mysqli_query($cn, "select * from tbl_product where id='$id'");
$sqlData = mysqli_fetch_array($sql);
$oldImages = explode('$',$sqlData['image']);
$producImage = array();
$imagesCount = count($_FILES['image']['name']);
if($imagesCount > 0)
{
for($i=0;$i<$imagesCount;$i++)
{
if(!empty($_FILES['image']['name'][$i])){
$imgPro = rand()."_".$_FILES['image']['name'][$i];
move_uploaded_file($_FILES['image']['tmp_name'][$i],"../products/".$imgPro);
array_push($oldImages,$imgPro);
}
}
}
$image = implode('$',$oldImages);
$image = ltrim($image,"$");
$image = rtrim($image,"$");
$product_title_1 = $_POST['product_title_1'];
$product_description_1 = $_POST['product_description_1'];
$product_title_2 = $_POST['product_title_2'];
$product_description_2 = $_POST['product_description_2'];
$product_title_3 = $_POST['product_title_3'];
$product_description_3 = $_POST['product_description_3'];
$product_title_4 = $_POST['product_title_4'];
$product_description_4 = $_POST['product_description_4'];
$product_title_5 = $_POST['product_title_5'];
$product_description_5 = $_POST['product_description_5'];
$product_title_6 = $_POST['product_title_6'];
$product_description_6 = $_POST['product_description_6'];
$product_title_7 = $_POST['product_title_7'];
$product_description_7 = $_POST['product_description_7'];
$product_title_8 = $_POST['product_title_8'];
$product_description_8 = $_POST['product_description_8'];
$product_title_9 = $_POST['product_title_9'];
$product_description_9 = $_POST['product_description_9'];
$product_title_10 = $_POST['product_title_10'];
$product_description_10 = $_POST['product_description_10'];
$delivery_charge = $_POST['delivery_charge'];
$slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']);
$sqlUrl = mysqli_query($cn, "select * from tbl_product where slug_url='$slug_url' and id!='$id'");
if(mysqli_num_rows($sqlUrl)>0)
{
echo '<div class="alert alert-danger"><strong>Danger!</strong> Slug Url Already Exist.</div>';
}
else
{
$sqlSubject = mysqli_query($cn, "update `tbl_product` set `category_id`='".$category_id."', `subcategory_id`='".$subcategory_id."', `name`='".$name."', `image`='".$image."', `min_order`='".$min_order."', `max_order`='".$max_order."', `weight`='".$weight."', `skucode`='".$skucode."', `price`='".$price."', `orignalprice`='".$orignalprice."', `stock`='".$stock."', `featured_type`='".$featured_type."', `bulk_order`='".$bulk_order."', `polish_id`='".$polish_id."', `size_id`='".$size_id."', `small_description`='".$small_description."', `delivery_charge`='".$delivery_charge."', `slug_url`='".$slug_url."', `product_title_1`='".$product_title_1."', `product_description_1`='".$product_description_1."', `product_title_2`='".$product_title_2."', `product_description_2`='".$product_description_2."', `product_title_3`='".$product_title_3."', `product_description_3`='".$product_description_3."', `product_title_4`='".$product_title_4."', `product_description_4`='".$product_description_4."', `product_title_5`='".$product_title_5."', `product_description_5`='".$product_description_5."', `product_title_6`='".$product_title_6."', `product_description_6`='".$product_description_6."', `product_title_7`='".$product_title_7."', `product_description_7`='".$product_description_7."', `product_title_8`='".$product_title_8."', `product_description_8`='".$product_description_8."', `product_title_9`='".$product_title_9."', `product_description_9`='".$product_description_9."', `product_title_10`='".$product_title_10."', `product_description_10`='".$product_description_10."' where `id`='".$id."'");
if($sqlSubject)
{
echo '<div class="alert alert-success"><strong>Success!</strong> Product Update Successfully.</div>';
}
else
{
echo '<div class="alert alert-danger"><strong>Danger!</strong> Product Not Added. Try Again.</div>';
}
}
}
if(isset($_GET['image_id']))
{
$imageName = $_GET['image_id'];
$id = $_GET['edit_id'];
$sql = mysqli_query($cn, "select * from tbl_product where id='$id'");
$sqlData = mysqli_fetch_array ($sql);
$oldImages = explode('$',$sqlData['image']);
if (($key = array_search($imageName, $oldImages)) !== false) {
unset($oldImages[$key]);
}
$image = implode('$',$oldImages);
mysqli_query($cn,"update `tbl_product` SET `image`='$image' where id='$id'");
header("location:home.php?pages=product&edit_id=".$id);
}
if(isset($_GET['edit_id']))
{
$id = $_GET['edit_id'];
$sql = mysqli_query($cn, "select * from tbl_product where id='$id'");
$sqlData = mysqli_fetch_array($sql);
$arrayPolish = explode('$',$sqlData['polish_id']);
$arraySize = explode('$',$sqlData['size_id']);
//$arrayStone = explode('$',$sqlData['stone_id']);
}
?>
<style>
.img-wrap {
position: relative;
display: inline-block;
border: 1px red solid;
font-size: 0;
}
.img-wrap .close {
position: absolute;
top: 2px;
right: 2px;
z-index: 100;
background-color: #FFF;
padding: 5px 2px 2px;
color: #000;
font-weight: bold;
cursor: pointer;
opacity: .2;
text-align: center;
font-size: 22px;
line-height: 10px;
border-radius: 50%;
}
.img-wrap:hover .close {
opacity: 1;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 15rem;
padding: 0.5rem 0;
margin: 0.125rem 0 0;
font-size: 1rem;
color: #212529;
text-align: left;
list-style: none;
list-style-type: none;
background-color:#fff;
background-clip: padding-box;
border: 1px solid #f2f2f2;
border-radius: 0.25rem;
}
.btn-group > .btn:first-child {
margin-left: 0;
width:225px;
}
.setDefault{
font-size: 12px;
position: absolute;
margin: 120px 0px 0px 38px;
padding: 5px;
}
</style>
<div class="col-md-12">
<div class="card">
<div class="card-body">
<h4 class="card-title">Add Product</h4>
<form class="forms-sample" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="exampleInputPassword4">Category <span style="color:#f00;">*</span></label>
<input type="hidden" class="tableName" value="tbl_product">
<input type="hidden" name="id" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['id'];}?>">
<select class="form-control" name="category_id" onchange="getsubcategory(this.value);" required>
<option value="">Select Category</option>
<?php
$sqlCategory = mysqli_query($cn, "select * from `tbl_category` where `status`=1");
while($sqlCategoryData = mysqli_fetch_array($sqlCategory)){?>
<option value="<?php echo $sqlCategoryData['id'];?>" <?php if(isset($_GET['edit_id'])){ if($sqlData['category_id']==$sqlCategoryData['id']){ echo "selected";}}?>><?php echo $sqlCategoryData['name'];?></option>
<?php }?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exampleInputPassword4">Subcategory</label>
<select class="form-control" name="subcategory_id" id="subcategory_id">
<option value="">Select Sub Category</option>
<?php
if(isset($_GET['edit_id'])){
$sqlSubcategory = mysqli_query($cn, "select * from `tbl_subcategory` where `id`='".$sqlData['subcategory_id']."'");
while($sqlSubcategoryData = mysqli_fetch_array($sqlSubcategory)){?>
<option value="<?php echo $sqlSubcategoryData['id'];?>" <?php if($sqlData['subcategory_id']==$sqlSubcategoryData['id']){ echo "selected";}?>><?php echo $sqlSubcategoryData['name'];?></option>
<?php
}
}?>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Name <span style="color:#f00;">*</span></label>
<input type="text" class="form-control setslugUrl" name="name" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['name'];}?>" placeholder="Product Name" autocomplete="off" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label style="display:block;">Product Image <span style="color:#f00;">*</span> <span style="color:red;float:right;">Size must 1000X1000</span></label>
<div class="input-group">
<div class="custom-file">
<input type="file" name="image[]" class="custom-file-input" multiple id="inputGroupFile01" aria-describedby="inputGroupFileAddon01" <?php if(isset($_GET['edit_id'])){}else{?> required <?php }?>>
<label class="custom-file-label" for="inputGroupFile01" style="line-height:2">Choose file</label>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputName1">Slug URL <span style="color:#f00;">*</span></label>
<input type="text" class="form-control slugUrl" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['slug_url'];}?>" name="slug_url" placeholder="Slug URL" autocomplete="off" readonly required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputName1">Weight </label>
<input type="text" class="form-control" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['weight'];}?>" name="weight" placeholder="Weight" autocomplete="off">
</div>
</div>
</div>
<div class="row">
<?php if(isset($_GET['edit_id']))
{
$productImage = explode("$",$sqlData['image']);
$loop = 1;
foreach($productImage as $pI)
{
if(!empty($pI))
{?>
<div class="col-md-2 ">
<div class="form-group img-wrap">
<a href="home.php?pages=product&edit_id=<?php echo $_GET['edit_id'];?>&image_id=<?php echo $pI;?>"><span class="close">×</span></a>
<!--<a href="javascript:void(0);" class="setDefaultProduct" data-image="<?php echo $pI;?>" data-id="<?php echo $_GET['edit_id'];?>"><div class="badge badge-primary setDefault">Set Default</div></a>-->
<a href="javascript:void(0);" class="setDefaultProduct setDefault badge <?php if($loop==1){ echo "badge-info";}else{echo "badge-primary";}?>" data-image="<?php echo $pI;?>" data-id="<?php echo $_GET['edit_id'];?>">Set Default</a>
<img src="../products/<?php echo $pI;?>" width="150" height="150"/>
</div>
</div>
<?php
$loop++;
}
}
}
?>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputCity1">Min. Order Qty <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="min_order" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['min_order'];}?>" placeholder="Min. Order" required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputCity1">Max. Order Qty <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="max_order" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['max_order'];}?>" placeholder="Max. Order" required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputCity1">Product SKU <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="skucode" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['skucode'];}?>" placeholder="SKU" required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputCity1">Price <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="orignalprice" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['orignalprice'];}?>" placeholder="Price" required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputCity1">Selling Price <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="price" value="<?php if(isset($_GET['edit_id'])) {echo $sqlData['price'];}?>" placeholder="Price" required>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Stock Available <span style="color:#f00;">*</span></label>
<div class="row">
<div class="col-md-6">
<div class="form-radio">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="stock" value="1" <?php if(isset($_GET['edit_id'])){ if($sqlData['stock']==1){ echo "checked";}}else{ echo "checked";}?>> Yes
</label>
</div>
</div>
<div class="col-md-6">
<div class="form-radio">
<label class="form-check-label">
<input type="radio" class="form-check-input" name="stock" value="0" <?php if(isset($_GET['edit_id'])){ if($sqlData['stock']==0){ echo "checked";}}?>> No
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>Bulk Order <span style="color:#f00;">*</span></label>
<div class="row">
<div class="col-md-6">
<div class="form-radio">
<label class="form-check-label">
<input type="radio" class="form-check-input" onclick="setBulk(this.value);" name="bulk_order" value="1" <?php if(isset($_GET['edit_id'])){ if($sqlData['bulk_order']==1){ echo "checked";}}?>> Yes
</label>
</div>
</div>
<div class="col-md-6">
<div class="form-radio">
<label class="form-check-label">
<input type="radio" class="form-check-input" onclick="setBulk(this.value);" name="bulk_order" value="0" <?php if(isset($_GET['edit_id'])){ if($sqlData['bulk_order']==0){ echo "checked";}}else{ echo "checked";}?>> No
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>FEATURED PRODUCT <span style="color:#f00;"></span></label><br />
<input type="checkbox" name="featured_type" value="1" <?php if(isset($_GET['edit_id'])){ if($sqlData['featured_type']==1){ echo "checked";}}?>>
</div>
</div>
<div class="col-md-3" id="polishBox">
<div class="form-group">
<label for="exampleInputName1">Product Polish</label><br />
<select id="polish" name="polish_id[]" class="form-control" multiple>
<?php
$sqlPolish = mysqli_query($cn, "select * from `tbl_polish` order by `name`");
while($sqlPolishData = mysqli_fetch_array($sqlPolish)){?>
<option value="<?php echo $sqlPolishData['id'];?>" <?php if(isset($_GET['edit_id'])){ if(in_array($sqlPolishData['id'], $arrayPolish)){ echo "selected";}}?>><?php echo $sqlPolishData['name'];?></option>
<?php }?>
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="exampleInputName1">Product Size</label><br />
<select id="size" name="size_id[]" class="form-control" multiple>
<?php
$sqlSize = mysqli_query($cn, "select * from `tbl_size` order by `name`");
while($sqlSizeData = mysqli_fetch_array($sqlSize)){?>
<option value="<?php echo $sqlSizeData['id'];?>" <?php if(isset($_GET['edit_id'])){ if(in_array($sqlSizeData['id'], $arraySize)){ echo "selected";}}?>><?php echo $sqlSizeData['name'];?></option>
<?php }?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="exampleInputCity1">Small Description</label>
<textarea class="form-control" name="small_description" placeholder="Small Description" style="height:100px;"><?php if(isset($_GET['edit_id'])) {echo $sqlData['small_description'];}?></textarea>
</div>
</div>
</div>
<label for="exampleInputCity1">Product Description</label>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 1</label>
<input type="text" class="form-control" name="product_title_1" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_1'];}else{echo "Product Code";}?>" placeholder="Product Title 1">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 1</label>
<input type="text" class="form-control" name="product_description_1" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_1'];}?>" placeholder="Product Description 1">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 2</label>
<input type="text" class="form-control" name="product_title_2" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_2'];}else{echo "Weight";}?>" placeholder="Product Title 2">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 2</label>
<input type="text" class="form-control" name="product_description_2" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_2'];}?>" placeholder="Product Description 2">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 3</label>
<input type="text" class="form-control" name="product_title_3" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_3'];}else{echo "Material";}?>" placeholder="Product Title 3">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 3</label>
<input type="text" class="form-control" name="product_description_3" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_3'];}?>" placeholder="Product Description 3">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 4</label>
<input type="text" class="form-control" name="product_title_4" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_4'];}else{echo "Stone";}?>" placeholder="Product Title 4">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 4</label>
<input type="text" class="form-control" name="product_description_4" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_4'];}?>" placeholder="Product Description 4">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 5</label>
<input type="text" class="form-control" name="product_title_5" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_5'];}else{echo "Height";}?>" placeholder="Product Title 5">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 5</label>
<input type="text" class="form-control" name="product_description_5" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_5'];}?>" placeholder="Product Description 5">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 6</label>
<input type="text" class="form-control" name="product_title_6" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_6'];}?>" placeholder="Product Title 6">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 6</label>
<input type="text" class="form-control" name="product_description_6" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_6'];}?>" placeholder="Product Description 6">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 7</label>
<input type="text" class="form-control" name="product_title_7" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_7'];}?>" placeholder="Product Title 7">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 7</label>
<input type="text" class="form-control" name="product_description_7" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_7'];}?>" placeholder="Product Description 7">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 8</label>
<input type="text" class="form-control" name="product_title_8" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_8'];}?>" placeholder="Product Title 8">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 8</label>
<input type="text" class="form-control" name="product_description_8" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_8'];}?>" placeholder="Product Description 8">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 9</label>
<input type="text" class="form-control" name="product_title_9" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_9'];}?>" placeholder="Product Title 9">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 9</label>
<input type="text" class="form-control" name="product_description_9" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_9'];}?>" placeholder="Product Description 9">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Product Title 10</label>
<input type="text" class="form-control" name="product_title_10" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_title_10'];}?>" placeholder="Product Title 10">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputCity1">Product Description 10</label>
<input type="text" class="form-control" name="product_description_10" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['product_description_10'];}?>" placeholder="Product Description 10">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputCity1">Delivery Charge <span style="color:#f00;">*</span></label>
<input type="text" class="form-control" name="delivery_charge" value="<?php if(isset($_GET['edit_id'])){echo $sqlData['delivery_charge'];}?>" placeholder="Delivery charge" required>
</div>
</div>
</div>
<button type="submit" class="btn btn-success mr-2" name="<?php if(isset($_GET['edit_id'])) {echo "edit";}else{ echo "add";}?>">Submit</button>
</form>
</div>
</div>
</div>