<?php
if (!isset($_SESSION)) {
	session_start();
}
include "../actions/dbPDO.php";
if (isset($_POST["req_id"]))
	$myReq = $_POST["req_id"]; {
	$output = array();
	$sql = $db->prepare("SELECT ment_request.* , ment_status.ment_status FROM ment_request , ment_status
		WHERE ment_request.done = ment_status.status_id AND req_id = ? LIMIT 1");
	$sql->bindParam(1, $myReq);
	$sql->execute();
	if ($sql->rowCount() > 0) {
		$row = $sql->fetch(PDO::FETCH_ASSOC);
		$output["req_id"]   		= $row["req_id"];
		$output["car_id"]     	= $row["car_id"];
		$output["ask_date"]     = $row["ask_date"];
		$output["kmm"]   		= $row["kmm"];
		$output["description"]  = $row["description"];
		$output["photo_before"] = $row["photo_before"];
		$output["feedback"]     = $row["feedback"];
		$output["done"]    		= $row["done"];
		$output["date_done"]    = $row["date_done"];
		$output["photo_after"]  = $row["photo_after"];
		$output["next_kmm"] 	= $row["next_kmm"];
		$output["father"] 		= $row["father"];
		$output["tech"] 		= $row["tech"];
		$output["comm"]   		= $row["comm"];
		$output["ment_status"]  = $row["ment_status"];
	}
	echo json_encode($output);
}
