Diagnosis Wise Opd Report
From:    To:
$ailment) { if ($ailment == 'ALL') { $sql = "SELECT count(*) as total FROM employee_appointment a JOIN view_patient_master b on a.emp_id=b.id WHERE a.ohc_type_id='" . $ohc_id . "' and a.ailments_new!='' and date(a.appointment_date) BETWEEN '$from_date' and '$to_date'"; } else { $sql = "SELECT count(*) as total FROM employee_appointment a JOIN view_patient_master b on a.emp_id=b.id WHERE a.ohc_type_id='" . $ohc_id . "' and (a.ailments_new LIKE '%,$ailment,%' or a.ailments_new LIKE '%$ailment,%' or a.ailments_new LIKE '%,$ailment%' or a.ailments_new LIKE '%$ailment%' or a.ailments_new = '" . $ailment . "') and date(a.appointment_date) BETWEEN '$from_date' and '$to_date'"; } $result_sql = mysqli_query($conn, $sql); $num_rows = mysqli_num_rows($result_sql); $row0 = mysqli_fetch_assoc($result_sql); error_log("total sql :" . $sql); if ($ailment == 'ALL') { $sql_data = "SELECT DATE_FORMAT(a.appointment_date, '%d-%m-%y') as date, a.*,b.* FROM employee_appointment a JOIN view_patient_master b on a.emp_id=b.id WHERE a.ohc_type_id='" . $ohc_id . "' and a.ailments_new!='' and date(a.appointment_date) BETWEEN '$from_date' and '$to_date'"; } else { $sql_data = "SELECT DATE_FORMAT(a.appointment_date, '%d-%m-%y') as date, a.*,b.* FROM employee_appointment a JOIN view_patient_master b on a.emp_id=b.id WHERE a.ohc_type_id='" . $ohc_id . "' and (a.ailments_new LIKE '%,$ailment,%' or a.ailments_new LIKE '%$ailment,%' or a.ailments_new LIKE '%,$ailment%' or a.ailments_new LIKE '%$ailment%' or a.ailments_new = '" . $ailment . "') and date(a.appointment_date) BETWEEN '$from_date' and '$to_date'"; } error_log("record sql " . $sql_data); $result_data = mysqli_query($conn, $sql_data); ?>
Sr. Date Time In Time Out Emp. Code Name Age Sex Mobile No. Plant Employer Designation Department Section Complaint Diagnosis Treatment
diff($to)->y; ?>
TOTAL: