512 lines
16 KiB
PHP
512 lines
16 KiB
PHP
|
<html>
|
||
|
|
||
|
|
||
|
|
||
|
<head>
|
||
|
|
||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||
|
<div id="opd_form_div" style="display:none">
|
||
|
<form id="opd_form" name="opd_form">
|
||
|
|
||
|
|
||
|
<?php
|
||
|
|
||
|
//include autoloader;
|
||
|
|
||
|
include('includes/config/config.php');
|
||
|
|
||
|
include_once("includes/functions.php");
|
||
|
|
||
|
?>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<style>
|
||
|
div b {
|
||
|
text-transform: capitalize;
|
||
|
}
|
||
|
|
||
|
.tbl1 {
|
||
|
|
||
|
|
||
|
width: 100%;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
th {
|
||
|
|
||
|
font-size: 12px;
|
||
|
font-style: bold;
|
||
|
vertical-align: top;
|
||
|
}
|
||
|
|
||
|
td {
|
||
|
text-align: left;
|
||
|
font-size: 12px;
|
||
|
vertical-align: top;
|
||
|
}
|
||
|
|
||
|
h1 {
|
||
|
text-align: left;
|
||
|
font-size: 12px;
|
||
|
vertical-align: top;
|
||
|
}
|
||
|
|
||
|
table {
|
||
|
border-collapse: collapse;
|
||
|
width: 100%;
|
||
|
border: 2px solid black;
|
||
|
}
|
||
|
|
||
|
th,
|
||
|
td {
|
||
|
padding: 8px;
|
||
|
text-align: left;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
.page-break {
|
||
|
page-break-before: always;
|
||
|
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
text-transform: uppercase;
|
||
|
}
|
||
|
|
||
|
.no-border {
|
||
|
border: none;
|
||
|
}
|
||
|
|
||
|
.no-border-td {
|
||
|
border-bottom: none;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
|
||
|
|
||
|
</head>
|
||
|
<?php
|
||
|
$queryc = "select * from company_profile ";
|
||
|
|
||
|
$resultc = mysqli_query($conn, $queryc);
|
||
|
|
||
|
$row_company = mysqli_fetch_array($resultc);
|
||
|
|
||
|
@extract($row_company);
|
||
|
?>
|
||
|
<?php
|
||
|
$checkup_id = $_REQUEST['checkup_id'];
|
||
|
$check_chk_type = getFieldFromTable('checkup_type_id','checkup_form','checkup_id',$checkup_id);
|
||
|
|
||
|
$sql_employee_appointment = "SELECT * FROM checkup_form WHERE checkup_id = '" . $checkup_id . "' ";
|
||
|
|
||
|
|
||
|
error_log("sql injury pres:" . $sql_employee_appointment);
|
||
|
|
||
|
$res_emp_appoint = mysqli_query($conn, $sql_employee_appointment);
|
||
|
|
||
|
while ($rows_emp_appoint = mysqli_fetch_array($res_emp_appoint)) {
|
||
|
$emp_id = $rows_emp_appoint['emp_id'];
|
||
|
$ticket_no = $rows_emp_appoint['ticket_no'];
|
||
|
|
||
|
$date_a = $rows_emp_appoint['checkup_date'];
|
||
|
$fit_status = $rows_emp_appoint['fit_unfit_status'];
|
||
|
|
||
|
|
||
|
$date = date("d-m-Y", strtotime($date_a));
|
||
|
$time = date("H:i A", strtotime($date_a));
|
||
|
|
||
|
$patient_name = getFieldFromTable('patient_name', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
|
||
|
$primary_phone = getFieldFromTable('primary_phone', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
|
||
|
$dob = getFieldFromTable('dob', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
|
||
|
$gender = getFieldFromTable('gender', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
|
||
|
$dept_id = getFieldFromTable('dept_id', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
|
||
|
$dept_name = getFieldFromTable('dept_name', 'department', 'dept_id', $dept_id);
|
||
|
|
||
|
|
||
|
|
||
|
$c = date('Y');
|
||
|
$y = date('Y', strtotime($dob));
|
||
|
$age = $c - $y;
|
||
|
}
|
||
|
//before =58
|
||
|
//after= 59
|
||
|
|
||
|
$sql_for_chk_ids = "SELECT checkup_id FROM checkup_form where emp_id = '$emp_id' and checkup_type_id IN ('58', '59')";
|
||
|
$res_chk_ids = mysqli_query($conn, $sql_for_chk_ids);
|
||
|
$checkupIds = [];
|
||
|
while ($rows_chk_ids = mysqli_fetch_array($res_chk_ids)) {
|
||
|
$checkupIds[] = $rows_chk_ids["checkup_id"];
|
||
|
}
|
||
|
$checkupIdsString = implode(',', $checkupIds);
|
||
|
|
||
|
|
||
|
error_log("idds".$checkupIdsString."checkup type".$check_chk_type);
|
||
|
|
||
|
if($check_chk_type == '58'){
|
||
|
|
||
|
|
||
|
$before_id = $checkup_id;
|
||
|
|
||
|
|
||
|
if (strpos($checkupIdsString, $checkup_id) !== false) {
|
||
|
|
||
|
$idArray = explode(',', $checkupIdsString);
|
||
|
$index = array_search($checkup_id, $idArray);
|
||
|
|
||
|
if ($index !== false && $index > 0) {
|
||
|
$after_id = $idArray[$index + 1];
|
||
|
error_log("ddddddd".$after_id);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
if($check_chk_type == '59'){
|
||
|
|
||
|
$after_id = $checkup_id;
|
||
|
|
||
|
|
||
|
if (strpos($checkupIdsString, $checkup_id) !== false) {
|
||
|
|
||
|
$idArray = explode(',', $checkupIdsString);
|
||
|
$index = array_search($checkup_id, $idArray);
|
||
|
|
||
|
if ($index !== false && $index > 0) {
|
||
|
$before_id = $idArray[$index - 1];
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
error_log("after ".$after_id."before".$before_id);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$sql_employee_key = "SELECT * FROM checkup_form_key_value WHERE checkup_form_id ='" . $after_id . "'";
|
||
|
|
||
|
error_log("get_data_key:" . $sql_employee_key);
|
||
|
|
||
|
$res_data_key = mysqli_query($conn, $sql_employee_key);
|
||
|
|
||
|
while ($rows_exa_key = mysqli_fetch_array($res_data_key)) {
|
||
|
|
||
|
$dataArray_after[$rows_exa_key['checkup_form_key']] = $rows_exa_key['checkup_form_value'];
|
||
|
}
|
||
|
|
||
|
$sql_employee_key_b = "SELECT * FROM checkup_form_key_value WHERE checkup_form_id ='" . $before_id . "'";
|
||
|
|
||
|
error_log("get_data_key:" . $sql_employee_key_b);
|
||
|
|
||
|
$res_data_key_b = mysqli_query($conn, $sql_employee_key_b);
|
||
|
|
||
|
while ($rows_exa_key_b = mysqli_fetch_array($res_data_key_b)) {
|
||
|
|
||
|
$dataArray_before[$rows_exa_key_b['checkup_form_key']] = $rows_exa_key_b['checkup_form_value'];
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
?>
|
||
|
|
||
|
<table class="no-border" width="100%" cellspacing="0">
|
||
|
<tr>
|
||
|
|
||
|
<td class="no-border-td" width="20%">
|
||
|
<?php if (isset($row_company['company_logo']) && $row_company['company_logo'] != null) { ?>
|
||
|
<img src="data:<?php echo $row_company['image_type'] ?>;base64,<?php echo base64_encode($row_company['company_logo']) ?>" style="width: 100px; height: 60px; margin: 0px; padding: 0px;">
|
||
|
<?php } ?>
|
||
|
</td>
|
||
|
|
||
|
<td class="no-border-td" width="60%" align="center">
|
||
|
<div style="margin-left: 20px; margin-top: 5px; line-height: 1;">
|
||
|
<center style="font-size: 18px ; text-transform: capitalize;"><b>
|
||
|
<?php echo ($row_company['company_name']) ?>
|
||
|
<br>
|
||
|
<br> <span style="font-size: 12px;">
|
||
|
<br><?php echo ($row_company['address']) ?></span>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</b>
|
||
|
</center>
|
||
|
</div>
|
||
|
</td>
|
||
|
<!-- <td class="no-border-td" style="font-size: 12px;" width="20%" align="right">
|
||
|
<span>
|
||
|
DOM/OHC/PPL/01<br>
|
||
|
Eff. Dt. 01/01/97 <br>
|
||
|
Rev No 00
|
||
|
</span>
|
||
|
</td> -->
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th colspan="4">
|
||
|
<center>Medical Exam: For Fitness to Carry Out Cyanide Charging</center>
|
||
|
</th>
|
||
|
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td colspan="3"></td>
|
||
|
|
||
|
<td>Date :- <?php echo $date?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="3">EMPLOYEE NAME:- <?php if ($patient_name) {
|
||
|
echo $patient_name;
|
||
|
} else { ?>________________________<?php } ?></td>
|
||
|
|
||
|
<td>Time :- <?php echo $time?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Body Temp :- <u> <?php echo $dataArray_before['body_temp'] ?></u> F</td>
|
||
|
<td>Spo2 :- <u><?php echo $dataArray_before['spo2_2'] ?></u> %</td>
|
||
|
<td>B.P :- <u> <?php if ($dataArray_before['blood_pressure_7']) {
|
||
|
echo $dataArray_before['blood_pressure_7'];
|
||
|
} else { ?>___________<?php } ?></u>mm/hg</td>
|
||
|
<td>Dept: - <u><?php echo $dept_name; ?></u></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Pulse :- <u><?php if ($dataArray_before['pulse_4']) {
|
||
|
echo $dataArray_before['pulse_4'];
|
||
|
} else { ?></u> _______<?php } ?>/min</td>
|
||
|
<td>Body Wt :- <u><?php if ($dataArray_before['body_weight']) {
|
||
|
echo $dataArray_before['body_weight'];
|
||
|
} else { ?></u> _______<?php } ?>Kg</td>
|
||
|
<td colspan="2">Any Cut / Abrasion / Injury:- <u><?php if ($dataArray_before['any_cut_abrasion_injury']) {
|
||
|
echo $dataArray_before['any_cut_abrasion_injury'];
|
||
|
} else { ?></u> ___________<?php } ?></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4">General Examination :- <u><?php if ($dataArray_before['general_examination']) {
|
||
|
echo $dataArray_before['general_examination'];
|
||
|
} else { ?></u> ___________________________<?php } ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4">Remarks :- <?php echo $dataArray_before['remarks_12'] ?> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4"><?php if($fit_status == 'fit'){echo 'Fit For Cyanide Charging';}else if($fit_status == 'unfit'){echo "Unfit For Cyanide Charging";} ?> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td colspan="2" style="text-align: right;">FMO / NURSING OFFICER</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<th colspan="4">
|
||
|
<center>Medical Exam : To Assess Health Status After Cyanide Charging</center>
|
||
|
</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Body Temp :- <u> <?php echo $dataArray_after['body_temp_1'] ?></u> F</td>
|
||
|
<td>Spo2 :- <u><?php echo $dataArray_after['spo2_5'] ?></u> %</td>
|
||
|
<td>B.P :-<u> <?php if ($dataArray_after['blood_pressure_8']) {
|
||
|
echo $dataArray_after['blood_pressure_8'];
|
||
|
} else { ?>___________<?php } ?></u>mm/hg</td>
|
||
|
<td>Pulse :-<u><?php if ($dataArray_after['pulse_8']) {
|
||
|
echo $dataArray_after['pulse_8'];
|
||
|
} else { ?></u> _______<?php } ?>/min</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="2">General Examination :-<u><?php if ($dataArray_after['general_examination_1']) {
|
||
|
echo $dataArray_after['general_examination_1'];
|
||
|
} else { ?></u> ___________________________<?php } ?></td>
|
||
|
<td colspan="2">H/O Any Complaints :- <u><?php if($dataArray_after['h_o_any_complaints']){echo $dataArray_after['h_o_any_complaints'];}else{?></u> ___________<?php } ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4"> Remarks :- <?php echo $dataArray_after['remarks_11']?></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td colspan="2">Any Adverse Health Effect Seen :- <?php echo $dataArray_after['any_adverse_health_effect_seen']?></td>
|
||
|
<td colspan="2" style="text-align: right;">FMO / NURSING OFFICER</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<br><br>
|
||
|
|
||
|
<table>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th colspan="4">
|
||
|
<center>Medical Exam: For Fitness to Carry Out Cyanide Charging</center>
|
||
|
</th>
|
||
|
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td colspan="3"></td>
|
||
|
|
||
|
<td>Date :- <?php echo $date ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="3">EMPLOYEE NAME:- <?php if ($patient_name) {
|
||
|
echo $patient_name;
|
||
|
} else { ?>________________________<?php } ?></td>
|
||
|
|
||
|
<td>Time :- <?php echo $time ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Body Temp :- <u> <?php echo $dataArray_before['body_temp'] ?></u> F</td>
|
||
|
<td>Spo2 :- <u><?php echo $dataArray_before['spo2_2'] ?></u> %</td>
|
||
|
<td>B.P :- <u> <?php if ($dataArray_before['blood_pressure_7']) {
|
||
|
echo $dataArray_before['blood_pressure_7'];
|
||
|
} else { ?>___________<?php } ?></u>mm/hg</td>
|
||
|
<td>Dept: - <u><?php echo $dept_name; ?></u></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Pulse :- <u><?php if ($dataArray_before['pulse_4']) {
|
||
|
echo $dataArray_before['pulse_4'];
|
||
|
} else { ?></u> _______<?php } ?>/min</td>
|
||
|
<td>Body Wt :- <u><?php if ($dataArray_before['body_weight']) {
|
||
|
echo $dataArray_before['body_weight'];
|
||
|
} else { ?></u> _______<?php } ?>Kg</td>
|
||
|
<td colspan="2">Any Cut / Abrasion / Injury:- <u><?php if ($dataArray_before['any_cut_abrasion_injury']) {
|
||
|
echo $dataArray_before['any_cut_abrasion_injury'];
|
||
|
} else { ?></u> ___________<?php } ?></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4">General Examination :- <u><?php if ($dataArray_before['general_examination']) {
|
||
|
echo $dataArray_before['general_examination'];
|
||
|
} else { ?></u> ___________________________<?php } ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4">Remarks :- <?php echo $dataArray_before['remarks_12'] ?> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4"><?php if($fit_status == 'fit'){echo 'Fit For Cyanide Charging';}else if($fit_status == 'unfit'){echo "Unfit For Cyanide Charging";} ?> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td colspan="2" style="text-align: right;">FMO / NURSING OFFICER</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<th colspan="4">
|
||
|
<center>Medical Exam : To Assess Health Status After Cyanide Charging</center>
|
||
|
</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>Body Temp :- <u> <?php echo $dataArray_after['body_temp_1'] ?></u> F</td>
|
||
|
<td>Spo2 :- <u><?php echo $dataArray_after['spo2_5'] ?></u> %</td>
|
||
|
<td>B.P :-<u> <?php if ($dataArray_after['blood_pressure_8']) {
|
||
|
echo $dataArray_after['blood_pressure_8'];
|
||
|
} else { ?>___________<?php } ?></u>mm/hg</td>
|
||
|
<td>Pulse :-<u><?php if ($dataArray_after['pulse_8']) {
|
||
|
echo $dataArray_after['pulse_8'];
|
||
|
} else { ?></u> _______<?php } ?>/min</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="2">General Examination :-<u><?php if ($dataArray_after['general_examination_1']) {
|
||
|
echo $dataArray_after['general_examination_1'];
|
||
|
} else { ?></u> ___________________________<?php } ?></td>
|
||
|
<td colspan="2">H/O Any Complaints :- <u><?php if($dataArray_after['h_o_any_complaints']){echo $dataArray_after['h_o_any_complaints'];}else{?></u> ___________<?php } ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4"> Remarks :- <?php echo $dataArray_after['remarks_11']?></td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td colspan="2">Any Adverse Health Effect Seen :- <?php echo $dataArray_after['any_adverse_health_effect_seen']?></td>
|
||
|
<td colspan="2" style="text-align: right;">FMO / NURSING OFFICER</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<?php
|
||
|
$query = "select e.emp_sign,e.image_type from employee_signature e left join checkup_form b on e.emp_id = b.doc_attend where b.checkup_id ='" . $checkup_id . "'";
|
||
|
// error_log("Signatures :" . $query);
|
||
|
|
||
|
$result1 = mysqli_query($conn, $query);
|
||
|
|
||
|
$sign_row = mysqli_fetch_array($result1);
|
||
|
|
||
|
extract($sign_row);
|
||
|
|
||
|
?>
|
||
|
|
||
|
|
||
|
<!-- <table class="no-border" style="width: 95%;">
|
||
|
<tr>
|
||
|
<td class="no-border-td" style="width: 80%;"></td>
|
||
|
<td class="no-border-td" style="width: 20%; align-items: end;"><img id='sign' style="text-align:center; width:150px; height:80px;" class="card-img-bottm" src="data:<?= $sign_row['image_type']; ?>;base64,<?= base64_encode($sign_row['emp_sign']) ?>"><br></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table class="no-border" style="width: 100%;">
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td class="no-border-td" style="width: 50%; text-align: right;">Factory Medical Officer</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
</table> -->
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
</form>
|
||
|
|
||
|
|
||
|
<form id="employeeDetailsFormPdf" action="" method="POST">
|
||
|
|
||
|
<input type="hidden" name="htmlText" id="htmlText" />
|
||
|
|
||
|
</form>
|
||
|
</div>
|
||
|
<script>
|
||
|
formSubmit();
|
||
|
|
||
|
function formSubmit() {
|
||
|
|
||
|
$("#htmlText").val($("#opd_form").html());
|
||
|
|
||
|
document.forms['employeeDetailsFormPdf'].action = "pdf_dynamic.php";
|
||
|
|
||
|
document.forms['employeeDetailsFormPdf'].method = "post";
|
||
|
|
||
|
document.forms['employeeDetailsFormPdf'].submit();
|
||
|
|
||
|
}
|
||
|
</script>
|