68 lines
3.1 KiB
PHP
68 lines
3.1 KiB
PHP
<?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');
|
|
?>
|
|
|
|
<table border="1">
|
|
<?php
|
|
$sql = base64_decode($filterkey);
|
|
//echo $sql;
|
|
$result = mysqli_query($conn, $sql);
|
|
?><tr>
|
|
<th width=25%>Sr </th>
|
|
<th width=25%>Chronic Illness</th>
|
|
<th width=25%>Patient Name</th>
|
|
<th width="25%">Emp Code</th>
|
|
<th width="25%">Diagnosis Date</th>
|
|
<th width=25%>Medicine</th>
|
|
<th width=25%>Frequency</th>
|
|
<th width=25%>Timing</th>
|
|
<th width=25%>Admin.route</th>
|
|
<th width=25%>Duration</th>
|
|
|
|
</tr><?php
|
|
$count = 1;
|
|
while ($rowOfEmployee = mysqli_fetch_array($result)) {
|
|
|
|
$exist_sql = "select b.diagnosis_date from problem_response a inner join problem_response_details b on a.rid = b.rid where a.pid=(select pid from problem_master where pcode='ABT') and a.patient_id = '" . $rowOfEmployee['emp_id'] . "' and b.rvalue = '" . $rowOfEmployee['diseases'] . "'";
|
|
|
|
error_log("problem response checking sql " . $exist_sql);
|
|
|
|
$result_sql = mysqli_query($conn, $exist_sql);
|
|
|
|
$row_res = mysqli_fetch_assoc($result_sql);
|
|
|
|
if ($row_res['diagnosis_date'] != null && $row_res['diagnosis_date'] != '' && $row_res['diagnosis_date'] != '1970-01-01' && $row_res['diagnosis_date'] != '0000-00-00') {
|
|
|
|
$date = DateTime::createFromFormat('Y-m-d', $row_res['diagnosis_date']);
|
|
// Format the date in "d/m/Y" format
|
|
$newDateFormat = $date->format('d/m/Y');
|
|
$diagnosis_date = $newDateFormat;
|
|
} else {
|
|
$diagnosis_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 $diagnosis_date ?></td>
|
|
<td><?php echo getTableFieldValue('tbl_items', 'item_name', 'item_id', $rowOfEmployee['medicine_name']) ?></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>
|