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

$myJSON=array();
if(isset($_POST["nekot"]) && isset($_POST["an1d"]))
{
	$tok = $_POST["nekot"];
	$id = $_POST["an1d"];
if($tok == "sfiexcmajskdfjkmaskdalfe"){
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8;");

					$query_all = "SELECT ".$tbl_orderdtl.".id, ".$tbl_orderdtl.".count,".$tbl_products.".P_id,".$tbl_orderdtl.".price,".$tbl_orderdtl.".total,".$tbl_orderdtl.".off,".$tbl_products.".P_name FROM  ".$tbl_orderdtl.",".$tbl_products." WHERE ".$tbl_orderdtl.".O_id = '".$id."' AND ".$tbl_orderdtl.".P_id =".$tbl_products.".id";
					$result = @mysqli_query($connect,$query_all);
					if($result)
					{
						while($rowdt = @mysqli_fetch_assoc($result))	{
							array_push($myJSON,$rowdt);
						}
					}
		}
	}
}
echo json_encode($myJSON);
?>
