=0; $i--){ $query="SELECT count(a.appointment_id) as count_mf,DATE(NOW()-INTERVAL $i DAY) from employee_appointment a where DATE(a.appointment_date) = date(NOW()-INTERVAL $i DAY) and shift_type = 'A'"; // echo $query; error_log("SHIFT A ::" .$query); if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result) > 0) { while ($row = @mysqli_fetch_array($result)) { array_push($xaxis,$row[1]); array_push($a_shift,$row[0]); } } else { echo '0'; } } for($i=$no_of_days; $i>=0; $i--){ $query="SELECT count(a.appointment_id) as count_mf from employee_appointment a where DATE(a.appointment_date) = date(NOW()-INTERVAL $i DAY) and shift_type = 'B'"; // echo $query; if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result) > 0) { while ($row = @mysqli_fetch_array($result)) { array_push($b_shift,$row[0]); } } else { echo '0'; } } for($i=$no_of_days; $i>=0; $i--){ $query="SELECT count(a.appointment_id) as count_mf from employee_appointment a where DATE(a.appointment_date) = date(NOW()-INTERVAL $i DAY) and shift_type = 'C'"; if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result) > 0) { while ($row = @mysqli_fetch_array($result)) { array_push($c_shift,$row[0]); } } else { echo '0'; } } for($i=$no_of_days; $i>=0; $i--){ $query="SELECT count(a.appointment_id) as count_mf from employee_appointment a where DATE(a.appointment_date) = date(NOW()-INTERVAL $i DAY) and shift_type = 'G'"; if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } if(mysqli_num_rows($result) > 0) { while ($row = @mysqli_fetch_array($result)) { array_push($g_shift,$row[0]); } } else { echo '0'; } } // print_r($xaxis); // print_r($injury); // print_r($sickness); ?>