$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";
$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