Bool_t gApacheExec=1;

// File: TestInfoDisplay.C
// This displays all the versions of the package GLEAM whose test results are
// available in the database. A drop down menu of the version is shown and the
// user can choose the version whose system tests he wants to see
 
#include <TApache.h>
#include <TSQLServer.h>
#include <TSQLRow.h>
#include <TSQLResult.h>
#include <TCanvas.h>
#include <TFrame.h>
#include <TH1.h>

void TestInfoDisplay(){

   TApache ap;
   gApache->Puts("<body bgcolor=\"darkolivegreen\" topmargin=\"0\" leftmargin=\"0\" marginwidth=\"5\" marginheight=\"5\">");


   // First we select the version of the package GLEAM to display
   char *sql="select version from release_tests where pkg_name = \'GLEAM\'";
   char *connection="oracle://sage/SLAC_TCP";
   char *user="GLAST_DATA";
   char *pass="FLIGHT06";

   // connect to oracle server
   TSQLServer *db=TSQLServer::Connect(connection, user, pass);

   // Submit the query to the database
   TSQLResult *res=db->Query(sql);   
   TSQLRow *row1=res->Next();

   // The HTML form
   gApache->Puts("<HTML><BODY><CENTER>");
   gApache->Puts("<h1>List of Versions of Gleam</h1>");
   gApache->Puts("<h2><BR>Select a Version to view the results of its tests</h2>");
   gApache->Puts("<FORM METHOD = \"GET\" ACTION = \"TestInfoVersion.C\">");
   gApache->Puts("<BR><P><SELECT NAME=\"version\">");


   do{
     
     // Drop down menu for versions for package GLEAM
     gApache->Puts("<OPTION>");
     package_name = row1->GetField(0);
     ap.Printf(row1->GetField(0));

   }// end while
   while(res->Next());

   gApache->Puts("</SELECT></P>");
   gApache->Puts("<BR><BR><input type=\"submit\" value=\"Submit\">");
   gApache->Puts("<BR></form></center></body></html>");

}// end of TestInfoDisplay



