<?php

if(isset($_POST["cont_id"]))
{
	include "dbPDO.php";
	$dd = $_POST["cont_id"];
	$output = array();
	$sql = $db->prepare("SELECT * FROM supp_contracts WHERE cont_id = ? LIMIT 1");
	$sql->bindParam(1,$dd);
	$sql->execute();
  if($sql->rowCount()>0){$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["cont_id"]   				= $row["cont_id"];
		$output["contract_code"]   	= $row["contract_code"];
    	$output["ask_date"]     		= $row["ask_date"];
		$output["recpeit"]    			= $row["recpeit"];
    	$output["description"]			= $row["description"];
		$output["first_payment"]    = $row["first_payment"];
    	$output["kest_amount"]  		= $row["kest_amount"];
		$output["kest_qty"]   			= $row["kest_qty"];
    	$output["first_kest"] 			= $row["first_kest"];
		$output["last_payment"]   	= $row["last_payment"];
		$output["total_cost"]   		= $row["total_cost"];
		$output["cars_qty"]     		= $row["cars_qty"];
    	$output["comm"]     				= $row["comm"];
			
   }
	echo json_encode($output);
}
?>
