Chronic Medication Medicine Report
From Date:    To Date:

$chronic_illness ){ if ($chronic_illness == 'ALL') { $query = "SELECT distinct(p.emp_id) as emp FROM `prescription_master` p left join view_patient_master v on p.emp_id=v.id where v.status='Active' and p.remission_date is null and p.medicine_name is not null and p.medicine_name!='' and p.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' "; } else { $query = "SELECT distinct(p.emp_id) as emp FROM `prescription_master` p left join view_patient_master v on p.emp_id=v.id where v.status='Active' and p.diseases = '".$chronic_illness."' and p.remission_date is null and p.medicine_name is not null and p.medicine_name!='' and p.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' "; } $result_query = mysqli_query($conn, $query); while ($row_query = mysqli_fetch_assoc($result_query)) { extract($row_query); if(!in_array($row_query["emp"],$chronic_patient_arr)){ array_push($chronic_patient_arr,$row_query["emp"]); $sql = "SELECT DATE_FORMAT(a.appointment_date, '%d-%m-%y') as date,a.*,b.* FROM employee_appointment a JOIN patient_master b on a.emp_id=b.id WHERE a.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' and a.appointment_date BETWEEN STR_TO_DATE('$from_date1','%Y-%m-%d') and STR_TO_DATE('$from_date2','%Y-%m-%d') and emp_id='".$row_query["emp"]."' and chronic_day >0 order by a.appointment_date ASC"; $result = mysqli_query($conn, $sql); while ($row1 = mysqli_fetch_assoc($result)) { if(!in_array($row1['appointment_id'],$app_ids)){ array_push($app_ids,$row1['appointment_id']); ?>
Sr. Date Time In Time Out Duration Emp. No. Name Age Sex Mobile No. Employer Designation Division Department Section Chronic Illness Chronic Medication Day Diagnosis Treatment Referred By
diff($to)->y; ?>