";
}
}
$checkup_code = getFieldFromTable('checkup_type_code', 'checkup_type', 'checkup_type_id', $row_checkup['checkup_type_id']);
$checkup_name = getFieldFromTable('checkup_type_name', 'checkup_type', 'checkup_type_id', $row_checkup['checkup_type_id']);
$emp_exa = " ";
if ($hasReadAccess) {
$view_link = $space . "";
$print_link = $space . "";
$dr_vr = " ";
if ($checkup_code == 'Pre_Emp_Medical_Examination_Driver') {
$dr_vr = "";
$emp_exa = $space . $dr_vr;
}
$pre_anu_dr_vr = " ";
if ($checkup_code == 'Annual_Medical_Checkup_Driver') {
$pre_anu_dr_vr = "";
$emp_exa = $space . $pre_anu_dr_vr;
}
if ($checkup_code == 'Quarterly_P.E' || $checkup_code == 'Quarterly_I' || $checkup_code == 'Quarterly_II' || $checkup_code == 'Quarterly_III' || $checkup_code == 'Quarterly_IV') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Pre_Emp_MEDICAL_EXAMination_CANTEEN_EMPLOYEE') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Analine_Handling_After' || $checkup_code == 'Analine_Handling_Before' ) {
$emp_exa = $space . "";
}
if ($checkup_code == 'Medical_examination_Cyanide_Charging_After' || $checkup_code == 'Medical_examination_Cyanide_Charging_Before') {
$emp_exa = $space . "";
}
if ($checkup_code == 'MEDICAL_EXAMINATION_CANTEEN_Employee') {
$emp_exa = $space . "";
}
if ($checkup_name == 'Pre Emp. Medical Examinations - Contract Employee') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Medical_Examination_For_Work_At_Height') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Medical_Examination_for_Confined_Space') {
$emp_exa = $space . "";
}
if ($checkup_name == "Pre Emp Medical Exam - Temporary Candidate") {
$emp_exa = $space . "";
}
if ($checkup_code == 'PRE_EMPLOYEMENT_MEDICAL_EXAMINATION_PROBATIONERS') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Half_Yearly_Medical_Checkup') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Six_Monthly_Medical_Checkup_II') {
$emp_exa = $space . "";
}
if ($checkup_code == 'ANNUAL_MEDICAL_EXAMINATION_HAZARDOUS') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Periodical_Medical_Examination_Inscticides') {
$emp_exa = $space . "";
}
if ($checkup_code == 'Executive_Medical_Checkup') {
$emp_exa = $space . "";
}
// if($checkup_code == 'Pre Employement Medical Examination - Probationers'){
// }
if ($row_checkup['checkup_type_id'] == 40 || $row_checkup['checkup_type_id'] == '40') {
$cirtificate = $space . "";
}
if ($row_checkup['checkup_type_id'] == 23 || $row_checkup['checkup_type_id'] == '23' || $row_checkup['checkup_type_id'] == 35 || $row_checkup['checkup_type_id'] == '35') {
$cirtificate = $space . "";
}
}
if ($hasWriteAccess) {
$edit_link = $space . "";
}
if ($hasExecuteAccess) {
$delete_link = $space . "";
}
$ohc_state_code = getFieldFromTable('state', 'ohc_type', 'ohc_type_id', $_SESSION['current_ohcttype']);
// $form_names = getFieldFromTable('form_names', 'state_form_master', 'state_code', $ohc_state_code);
// error_log("form names " . $form_names);
// $forms = explode(',', $form_names);
// error_log("form array " . print_r($forms, true));
if ($ohc_state_code == 'MH') {
if ($_SESSION['RoleCode'] == 'DOC' || $_SESSION['RoleCode'] == 'LAB') {
if($checkup_code== 'ANNUAL_MEDICAL_EXAMINATION_HAZARDOUS'){
$open_form_link = "";
}else{
$open_form_link="";
}
} else {
$open_form_link = "";
}
$form_type = getTableFieldValue('form_data', 'form_type', 'checkup_id', $checkup_id);
$doc_down_type = "";
$form_type_32 = getTableFieldValue('form_32', 'id', 'checkup_id', $checkup_id);
error_log("form type 32 query " . $form_type_32);
if ($form_type != null && $form_type != "") {
if ($form_type == 'form_33') {
$open_link = " (Form 33)";
$doc_down_type = 'Form33';
} else if ($form_type == 'form_O') {
$doc_down_type = 'FormO';
$open_link = " (Form O)";
}
} else {
$doc_down_type = "";
}
if ($form_type_32 != null && $form_type_32 != '') {
if($checkup_code == 'ANNUAL_MEDICAL_EXAMINATION_HAZARDOUS'){
$form32pdf_link = " (Form 7)";
$form32CombinePdf_link = " (Form 7 Combined)";
}
else{
$form32pdf_link = "";
$form32CombinePdf_link = "";
}
} else {
$form32pdf_link = "";
$form32CombinePdf_link = "";
}
}
$checkupSections = getCommaSeperatedValuesForInClause("select section_name from checkup_form_section", "section_id", $row_checkup['checkup_section_ids']);
$health_risk = getCommaSeperatedValuesForInClause("select health_risk_name from health_risk", "health_risk_id", $row_checkup['health_risk_id']);
$health_advices = getCommaSeperatedValuesForInClause("select health_advice_name from health_advice", "health_advice_id", $row_checkup['health_advice_id']);
$abnormality = getCommaSeperatedValuesForInClause("select abnormality_name from abnormality", "abnormality_id", $row_checkup['abnormality_ids']);
$links = $assign_link . $view_link . $edit_link . $delete_link . $print_link . $cirtificate . $emp_exa;
if ($row_checkup['approve_date'] != '') {
$approve_date = date_format(date_create($row_checkup['approve_date']), "d-M-Y H:i A");
if ($approve_date == '30-Nov--0001 00:00 AM') $approve_date = "Pending Approval";
}
$data['rows'][] = array(
'id' => $row_checkup['checkup_id'],
'cell' => array(
$count++,
$links,
$suppoting_doc1,
date_format(date_create($row_checkup['checkup_date']), "d-M-Y H:i A"),
$row_checkup['ticket_no'],
$row_checkup['patient_name'],
$row_checkup["emp_code"],
$checkup_name,
$checkupSections,
// $health_risk,
// $health_advices,
// $abnormality,
// $form32_link,
// $form32pdf_link,
// $open_form_link,
// $open_link . " " . $form32pdf_link . " " . $form32CombinePdf_link,
$open_form_link,
$open_link . " " . $form32pdf_link . " " . $form32CombinePdf_link,
$row_checkup['remarks'],
$approve_date
)
);
}
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array('', "", "", '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
);
// error_log("data: ".print_r($data, true));
echo json_encode($data);
?>