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

$myJSON = 0;
if(isset($_POST["nekot"]) && isset($_POST["json"]))
{
	$postdata = $_POST["json"];
	$customers = json_decode($postdata,true);
	$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_pays." SET oked = '1' WHERE payid ='".$customers[$i]["payid"]."'";
							$upres =@mysqli_query($connect,$update_query);
							if(!$upres){
							$myJSON = 402;
								echo $myJSON;
							return;
							}
						}
		$myJSON = 200;
	}
	else{
		$myJSON = 401;
	}

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

?>
