ohctech_p8/chronic_illness_list_excel.php

127 lines
4.9 KiB
PHP
Raw Normal View History

2024-10-16 19:18:52 +05:30
<?php //include('pdf_header.php');
include('includes/config/config.php');
include('includes/functions.php');
//include('pop_up_top.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=chronic_illness_list_excel.xls');
?>
<body>
<?php include('excel_ohc_header.php') ?>
<table width="100%">
<tr>
<div style="font-size:12px">
<td width="25%" align="left" style="font-size:12px"> Run Date :
<?php echo date("d-M-Y"); ?>
</td>
<td width="50%" align="center" style="font-size:15px"><strong>Chronic Medication List</strong></td>
<td width="25%" align="left" style="font-size:12px"> User :
<?php echo $username ?>
</td>
</tr>
</table>
<table border="1">
<?php
$sql = base64_decode($filterkey);
//echo $sql;
$result = mysqli_query($conn, $sql);
?>
<tr>
<th width="3%">Sr</th>
<th width="15%">Chronic Illness</th>
<th width="15%">Patient Name</th>
<th width="8%">Emp Code</th>
<th width="8%">Status</th>
<th width="5%">OHC</th>
<th width="10%">Diagnosis Date</th>
<th width="10%">Remission Date</th>
<th width="10%">Remark</th>
<th width="10%">Medicine</th>
<th width="10%">Other Med</th>
<th width="5%">Frequency</th>
<th width="5%">Timing</th>
<th width="5%">Route</th>
<th width="6%">Duration</th>
</tr>
<?php
$count = 1;
while ($rowOfEmployee = mysqli_fetch_array($result)) {
if ($rowOfEmployee['diagnosis_date'] != null && $rowOfEmployee['diagnosis_date'] != '' && $rowOfEmployee['diagnosis_date'] != '1970-01-01' && $rowOfEmployee['diagnosis_date'] != '0000-00-00') {
$date = DateTime::createFromFormat('Y-m-d', $rowOfEmployee['diagnosis_date']);
// Format the date in "d/m/Y" format
$newDateFormat = $date->format('d/m/Y');
$diagnosis_date = $newDateFormat;
} else {
$diagnosis_date = "Not Present";
}
if ($rowOfEmployee['remission_date'] != null && $rowOfEmployee['remission_date'] != '' && $rowOfEmployee['remission_date'] != '1970-01-01' && $rowOfEmployee['remission_date'] != '0000-00-00') {
$date = DateTime::createFromFormat('Y-m-d', $rowOfEmployee['remission_date']);
// Format the date in "d/m/Y" format
$newDateFormat = $date->format('d/m/Y');
$remission_date = $newDateFormat;
} else {
$remission_date = "Not Present";
}
?>
<tr>
<td>
<?php echo $count ?>
</td>
<td>
<?php echo getTableFieldValue('abnormality', 'abnormality_name', 'abnormality_id', $rowOfEmployee['diseases']) ?>
</td>
<td>
<?php echo getTableFieldValue('patient_master', 'patient_name', 'id', $rowOfEmployee['emp_id']) ?>
</td>
<td>
<?php echo getTableFieldValue('patient_master', 'emp_code', 'id', $rowOfEmployee['emp_id']) ?>
</td>
<td>
<?php echo $rowOfEmployee['status']; ?>
</td>
<td>
<?php echo getTableFieldValue('ohc_type', 'ohc_type_name', 'ohc_type_id', $rowOfEmployee['ohc_type_id']) ?>
</td>
<td>
<?php echo $diagnosis_date; ?>
</td>
<td>
<?php echo $remission_date; ?>
</td>
<td>
<?php echo $rowOfEmployee['remark']; ?>
</td>
<td>
<?php echo getTableFieldValue('tbl_items', 'item_name', 'item_id', $rowOfEmployee['medicine_name']) ?>
</td>
<td>
<?php echo $rowOfEmployee['other_med'] ?>
</td>
<td>
<?php echo getTableFieldValue('medicine_frequency', 'medicine_frequency', 'frequency_id', $rowOfEmployee['medicine_frequency']) ?>
</td>
<td>
<?php echo getTableFieldValue('medicine_timings', 'medicine_timing', 'timing_id', $rowOfEmployee['medicine_timing']) ?>
</td>
<td>
<?php echo getTableFieldValue('dosage_category', 'dosage_category', 'dosage_category_id', $rowOfEmployee['admin_route']) ?>
</td>
<td>
<?php echo $rowOfEmployee['duration'] ?>
</td>
</tr>
<?php
$count++;
}
?>
</table>
</body>