";
}
if($hasWriteAccess)
{
$edit_link="";
}
if($hasExecuteAccess)
{
$delete_link="";
}
$space=" ";
$links = $assign_link.$space.$view_link.$space.$edit_link.$space.$delete_link;
// calculate age by dob
$age = date_diff(date_create($row_ailment['dob']), date_create('now'))->y;
// $date_added= date_create($row_ailment['date_added']);
// $date_added=date_format($date_added,"d-m-Y");
// $resumed_duties_from=date_create($row_ailment['resumed_duties_from']);
// $resumed_duties_from=date_format($resumed_duties_from,"d-m-Y");
// $tested_positive_on=date('d-m-Y h:i A', strtotime($row_ailment['tested_positive_on']));
// $discharge_on=date('d-m-Y h:i A', strtotime($row_ailment['discharge_on']));
$appointment_date = date_format(date_create($row_ailment['appointment_date']),"d/m/Y g:i a");
$data['rows'][] = array(
'id' => $row_ailment['id'],
'cell' => array($links, $count++, $appointment_date ,$row_ailment['patient_name'],$row_ailment['father_name'], $age, $row_ailment['gender'], $row_ailment['ticket_no'], $row_ailment['emp_code'], $row_ailment['personal_phone'], $row_ailment['entry_med_test'], $row_ailment['remarks'], $row_ailment['reviewer_comment'])
);
}
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array('', "", "", '', '','', '', '', '', '', '', '', '','', '', '','', '', '','')
);
echo json_encode($data);
// error_log(json_encode($data));
?>