<?php include('../../config/setup.php');?>
<?php
error_reporting(0);
 if(isset($_POST['product_price_edit']))
 { 
 $offer_per = (100 * ($_POST['Edit_pro_price'] - $_POST['Edit_shell_pro_price']) / $_POST['Edit_pro_price'] );

$editon=date('Y-m-d');
if($_FILES['p_image']['name'])
{
	$addsugcatephoto=$_FILES['p_image']['name'];
	$pimage="../../../photos/Product/".$addsugcatephoto;

	move_uploaded_file($_FILES["p_image"]["tmp_name"],$pimage);
$update_pro_price=mysqli_query($config,"update product_price_master set Product_price='".$_POST['Edit_pro_price']."',Product_status='".$_POST['productprice_status']."',product_stock='".$_POST['Edit_product_qty']."',Shelling_price='".$_POST['Edit_shell_pro_price']."',Offer_Percent='$offer_per',P_image='$addsugcatephoto',p_weight='".$_POST['weight']."',p_texture='".$_POST['texture']."',Product_length='".$_POST['length']."',Product_type='".$_POST['color']."' where Product_price_id='".$_POST['productprice_id']."'");
}else{
$update_pro_price=mysqli_query($config,"update product_price_master set Product_price='".$_POST['Edit_pro_price']."',Product_status='".$_POST['productprice_status']."',product_stock='".$_POST['Edit_product_qty']."',Shelling_price='".$_POST['Edit_shell_pro_price']."',Offer_Percent='$offer_per',p_weight='".$_POST['weight']."',p_texture='".$_POST['texture']."',Product_length='".$_POST['length']."',Product_type='".$_POST['color']."' where Product_price_id='".$_POST['productprice_id']."'");

}


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

	
}

 }

?>
 