<?php include('../../config/setup.php');?>
<?php
 if(isset($_POST['product_edit']))
 { 
$editon=date('Y-m-d');
$addprophoto=$_FILES['Add_product_master_image']['name'];
if($addprophoto){
$addprphoto="../../../img/Product/".$addprophoto;
move_uploaded_file($_FILES["Add_product_master_image"]["tmp_name"],$addprphoto);
  

$update_pro_=mysqli_query($config,"update product_master set Product_Name='".$_POST['Edit_pro_name']."',Product_offer='".$_POST['Edit_pro_cate_offer']."',Product_Active_Status='".$_POST['pro_status']."',Product_description='".$_POST['pro_desc']."',product_brand='".$_POST['Edit_pro_brand']."',product_display_cate='".$_POST['Edit_pro_dispaly_cate']."',product_display='".$_POST['Edit_pro_dispaly_as']."',product_video_link='".$_POST['Add_pro_video_link']."',Main_Category='".$_POST['Add_product_maincate']."',product_developer='".$_POST['Edit_pro_developer']."',product_publisher='".$_POST['Edit_pro_publiser']."',Releasing_on='".$_POST['Edit_pro_release']."',refundpolicy='".$_POST['return']."',Product_image='$addprophoto',pro_list='".$_POST['p_list']."',sub_cate='".$_POST['Add_product_sub']."',delivry='".$_POST['delivry']."' where Product_id='".$_POST['Edit_pro_id']."'");
}else{

	 $sql="update product_master set Product_Name='".$_POST['Edit_pro_name']."',Product_offer='".$_POST['Edit_pro_cate_offer']."',Product_Active_Status='".$_POST['pro_status']."',Product_description='".$_POST['pro_desc']."',product_brand='".$_POST['Edit_pro_brand']."',product_display_cate='".$_POST['Edit_pro_dispaly_cate']."',product_display='".$_POST['Edit_pro_dispaly_as']."',product_video_link='".$_POST['Add_pro_video_link']."',product_developer='".$_POST['Edit_pro_developer']."',Main_Category='".$_POST['Add_product_maincate']."',product_publisher='".$_POST['Edit_pro_publiser']."',Releasing_on='".$_POST['Edit_pro_release']."',refundpolicy='".$_POST['return']."',pro_list='".$_POST['p_list']."',sub_cate='".$_POST['Add_product_sub']."',delivry='".$_POST['delivry']."' where Product_id='".$_POST['Edit_pro_id']."'";
	$update_pro_=mysqli_query($config,$sql);

} 


if($update_pro_==false)
{
echo "<script>window.location.href='../product_master.php?erro=0';</script>".mysqli_error();	 
}
else{
	
	echo "<script>window.location.href='../product_master.php?msg=100';</script>";	 

	
}

 }

?>
 
