<?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"];
$list=json_decode($_POST["list"],true);
$status=$_POST["status"];

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

$profileQuery="SELECT id,train_type,train_subject,nature_of_training,train_title,train_emp_emailid,train_employee,trainer_name,train_location,train_sponser,train_organized,start_date,end_date,start_time,end_time,train_description,created_by,company,date,deleted  FROM employee_training WHERE  train_emp_emailid='$email' AND deleted='0'";

$result=mysqli_query($con,$profileQuery);
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);


?>