diff options
author | Silvio <silvio@devlet.com.br> | 2010-06-08 17:57:52 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-06-08 17:57:52 -0300 |
commit | 3a466ad7fc6a95ff44344ed808885967cd1e6ee3 (patch) | |
tree | 66f0112c5373e52194a38bdb81885a42798c17f9 | |
parent | ae73a1735df1a9ba3753073fe3201a7ec7604edb (diff) | |
download | cinisis-3a466ad7fc6a95ff44344ed808885967cd1e6ee3.tar.gz cinisis-3a466ad7fc6a95ff44344ed808885967cd1e6ee3.tar.bz2 |
Debugging csv test script
-rw-r--r-- | tests/csv.php | 18 |
1 files changed, 16 insertions, 2 deletions
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 @@ <?php /** * Cinisis - Isis db reading tool. + * + * @fixme: script is broken after BiblioIsis repetition support + * was enhanced. */ /** @@ -41,10 +44,12 @@ if ($isis->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]); + } } } } |