$query="select count(*) as count from employee_appointment where date(appointment_date) between STR_TO_DATE('".$start."', '%d-%m-%Y') AND STR_TO_DATE('".$end."', '%d-%m-%Y') and ohc_type_id='".$ohc_id."' and appointment_type='O'";
error_log("query to count employee in opd".$query);
if($result=mysqli_query($conn,$query)){
$row=mysqli_fetch_assoc($result);
$opd_count=$row['count'];
}
$query_inj="select count(*) as count from employee_appointment where date(appointment_date) between STR_TO_DATE('".$start."', '%d-%m-%Y') AND STR_TO_DATE('".$end."', '%d-%m-%Y') and ohc_type_id='".$ohc_id."' and appointment_type='I'";
error_log("query to count employee in opd".$query_inj);
if($result_inj=mysqli_query($conn,$query_inj)){
$row_inj=mysqli_fetch_assoc($result_inj);
$inj_count=$row_inj['count'];
}
$data=[];
$medical_name=[];
$checkup="select * from checkup_type where type_status='Active' and type_state='No'";
$checkup_count="select count(*) as count from checkup_form where date(checkup_date) between STR_TO_DATE('".$start."', '%d-%m-%Y') AND STR_TO_DATE('".$end."', '%d-%m-%Y') and checkup_type_id = '".$row_checkup['checkup_type_id']."' and ohc_type_id='".$ohc_id."'";