more debugs
This commit is contained in:
@@ -148,7 +148,10 @@ function booking_earlyaccess_csv_report() {
|
|||||||
->orderBy('cid');
|
->orderBy('cid');
|
||||||
$result = $codelist_query->execute();
|
$result = $codelist_query->execute();
|
||||||
|
|
||||||
foreach (reset($result) as $record) {
|
$firstresult = reset($result);
|
||||||
|
watchdog('booking', "CSV firstresult: @info", array('@info' => var_export($firstresult, TRUE)));
|
||||||
|
foreach ($firstresult as $record) {
|
||||||
|
watchdog('booking', "CSV first record for header: @info", array('@info' => var_export($record, TRUE)));
|
||||||
foreach ($record as $key => $value) {
|
foreach ($record as $key => $value) {
|
||||||
$header_array[] = $key;
|
$header_array[] = $key;
|
||||||
}
|
}
|
||||||
@@ -159,6 +162,8 @@ function booking_earlyaccess_csv_report() {
|
|||||||
$header = implode($delimiter, $header_array);
|
$header = implode($delimiter, $header_array);
|
||||||
$csv .= $header . "\n";
|
$csv .= $header . "\n";
|
||||||
|
|
||||||
|
watchdog('booking', "CSV before: @info", array('@info' => var_export($csv, TRUE)));
|
||||||
|
|
||||||
//add the records
|
//add the records
|
||||||
foreach ($result as $record) {
|
foreach ($result as $record) {
|
||||||
$output = array();
|
$output = array();
|
||||||
@@ -176,6 +181,8 @@ function booking_earlyaccess_csv_report() {
|
|||||||
$csv .= $row;
|
$csv .= $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watchdog('booking', "CSV after: @info", array('@info' => var_export($csv, TRUE)));
|
||||||
|
|
||||||
//output the CSV to the browser
|
//output the CSV to the browser
|
||||||
drupal_add_http_header("Content-type", "application/octet-stream; charset=utf-8");
|
drupal_add_http_header("Content-type", "application/octet-stream; charset=utf-8");
|
||||||
drupal_add_http_header("Content-Disposition", "attachment; filename=" . $name . ".csv");
|
drupal_add_http_header("Content-Disposition", "attachment; filename=" . $name . ".csv");
|
||||||
|
Reference in New Issue
Block a user