0){$query="SELECT COUNT(appointment_id) , date(appointment_date) FROM employee_appointment WHERE month(appointment_date) = '".$month."' and year(appointment_date) = year(now()) AND appointment_type='O' "; $query2="SELECT COUNT(appointment_id) , date(appointment_date) FROM employee_appointment WHERE month(appointment_date) = '".$month."' and year(appointment_date) = year(now()) AND appointment_type='O' and ailment_systems_new='1'"; $query3="SELECT COUNT(e.appointment_id) , date(e.appointment_date) FROM employee_appointment e left join patient_master p on e.emp_id=p.id WHERE month(e.appointment_date) = '".$month."' and year(e.appointment_date) = year(now()) AND e.appointment_type='O' and p.designation_id='38'";} else { $month= 12+$month; $query="SELECT COUNT(appointment_id) , date(now()- INTERVAL $i month) FROM employee_appointment WHERE month(appointment_date) = '".$month."' and year(appointment_date) = year(now())-1 AND appointment_type='O' "; $query2="SELECT COUNT(appointment_id) , date(now()- INTERVAL $i month) FROM employee_appointment WHERE month(appointment_date) = '".$month."' and year(appointment_date) = year(now())-1 AND appointment_type='O' and ailment_systems_new='1' "; $query3="SELECT COUNT(e.appointment_id) , date(now()- INTERVAL $i month) FROM employee_appointment e left join patient_master p on e.emp_id=p.id WHERE month(e.appointment_date) = '".$month."' and year(e.appointment_date) = year(now())-1 AND e.appointment_type='O' and p.designation_id='38' "; } error_log('mmxx'.$query) ; if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result) > 0) { while ($row = @mysqli_fetch_array($result)) { $newDate = date("M-Y", strtotime($row[1])); array_push($xaxis,$newDate); array_push($opd,$row[0]); } } if (!$result2 = @mysqli_query($conn,$query2)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result2) > 0) { while ($row2 = @mysqli_fetch_array($result2)) { $newDate = date("M-Y", strtotime($row2[1])); error_log('mm'.$newDate) ; array_push($xaxis2,$newDate); array_push($opd2,$row2[0]); } } if (!$result3 = @mysqli_query($conn,$query3)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result3) > 0) { while ($row3 = @mysqli_fetch_array($result3)) { $newDate = date("M-Y", strtotime($row3[1])); error_log('mm'.$newDate) ; array_push($xaxis3,$newDate); array_push($opd3,$row3[0]); } } } ?>