From 3a466ad7fc6a95ff44344ed808885967cd1e6ee3 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 8 Jun 2010 17:57:52 -0300 Subject: Debugging csv test script --- tests/csv.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/csv.php b/tests/csv.php index 52c5fd5..c48118b 100644 --- a/tests/csv.php +++ b/tests/csv.php @@ -1,6 +1,9 @@ db) { $format = $isis->db->format; // Prepare output. + /* header("Content-type: application/text/x-csv"); header("Content-Disposition: attachment; filename=export.csv"); header("Pragma: no-cache"); header("Expires: 0"); + */ // Format fields. foreach ($format['fields'] as $field) { @@ -60,7 +65,7 @@ if ($isis->db) { echo "\n"; // Format output. - for ($n=1; $n <= $rows; $n++) { + for ($n=1; $n <= 30; $n++) { $result = $isis->db->read($n); if ($result) { @@ -76,7 +81,16 @@ if ($isis->db) { } if (is_array($field['subfields'])) { foreach ($field['subfields'] as $key => $value) { - echo csv($result[$field['name']][$value]); + if (isset($result[$field['name']][0][$value])) { + $cel = ''; + foreach ($result[$field['name']] as $subkey => $subvalue) { + $cel = $cel . $result[$field['name']][$subkey][$value] .'; '; + } + echo csv($cel); + } + else { + echo csv($result[$field['name']][$value]); + } } } } -- cgit v1.2.3