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

$myJSON = 0;
if(isset($_POST["nekot"]) && isset($_POST["json"]))
{
	$postdata = $_POST["json"];
	$customers = json_decode($postdata,true);
$lat="0.0";
$lng = "0.0";
	$toke = $_POST["nekot"];
if($toke == "sldiskdjgsoewmvmdpekdjghsncusi"){
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8;");

					for($i=0;$i<sizeof($customers);$i++){
							$update_query= "UPDATE ".$tbl_customer." SET C_mobile = '".$customers[$i]["C_Mobile"]."',blackList = '".$customers[$i]["C_BlackList"]."', C_name = '".$customers[$i]["C_Name"]."', address = '".$customers[$i]["C_Address"]."', phone = '".$customers[$i]["C_Tel"]."',C_Code= '".$customers[$i]["C_Code_C"]."',C_id= '".$customers[$i]["C_Code"]."', C_acc = '".$customers[$i]["C_Account"]."', C_etebar = '".$customers[$i]["C_Etebar"]."' WHERE C_mobile ='".$customers[$i]["C_Mobile"]."'";
							$upres =@mysqli_query($connect,$update_query);
							if(!$upres){
							$myJSON = 402;
								echo $myJSON;
							return;
							}
						}
		$myJSON = 200;
	}
	else{
		$myJSON = 401;
	}

		}
	 else
		 $myJSON =405;
}
    echo $myJSON;

?>
