<?php
require_once ("varables.php");


if(isset($_POST["nekot"]) && isset($_POST["di"]))
{
	$toke = $_POST["nekot"];
	$id = $_POST["di"];
if($toke == "sldiskdjgsoewmvmdpekdjghsncusi"){
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8;");
		$select = "DELETE FROM ".$tbl_customer." WHERE id = '".$id."'";
		$result = @mysqli_query($connect,$select);
		if($result){
			$select = "DELETE FROM ".$tbl_orders." WHERE C_id = '".$id."'";
			@mysqli_query($connect,$select);
			$select = "DELETE FROM ".$tbl_routdtl." WHERE C_id = '".$id."'";
			@mysqli_query($connect,$select);
			echo "200";
			return;
		}
		else{
			echo "خطایی در انجام عملیات:\n". @mysqli_error($connect);
			return;
		}
		}
		else{
			echo "خطا در برقراری ارتباط با پایگاه داده \nلطفا بعد از دقایقی مجددا امتحان کنید.";
			return;
		}
	}
}
else{
	echo "کمبود منابع...!";
	return;
}


?>
