

<?php


if(isset($_POST['cod_meli'])&& !empty($_POST['cod_meli'])&&
   isset($_POST['name'])&& !empty($_POST['name'])&&
   isset($_POST['mbl_cod'])&& !empty($_POST['mbl_cod'])&&
   isset($_POST['mbl_name'])&& !empty($_POST['mbl_name'])&&
   isset($_POST['mbl_select_canteri'])&& !empty($_POST['mbl_select_canteri'])&&
   isset($_POST['mbl_select_nafar'])&& !empty($_POST['mbl_select_nafar'])&&
   isset($_POST['mbl_action_nafar'])&& !empty($_POST['mbl_action_nafar'])&&
   isset($_POST['mbl_select_rang'])&& !empty($_POST['mbl_select_rang'])&&
   isset($_POST['jens'])&& !empty($_POST['jens'])&&
   isset($_POST['mbl_select_years'])&& !empty($_POST['mbl_select_years'])&&
   isset($_POST['tel'])&& !empty($_POST['tel'])&&
   isset($_POST['email'])&& !empty($_POST['email'])&&
   isset($_POST['addres'])&& !empty($_POST['addres'])&&
   isset($_POST['mbl_price'])&& !empty($_POST['mbl_price'])){
	
	$cod_meli=$_POST['cod_meli'];
	$name=$_POST['name'];
	$mbl_cod=$_POST['mbl_cod'];
	$mbl_name=$_POST['mbl_name'];
	$mbl_select_cantre=$_POST['mbl_select_canteri'];
	$mbl_select_nafar=$_POST['mbl_select_nafar'];
	$mbl_action_nafar=$_POST['mbl_action_nafar'];
	$mbl_select_rang=$_POST['mbl_select_rang'];
	$jens=$_POST['jens'];
	$mbl_select_years=$_POST['mbl_select_years'];
	$tel=$_POST['tel'];
	$email=$_POST['email'];
	$mbl_img=$_POST['mbl_img'];
	$addres=$_POST['addres'];
	$mbl_price=$_POST['mbl_price'];
	
	

}else
	exit("مشخصات کامل نیست.");

	$link=mysqli_connect("localhost","root","","shop");
if(mysqli_connect_errno()){
	exit("چنین خطایی رخ داده است".mysqli_connect_error());
}
	

	
	
	
	
	
	
	
	
$query="UPDATE `factor` SET 
	cod_meli='$cod_meli',
	name='$name',
	tel='$tel',
	mbl_cod='$mbl_cod',
	mbl_name='$mbl_name',
	mbl_select_cantre='$mbl_select_cantre',
	mbl_img='$mbl_img',
	mbl_select_nafar='$mbl_select_nafar',
	mbl_action_nafar='$mbl_action_nafar',
	mbl_select_rang='$mbl_select_rang',
	jens='$jens',
	data='".date('F j, Y,g:i a')."',
	mbl_price='$mbl_price',
	mbl_select_years='$mbl_select_years',
	email='$email',
	addres=$addres,
	state='3',
	action_state='لغو سفارش'
		WHERE cod_meli='$cod_meli',name='$name'";




if(mysqli_query($link,$query)===true){
		echo("<p style='color=green;'><b>با موفقیت لغو شد.<b/></p>");
		
	}else
		echo("<p style='color=red;'><b>خطا در لغو سفارش .<b/></p>");
	
	
mysqli_close($link);



?>






