<?php 
include('../include/config.php');
if(!empty($_POST["id"])) 
{
    $id= $_POST["id"];
    $result =mysqli_query($con,"SELECT Imprest2.*,Imprest.Title as tit,Staffs.Name as user FROM Imprest2 join Imprest ON Imprest.id=Imprest2.Imprest left join Staffs ON Staffs.id=Imprest.User WHERE count='$id'");
    $row=mysqli_fetch_array($result);
    echo json_encode($row);
    }else
    {
      echo "Not found";
    }
?>