<?php

require_once __DIR__ . '/db_config.php';

$r = array();
$r["list"] = array();


if (isset($_POST["cname"]) ) {
 
$cname=$_POST["cname"];
$email=$_POST["mail"];
$id=$_POST["id"];
$status=$_POST["status"];

$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD,DB_DATABASE) or die(mysql_error());

$query="SELECT id,sa_emailid,sa_name,basic_salary,house_rent_allowance,conveyance,DA,medical,food,special,cca,other,my_leaves,lop_per_day,lop,sa_net_pay,loan,advance,sa_created_by,month,year,sa_datetime,sa_published_date FROM hcm_payroll_salary_published WHERE sa_emailid='$email'";

$result=mysqli_query($con,$query);
if(!empty($result) && mysqli_num_rows($result) > 0){
    while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) {
        array_push($r["list"], $row);
    }
}

mysqli_close($con);

}

echo json_encode($r,JSON_UNESCAPED_SLASHES);


?>