add save as report to some result pages
authorchriskl <chriskl>
Mon, 18 Aug 2003 08:10:16 +0000 (08:10 +0000)
committerchriskl <chriskl>
Mon, 18 Aug 2003 08:10:16 +0000 (08:10 +0000)
HISTORY
classes/database/BaseDB.php
display.php

diff --git a/HISTORY b/HISTORY
index 85cbb938bb3d261ad8afba78e6bc611c8aaa35fa..335b3b4bb6e36291000f6a13baf0e1f9e390371f 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -29,6 +29,7 @@ Features:
 * View and edit table comments
 * Changed XML format significantly.  Now doesn't use field names as
   tag names, outputs column type information, and is in correct XML format!
+* 'Save as Report' feature when viewing record sets
 
 Bug Fixes:
 * Lots of NULL value in table dump fixes (XML format changed slightly)
index 2a3da92187841288597ef121203d0134943b0b0d..c86e6f8fca02803f16b07a0ae2de9817fc345a03 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: BaseDB.php,v 1.24 2003/08/12 08:18:54 chriskl Exp $
+ * $Id: BaseDB.php,v 1.25 2003/08/18 08:10:16 chriskl Exp $
  */
 
 include_once('classes/database/ADODB_base.php');
@@ -123,7 +123,12 @@ class BaseDB extends ADODB_base {
        function getSelectSQL($table, $show, $values, $nulls, $orderby = array()) {
                $this->fieldClean($table);
 
-               $sql = "SELECT \"" . join('","', $show) . "\" FROM \"{$table}\"";
+               $sql = "SELECT \"" . join('","', $show) . "\" FROM ";
+               if ($this->hasSchemas()) {
+                       $this->fieldClean($_REQUEST['schema']);
+                       $sql .= "\"{$_REQUEST['schema']}\".";
+               }
+               $sql .= "\"{$table}\"";
 
                // If we have values specified, add them to the WHERE clause
                $first = true;
index cec600b3de565948d580c9176324b4f64a39a662..c3c9f9f2f38927fbd549112512da425f2124bbdd 100644 (file)
@@ -9,7 +9,7 @@
         * @param $return_desc The return link name
         * @param $page The current page
         *
-        * $Id: display.php,v 1.21 2003/08/05 06:04:36 chriskl Exp $
+        * $Id: display.php,v 1.22 2003/08/18 08:10:16 chriskl Exp $
         */
 
        // Include application functions
@@ -72,7 +72,9 @@
        }
        else echo "<p>{$lang['strnodata']}</p>\n";
        
-       echo "<p><a class=\"navlink\" href=\"{$_REQUEST['return_url']}\">{$_REQUEST['return_desc']}</a></p>\n";
+       echo "<p><a class=\"navlink\" href=\"{$_REQUEST['return_url']}\">{$_REQUEST['return_desc']}</a> |\n";
+       echo "<a class=\"navlink\" href=\"reports.php?action=create&db_name=", urlencode($_REQUEST['database']), "&report_sql=",
+               urlencode($_REQUEST['query']), "\">Save As Report</a></p>\n";
 
        $misc->printFooter();
 ?>