X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Freport.php;h=5ed0fae69aba30974005c206cb060df333faf324;hb=refs%2Ftags%2F2022-10-31;hp=999bbc50c4e3c78aa73c1255d6fc421b4b91acf0;hpb=f720a723a18a95cede2cdd22cc3199a39232059f;p=readifood.git diff --git a/lib/report.php b/lib/report.php index 999bbc5..5ed0fae 100644 --- a/lib/report.php +++ b/lib/report.php @@ -37,29 +37,6 @@ end_form(); } - function check_report_dates($from, $to) { - list($y, $m, $d) = explode('-', $from); - if (! checkdate($m, $d, $y)) { - echo "
Invalid report start date!
\n"; - return false; - } - $start = mktime(0, 0, 0, $m, $d, $y); - - list($y, $m, $d) = explode('-', $to); - if (! checkdate($m, $d, $y)) { - echo "Invalid report end date!
\n"; - return false; - } - $end = mktime(0, 0, 0, $m, $d, $y); - - if ($end < $start) { - echo "Report end date is earlier than start date!
\n"; - return false; - } - - return true; - } - function show_order_report($from, &$order_state_ids) { echo "%d | %s | \n", $row->getCount(), htmlspecialchars($parcel_sizes[$row->getSize() >> 1])); + if ($row->getSize() > 1) { + echo "
%d | individuals%s | \n", $count, $row->getSize() > 2 ? ' (estimated)' : ''); + echo "
$total | Total individuals (estimated) | \n"; + echo "
Showing reports for the period $from to $to.
\n"; @@ -249,6 +257,7 @@ show_order_report($from, $order_state_ids); show_postcode_report($order_ids); show_parcel_report($order_ids); + show_beneficiary_report($order_ids); show_requester_report($order_ids); }