ESH/excel_emp_appointment_list.php
2024-10-23 18:28:06 +05:30

88 lines
3.9 KiB
PHP

<?php
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=Employee OPD and Injury List.xls');
include('includes/config/config.php');
include('includes/functions.php');
?>
<table class="col-sm-offset-5" border="1">
<?php
$sql = base64_decode($filterkey);
$result = mysqli_query($conn, $sql);
//echo $result;
?><tr>
<th>Date</th>
<th>Ticket No</th>
<th>ECode/G.Pass</th>
<th>Patient Name</th>
<th>Emergency</th>
<th>Injury</th>
<th>Doctor Consulted</th>
<th>Complaints</th>
<th>Examination Findings</th>
<th>Diagnosis</th>
<th>Treatment</th>
<th>Treatment given by</th>
<th>Referral</th>
<th>Followup</th>
<th>Vitals</th>
</tr><?php
while ($rowOfEmployeeAppointment = mysqli_fetch_array($result)) {
$diagnosis = getCommaSeperatedValuesForInClause("select ailment_name from ailment ", "ailment_id", $rowOfEmployeeAppointment['ailments_new']);
$treatment_text = getTreatmentText($rowOfEmployeeAppointment['appointment_id']);
$isEmergency = "";
$isInjury = "";
if ($appointment_type == 'I') {
$isInjury = "<span class='red'>Yes</i></span>";
} else {
$isInjury = "<span class='green'>No</i></span>";
}
if ($rowOfEmployeeAppointment['IsEmergency'] == 1) {
$isEmergency = "<span class=' lighter red'>Yes</i></span>";
} else {
$isEmergency = "<span class='green'>No</i></span>";
}
$doctor_attended_flag = "No";
if ($rowOfEmployeeAppointment['doctor_attended_flag'] == 'Y') {
$doctor_attended_flag = "<span class=' lighter red'>Yes</i></span>";
} else {
$doctor_attended_flag = "<span class='green'>No</i></span>";
}
$check_results = "SBP:" . $rowOfEmployeeAppointment['bp_sbp'] . ", DBP:" . $rowOfEmployeeAppointment['bp_dbp'] . ", FBS:" . $rowOfEmployeeAppointment['blood_sugar_fbs'] . ", RBS:" . $rowOfEmployeeAppointment['blood_sugar_rbs'] . ",Temp:" . $rowOfEmployeeAppointment['temperature'] . ",SPOC2%:" . $rowOfEmployeeAppointment['spo2_percent'];
?><tr>
<td><?php echo $rowOfEmployeeAppointment['appointment_date'] ?></td>
<td><?php echo $rowOfEmployeeAppointment['ticket_no'] ?></td>
<td><?php echo $rowOfEmployeeAppointment['emp_code'] ?></td>
<td><?php echo $rowOfEmployeeAppointment['patient_name'] ?></td>
<td><?php echo $isEmergency ?></td>
<td><?php echo $isInjury ?></td>
<td><?php echo $doctor_attended_flag ?></td>
<td><?php echo getCommaSeperatedValuesForInClause("select complaint from complaints ", "complaint_id", $rowOfEmployeeAppointment['complaints']); ?></td>
<td><?php echo getCommaSeperatedValuesForInClause("select examination_finding from examination_findings ", "id", $rowOfEmployeeAppointment['examination_remarks']) ?></td>
<td><?php echo $diagnosis ?></td>
<td><?php echo getTreatmentText($rowOfEmployeeAppointment['appointment_id']) ?></td>
<td><?php echo getTableFieldValue('patient_master','patient_name','id',$rowOfEmployeeAppointment['doctor_last_attended']);?></td>
<td><?php echo getCommaSeperatedValuesForInClause("select referral_point_name from referral_point ", "referral_point_id ", $rowOfEmployeeAppointment['referral']) ?></td>
<td><?php echo $rowOfEmployeeAppointment['followup'] ?>
<td><?php echo $check_results ?></td>
</td>
</tr>
<?php
}
?>
</table>
<?php
//include('pdf_footer.php');
?>