diff --git a/interface/custom/attendance/attendance_report.php b/interface/custom/attendance/attendance_report.php index 6d22b19..34fa59a 100644 --- a/interface/custom/attendance/attendance_report.php +++ b/interface/custom/attendance/attendance_report.php @@ -30,8 +30,18 @@ $attendance = new Attendance(); $currentDate = new DateTime(); $lastSixMonths = $currentDate->sub(new DateInterval('P6M')); -$attendance->from_date = (isset($_POST['form_from_date'])) ? DateToYYYYMMDD($_POST['form_from_date']) : $lastSixMonths->format('Y-m-d'); -$attendance->to_date = (isset($_POST['form_to_date'])) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d'); +if (isset($_POST['form_from_date'])) { + $attendance->from_date = date("Y-m-d", strtotime($_POST['form_from_date'])); +} else { + $dt = date_create(date('Y-m-d')); + date_sub($dt, date_interval_create_from_date_string("180 days")); + $attendance->from_date = date_format($dt, "Y-m-d"); +} +if (isset($_POST['form_to_date'])) { + $attendance->to_date = date("Y-m-d", strtotime($_POST['form_to_date'])); +} else { + $attendance->to_date = date('Y-m-d'); +} $attendance->level = (isset($_POST['form_level'])) ? $_POST['form_level'] : 1; // SQL Query @@ -72,7 +82,9 @@ if (!empty($_POST)) {
- This report shows scofflaws. + Attendance report shows a listing of patients who have either cancelled less than 24 hours or did not + show for an appointment. The total column is the total number of missed appointments during the selected + period. Click on the Patient ID to see a detailed listing of the missed appointments.