From d304c60e61f3b89bdf86b5d7d5e59fd0c7d5f2f6 Mon Sep 17 00:00:00 2001 From: chriskl Date: Thu, 21 Aug 2003 04:49:36 +0000 Subject: [PATCH] add HTML export option --- HISTORY | 1 + tblexport.php | 31 ++++++++++++++++++++++++++++++- tblproperties.php | 3 ++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 244db949..faed154d 100644 --- a/HISTORY +++ b/HISTORY @@ -31,6 +31,7 @@ Features: tag names, outputs column type information, and is in correct XML format! * 'Save as Report' feature when viewing record sets * Tick all box on Select feature +* Export in HTML format Bug Fixes: * Lots of NULL value in table dump fixes (XML format changed slightly) diff --git a/tblexport.php b/tblexport.php index a5e495eb..d7729ec0 100644 --- a/tblexport.php +++ b/tblexport.php @@ -3,7 +3,7 @@ /** * Does an export to the screen or as a download * - * $Id: tblexport.php,v 1.10 2003/08/18 07:28:15 chriskl Exp $ + * $Id: tblexport.php,v 1.11 2003/08/21 04:49:36 chriskl Exp $ */ $extensions = array( @@ -11,6 +11,7 @@ 'copy' => 'sql', 'csv' => 'csv', 'tab' => 'txt', + 'html' => 'html', 'xml' => 'xml' ); @@ -97,6 +98,34 @@ } echo "\n"; } + elseif ($_REQUEST['format'] == 'html') { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\t\n\t\t"; + if (!$rs->EOF) { + // Output header row + $j = 0; + foreach ($rs->f as $k => $v) { + if ($k == $localData->id && !isset($_REQUEST['oids'])) continue; + echo ""; + } + } + echo "\n\t\n"; + while (!$rs->EOF) { + echo "\t\n\t\t"; + foreach ($rs->f as $k => $v) { + if ($k == $localData->id && !isset($_REQUEST['oids'])) continue; + $finfo = $rs->fetchField($j++); + echo ""; + } + echo "\n\t\n"; + $rs->moveNext(); + } + echo "
", $misc->printVal($k, true), "
", $misc->printVal($v, true, $finfo->type), "
\n"; + echo "\n"; + echo "\n"; + } elseif ($_REQUEST['format'] == 'sql') { $data->fieldClean($_REQUEST['table']); while (!$rs->EOF) { diff --git a/tblproperties.php b/tblproperties.php index e094fa9e..92f01390 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tblproperties.php,v 1.21 2003/08/18 08:06:19 chriskl Exp $ + * $Id: tblproperties.php,v 1.22 2003/08/21 04:49:36 chriskl Exp $ */ // Include application functions @@ -101,6 +101,7 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo ""; echo "OIDS:"; -- 2.39.5