Index: trunk/MagicSoft/Mars/datacenter/db/queryrbk.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/queryrbk.php	(revision 8180)
+++ trunk/MagicSoft/Mars/datacenter/db/queryrbk.php	(revision 9184)
@@ -23,8 +23,13 @@
         printf("%s\">&nbsp;&nbsp;&nbsp;\n", $_GET["fNight"]);
 
+
         printf("<input class='Width' type='submit' value='Query Table'>&nbsp;&nbsp;&nbsp;\n");
         printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"queryrbk.php\"'>&nbsp;&nbsp;&nbsp;\n");
         if (strchr($_SERVER["REQUEST_URI"], '?')!=FALSE)
+        {
             printf("<input class='Width' type='button' value='Get .txt' onClick='self.location.href=\"%s&fSendTxt=1\"'>&nbsp;&nbsp;&nbsp;\n", $_SERVER["REQUEST_URI"]);
+            printf("<input class='Width' type='button' value='Print' onClick='self.location.href=\"%s&amp;fPrintTable=1\"'>&nbsp;&nbsp;&nbsp;\n", htmlspecialchars($_SERVER["REQUEST_URI"]));
+        }
+
         printf("</form>\n");
         printf("</center>\n");
@@ -61,5 +66,5 @@
         if ($result0)
         {
-            if ($html=="1")
+            if ($html=="1" || $html=="2")
             {
                 $alias = array
@@ -98,16 +103,24 @@
     else
     {
-        echo (file_get_contents("index-header.html"));
+        if (empty($_GET["fPrintTable"]))
+            echo (file_get_contents("index-header.html"));
 
         $environment = sizeof($_GET);
 
-        PrintForm($_GET);
+        if (empty($_GET["fPrintTable"]))
+            PrintForm($_GET);
 
         if ($environment==0)
             printf("No query submitted yet.<BR>");
         else
-            PrintPage("1", $host, $user, $pw, $db);
+        {
+            if (empty($_GET["fPrintTable"]))
+                PrintPage("1", $host, $user, $pw, $db);
+            else
+                PrintPage("2", $host, $user, $pw, $db);
+        }
 
-        echo (file_get_contents("index-footer.html"));
+        if (empty($_GET["fPrintTable"]))
+            echo (file_get_contents("index-footer.html"));
     }
 
