";
}
if ($hasWriteAccess) {
$edit_link = "";
}
if ($hasExecuteAccess) {
$delete_link = "";
}
$space=" ";
$links = $assign_link.$space.$view_link.$space.$edit_link.$space.$delete_link;
// $assign_link . $space .
//$links="".$links."
";
$filled=$row['id'];
$box2="select patient_name from patient_master where id='".$filled."'";
error_log("filled".$box2);
$result1=mysqli_query($conn,$box2);
$row3=mysqli_fetch_assoc($result1);
$box3="SELECT dob,employer_contractor_name from patient_master p, employer_contractor ec where p.employer_contractor_id=ec.id and p.id='$filled'";
$result2=mysqli_query($conn,$box3);
$row4=mysqli_fetch_assoc($result2);
$dob=$row4['dob'];
$birthdate = new DateTime($dob);
$today = new DateTime('today');
$age = $birthdate->diff($today)->y;
$data['rows'][] = array(
'id' => $row['id'],
'cell' => array($count++, $links, $row3['patient_name'],$age,$row4['employer_contractor_name'],$row['location'] ,date_format(date_create($row['date_of_mockdrill']),"d-M-Y"),$row['patient_attending_doctor_name'], $row['patient_attending_staff_name'],$row['amb_sen_t'] ,$row['inf_rec_time'] , $row['patients_in_hospital'],$row['given_treatment'] ,$row['patient_condition_on_discharge_time'] ,$row['dis_time'] ,$row['bp'] ,$row['pulse'] ,$row['Spo2'] ,$row['RBS'] ,$row['temp'] )
);
}
commit();
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array('', "", "", '', '','', '', '', '', '', '', '', '','', '', '','', '', '','')
);
echo json_encode($data);
?>