123 lines
4.1 KiB
PHP
123 lines
4.1 KiB
PHP
|
<?php
|
||
|
// include('pdf_header.php');
|
||
|
include ('includes/config/config.php');
|
||
|
include ('includes/functions.php');
|
||
|
header('Content-Type: application/force-download');
|
||
|
header('Content-disposition: attachment; filename=excel_covid_spo2_severity.xls');
|
||
|
?>
|
||
|
<body>
|
||
|
<table border="1" width="100%">
|
||
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
error_reporting(E_ERROR | E_PARSE);
|
||
|
$ohc_location = $_REQUEST['ohc_location'];
|
||
|
$patient_category = $_REQUEST['patient_category'];
|
||
|
$dept = $_REQUEST['dept'];
|
||
|
$emp_designation = $_REQUEST['emp_designation'];
|
||
|
$emp_cadre = $_REQUEST['emp_cadre'];
|
||
|
$employer_contractor = $_REQUEST['employer_contractor'];
|
||
|
$gender = $_REQUEST['gender'];
|
||
|
|
||
|
|
||
|
$start_date = $_REQUEST['startDate'];
|
||
|
$end_date= $_REQUEST['endDate'];
|
||
|
|
||
|
|
||
|
|
||
|
$qry_bu ="";
|
||
|
$qry_date="";
|
||
|
|
||
|
if(isset($ohc_location) && $ohc_location!=''){
|
||
|
$qry_bu.=" and b.ohc_type_id ='".$ohc_location."' ";
|
||
|
}
|
||
|
|
||
|
|
||
|
if(isset($patient_category) && $patient_category!=''){
|
||
|
$qry_bu.=" and b.emp_cat_id ='".$patient_category."' ";
|
||
|
}
|
||
|
|
||
|
if(isset($dept) && $dept!=''){
|
||
|
$qry_bu.=" and b.dept_id ='".$dept."' ";
|
||
|
}
|
||
|
|
||
|
if(isset($emp_designation) && $emp_designation!=''){
|
||
|
$qry_bu.=" and b.designation_id ='".$emp_designation."' ";
|
||
|
}
|
||
|
|
||
|
if(isset($emp_cadre) && $emp_cadre!=''){
|
||
|
$qry_bu.=" and b.emp_cadre ='".$emp_cadre."' ";
|
||
|
}
|
||
|
|
||
|
if(isset($employer_contractor) && $employer_contractor!=''){
|
||
|
$qry_bu.=" and b.employer_contractor_id ='".$employer_contractor."' ";
|
||
|
}
|
||
|
|
||
|
if(isset($gender) && $gender!=''){
|
||
|
$qry_bu.=" and b.gender ='".$gender."' ";
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if(isset($start_date) && $start_date!=''){
|
||
|
//$qry_date.=" and b.checkup_date >='".$start_date."' ";
|
||
|
$qry_date.=" and b.medical_entry_date >=str_to_date('".$start_date."','%d-%m-%Y') ";
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
if(isset($end_date) && $end_date!=''){
|
||
|
//$qry_date.=" and checkup_date <='".$end_date."' ";
|
||
|
$qry_date.=" and medical_entry_date <=str_to_date('".$end_date."','%d-%m-%Y') ";
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$query="SELECT patient_master.patient_name from medical_examination INNER JOIN patient_master ON medical_examination.patient_id = patient_master.id where bp>130 and patient_id in ($query1) $qry_date";
|
||
|
// echo $query;
|
||
|
$result = @mysqli_query($conn,$query);
|
||
|
|
||
|
|
||
|
?>
|
||
|
|
||
|
<tr>
|
||
|
<div style="font-size: 12px">
|
||
|
<td width="25%" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
|
||
|
<td width="50%" align="center"><strong>Covid SPO2 Severity</strong></td>
|
||
|
<td align="left"> User : <?php echo $username ?></td>
|
||
|
|
||
|
</tr>
|
||
|
<?php
|
||
|
$sql="select count(a.id) as total, a.spo2_basis from covid_monitoring a left join patient_master b on a.emp_id = b.id left join covid_patient_staying c on a.staying_id = c.id left join covid_test_result_master d on a.covid_test_result_id = d.id left join covid_contact_type_master e on a.covid_contact_id = e.id left join department f on b.dept_id = f.dept_id where a.emp_id = b.id $qry_bu group BY a.spo2_basis ";
|
||
|
//echo $sql;
|
||
|
$total_query="SELECT count(*) as total_active from covid_monitoring where id in (select a.id from covid_monitoring a left join patient_master b on a.emp_id = b.id left join covid_patient_staying c on a.staying_id = c.id left join covid_test_result_master d on a.covid_test_result_id = d.id left join covid_contact_type_master e on a.covid_contact_id = e.id left join department f on b.dept_id = f.dept_id where a.emp_id = b.id $qry_bu group BY a.spo2_basis )";
|
||
|
//echo $query;
|
||
|
$result = @mysqli_query($conn,$sql);
|
||
|
//echo $result;
|
||
|
|
||
|
?><tr><th>SPO2 Severity</th><th>No. of Patient</th><th>%</th></tr><?php
|
||
|
while($rowOfEmployee=@mysqli_fetch_array($result)){
|
||
|
if (!$result_result = @mysqli_query($conn,$total_query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
|
||
|
if(mysqli_num_rows($result_result) > 0) {
|
||
|
if ($row = @mysqli_fetch_assoc($result_result)) {
|
||
|
|
||
|
$percentage=($rowOfEmployee['total']/$row['total_active'])*100;
|
||
|
?><tr><td><?php echo $rowOfEmployee['spo2_basis']?></td><td><?php echo $rowOfEmployee['total']?></td><td><?php echo number_format($percentage, 2)?>%</td></tr><?php
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
?>
|
||
|
<tr><td>Total</td><td><?php echo $row['total_active']?></td><td><?php echo number_format(100, 2)?>%</td></tr>
|
||
|
|
||
|
</table>
|
||
|
</body>
|