Index: trunk/MagicSoft/Mars/datacenter/db/querymc.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/querymc.php	(revision 7521)
+++ trunk/MagicSoft/Mars/datacenter/db/querymc.php	(revision 7546)
@@ -131,9 +131,9 @@
 
         if (empty($_GET["fParticleType"]))
-            $_GET["fProjectName"]="Off";
-
-    }
-
-    function PrintForm($_GET, $db)
+            $_GET["fParticleTypeName"]="Off";
+
+    }
+
+    function PrintForm($_GET, $host, $user, $pw, $db)
     {
         printf("<center>\n");
@@ -154,5 +154,5 @@
         printf(" <table>\n");
         printf("  <tr><td>\n");
-        PrintPullDown($db, "ParticleType",     "fParticleTypeName",     "fParticleTypeKEY", "particle type");
+        PrintPullDown($host, $user, $pw, $db, "ParticleType",     "fParticleTypeName",     "fParticleTypeKEY", "particle type");
         printf(" </td></tr></table>\n");
         printf(" <p>\n");
@@ -160,10 +160,10 @@
 /*
         if (empty($_GET["fStartDate"]))
-            $timemin = GetMin("fRunStart", "RunData", $db);
+            $timemin = GetMin("fRunStart", "RunData", $host, $user, $pw, $db);
         else
             $timemin = $_GET["fStartDate"];
 
         if (empty($_GET["fStopDate"]))
-            $timemax = GetMax("fRunStart", "RunData", $db);
+            $timemax = GetMax("fRunStart", "RunData", $host, $user, $pw, $db);
         else
             $timemax = $_GET["fStopDate"];
@@ -174,10 +174,10 @@
 
         if (empty($_GET["fRunMin"]))
-            $min = GetMin("fRunNumber", "MCRunData", $db);
+            $min = GetMin("fRunNumber", "MCRunData", $host, $user, $pw, $db);
         else
             $min = $_GET["fRunMin"];
 
         if (empty($_GET["fRunMax"]))
-            $max = GetMax("fRunNumber", "MCRunData", $db);
+            $max = GetMax("fRunNumber", "MCRunData", $host, $user, $pw, $db);
         else
             $max = $_GET["fRunMax"];
@@ -224,8 +224,7 @@
     }
 
-    function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup)
-    {
-//        $db_id = mysql_connect("localhost", "hercules", "d99swMT!");
-        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
+    function PrintPage($html, $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup)
+    {
+        $db_id = mysql_connect($host, $user, $pw);
         if ($db_id==FALSE)
         {
@@ -268,5 +267,5 @@
         header("Content-Disposition: attachment; filename=query-result.txt");
 
-        PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
+        PrintPage("0", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     }
     else
@@ -277,10 +276,10 @@
 
         InitGet($_GET);
-        PrintForm($_GET, $db);
+        PrintForm($_GET, $host, $user, $pw, $db);
 
         if ($environment==0)
             printf("No query submitted yet.<BR>");
         else
-            PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
+            PrintPage("1", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
 
         echo (file_get_contents("index-footer.html"));
