From e255137bf90f88bda83cc07d641043f5f6f68fc4 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 19 Oct 2013 12:00:23 +1100 Subject: [PATCH] Included processed date in csv report --- booking.reports.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/booking.reports.inc b/booking.reports.inc index 1844f31..17e123d 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -372,6 +372,9 @@ function booking_csv_report() { if (in_array($key, $fields_to_skip)) continue; $header_array[] = $key; + //add in a special column for a processed version of the date of birth + if (strcmp($key,"booking_dob") == 0) + $header_array[] = "booking_dob_processed"; } $header = implode( $delimiter, $header_array ); @@ -396,10 +399,15 @@ function booking_csv_report() { } //handle dates - if ($key == 'booking_dob' || $key == 'booking_passport_expiry_date') { + if ($key == 'booking_dob') { $output[] = format_date($value, 'custom', 'd/m/Y'); + $output[] = '"' . _booking_avg_age($value, 1, $event->booking_event_start) . '"'; continue; } + if ($key == 'booking_passport_expiry_date') { + $output[] = format_date($value, 'custom', 'd/m/Y'); + continue; + } //handle more exact dates if ($key == 'booking_timestamp') {