From 95f84a99e9a7a63eae8a8565c281e232e17c7e4c Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 17 May 2016 20:18:08 +1000 Subject: [PATCH] array modification --- booking.studygroups_report.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/booking.studygroups_report.inc b/booking.studygroups_report.inc index 4109064..7ef39bc 100644 --- a/booking.studygroups_report.inc +++ b/booking.studygroups_report.inc @@ -14,6 +14,7 @@ function booking_studygroups_csv_report($group_id) { } //set options for the CSV file + /* $name = 'bookings-studygroup-' . $group_id . '-' . format_date(time(), 'custom', 'Y-m-d-His'); $filename = file_directory_temp() . '/' . $name; $csv = ''; @@ -23,6 +24,7 @@ function booking_studygroups_csv_report($group_id) { $nullToMysqlNull = true; $delimiter_esc = preg_quote($delimiter, '/'); $enclosure_esc = preg_quote($enclosure, '/'); + */ $header_array = array(); $data_array = array(); @@ -61,7 +63,7 @@ function booking_studygroups_csv_report($group_id) { //calculate the row data foreach ($session_members as $member) { if (! isset($data_array[$member->booking_session_id])) { - $data_array[$member->booking_session_id] = new stdClass(); + $data_array[$member->booking_session_id] = array(); } // @todo // lookup the actual name and put this instead of just the node id @@ -70,7 +72,9 @@ function booking_studygroups_csv_report($group_id) { } $out = fopen('php://output', 'w'); - fputcsv2 ($out, $data_array); + foreach ($data_array as $fields) { + fputcsv2 ($out, $fields); + } fclose($out); }