<?php
session_start();
include('../includes/session.php');	
include('../../Server/connection.php');
$sqlQuery = "SELECT entrypoint_name.ent_name,count(*) as AllFiles,count(case when client_files.fileStatus = 1 then 1 end) as ClosedFiles, count(case when client_files.fileStatus = 0 then 1 end) as PendingFiles  FROM client_files,entrypoint_name where client_files.entryName_id=entrypoint_name.entryName_id and client_files.client_id='$staff_id' GROUP BY client_files.entryName_id";
$result = $conn->query($sqlQuery);
$data = array();
foreach ($result as $row){
	$data[] = $row;
}
echo json_encode($data);
?>