Index: trunk/ippMonitor/Makefile.in
===================================================================
--- trunk/ippMonitor/Makefile.in	(revision 27053)
+++ trunk/ippMonitor/Makefile.in	(revision 27054)
@@ -37,4 +37,6 @@
 $(DESTWWW)/phptest.php \
 $(DESTWWW)/site.php \
+$(DESTWWW)/showimage.php \
+$(DESTWWW)/nightSummary.php \
 $(DESTWWW)/getimage.php
 
Index: trunk/ippMonitor/configure.tcsh
===================================================================
--- trunk/ippMonitor/configure.tcsh	(revision 27053)
+++ trunk/ippMonitor/configure.tcsh	(revision 27054)
@@ -133,4 +133,6 @@
 if ($#args != 1) goto usage
 
+set hostname = `hostname -f`
+
 echo
 echo "prefix: $prefix"
@@ -191,5 +193,6 @@
 cat tmp.2           | sed "s|@PERLLIB@|$libdir|" > tmp.1
 cat tmp.1           | sed "s|@SITE@|$site|"      > tmp.2
-cat tmp.2           | sed "s|@DBI@|$DBI|"        > raw/site.php
+cat tmp.2           | sed "s|@DBI@|$DBI|"        > tmp.1
+cat tmp.1           | sed "s|@HOST@|$hostname|"  > raw/site.php
 rm -f tmp.1 tmp.2
 
Index: trunk/ippMonitor/def/destreakRun.d
===================================================================
--- trunk/ippMonitor/def/destreakRun.d	(revision 27053)
+++ trunk/ippMonitor/def/destreakRun.d	(revision 27054)
@@ -15,4 +15,6 @@
 FIELD magicDSRun.stage,        5, %s,     Stage
 FIELD magicDSRun.stage_id,     5, %d,     Stage ID
+FIELD magicDSFile.component,   5, %s,     Component
+FIELD magicDSFile.streak_frac, 5, %.3f,   Streak Frac
 FIELD magicDSRun.cam_id,       5, %d,     Camera ID
 FIELD magicDSRun.label,        10, %s,     Label
Index: trunk/ippMonitor/raw/ipp.imfiles.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.imfiles.dat	(revision 27053)
+++ trunk/ippMonitor/raw/ipp.imfiles.dat	(revision 27054)
@@ -17,2 +17,3 @@
 menutop   | menutop      | plain   | External Links               | none            
 menutop   | menutop      | link    | test page                    | phptest.php     
+menutop   | menutop      | link    | night summary                | nightSummary.php
Index: trunk/ippMonitor/raw/ipp.php
===================================================================
--- trunk/ippMonitor/raw/ipp.php	(revision 27053)
+++ trunk/ippMonitor/raw/ipp.php	(revision 27054)
@@ -283,8 +283,9 @@
   if (! $project) { $project = "none"; }
 
-  // hardwire this name based on the configuration (use ipp.php.in)
+  // these are defined in site.php
   global $DBHOST;
-  $HOST = $_SERVER['SERVER_NAME'];
-  echo "<p style=\"font-size:50%\">host: $HOST, db: $DBHOST</p>\n";
+  global $WWWHOST;
+
+  echo "<p style=\"font-size:50%\">host: $WWWHOST, db: $DBHOST</p>\n";
   echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
   echo "<table class=menu cellspacing=0px>\n";
@@ -448,4 +449,8 @@
   }
   if ($value == "") { return $where; }
+
+  global $restricted;
+  $restricted = 1;
+
   if ($where) { 
     $where = $where . " AND"; 
@@ -680,5 +685,7 @@
 
   if ($basename && $camera && $rule) {
+    echo "<a href=\"showimage.php?name=$basename&rule=$rule&camera=$camera&class_id=$class_id\">\n";
     echo "<img $size src=\"getimage.php?name=$basename&rule=$rule&camera=$camera&class_id=$class_id\">\n";
+    echo "</a>\n";
   }
 }
Index: trunk/ippMonitor/raw/nightSummary.php
===================================================================
--- trunk/ippMonitor/raw/nightSummary.php	(revision 27054)
+++ trunk/ippMonitor/raw/nightSummary.php	(revision 27054)
@@ -0,0 +1,144 @@
+<?php 
+
+$restricted = 0;
+
+include 'ipp.php';
+
+function table_section ($db, $WHERE, $TABLE) {
+
+  $sql = "SELECT label,data_group,workdir,state,count(state) as n FROM $TABLE $WHERE LIMIT 10";
+  if ("$TABLE" == "destreakRun") {
+    $sql = "SELECT label,data_group,outroot,state,count(state) as n FROM magicDSRun $WHERE LIMIT 10";
+  }
+  if ("$TABLE" == "distRun") {
+    $sql = "SELECT label,data_group,outroot,state,count(state) as n FROM $TABLE $WHERE LIMIT 10";
+  }
+
+  $qry = $db->query($sql);
+  if (dberror($qry)) {
+    echo "<tr><td><b>error reading $TABLE table</b></td></tr>\n";
+    echo "<tr><td><br><small><b> table query : $sql </b></small></td></tr>\n";
+  }
+  
+  $class = "list";
+  $nlines = 0;
+
+  // list the results
+  while ($qry->fetchInto($row)) {
+    echo "<tr><td class=\"$class\"><b>$TABLE</b></td>\n";
+    // ** TABLE DATA **
+    write_table_cell ($class, '%s', "", $row[0]);
+    write_table_cell ($class, '%s', "", $row[1]);
+    write_table_cell ($class, '%s', "", $row[2]);
+    write_table_cell ($class, '%s', "", $row[3]);
+    write_table_cell ($class, '%s', "", $row[4]);
+    echo "</tr>\n";
+    $nlines ++;
+  }
+
+  if ($nlines == 0) {
+    echo "<tr><td class\"$class\"><b>$TABLE</b></td></tr>\n";
+  }
+}
+
+$ID = checkID ();
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
+
+if ($ID['menu']) {
+  $myMenu = $ID['menu'];
+} else {
+  $myMenu = "ipp.imfiles.dat";
+}
+
+menu($myMenu, 'Night Summary', 'ipp.css', $ID['link'], $ID['proj']);
+
+echo "<p> Night Summary </p>\n";
+
+// set up the form
+echo "<form action=\"nightSummary.php\" method=\"POST\">\n";
+
+$restricted = 0;
+
+// define restrictiosn to the queries
+// ** TABLE RESTRICTIONS **
+$WHERE = check_restrict ('label', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('data_group', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('workdir', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('state', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('n', $WHERE, 'string', 1.0);
+$WHERE = check_restrict ('n', $WHERE, 'min', 1.0);
+$WHERE = check_restrict ('n', $WHERE, 'max', 1.0);
+
+// ensure no valid results
+if ($restricted == 0) {
+  $WHERE = "$WHERE WHERE (0 > 1)";
+}
+
+$WHERE = check_ordering ('state,label', $WHERE);
+
+// set up the table
+echo "<table class=list>\n";
+
+// echo "<tr><td></td>\n"; // first field is a label set below for the query rows only
+// ** TABLE HEADER **
+echo "<tr><td></td>\n";
+write_header_cell ("list", "label");
+write_header_cell ("list", "data_group");
+write_header_cell ("list", "workdir");
+write_header_cell ("list", "state");
+write_header_cell ("list", "count");
+echo "</tr>\n";
+
+// query restriction form
+// echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// ** TABLE QUERY ** (restictions)
+echo "<tr><td>&ge;</td>\n";
+write_query_row ('label', 15, 'string');
+write_query_row ('data_group', 10, 'string');
+write_query_row ('workdir', 7, 'string');
+write_query_row ('state', 7, 'string');
+write_query_row ('n', 7, 'min');
+echo "</tr><tr><td>&le;</td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+echo "<td> &nbsp; </td>\n";
+write_query_row ('n', 7, 'max');
+echo "</tr>\n";
+
+// query the database (limit is 10, but should be 1
+table_section($db, $WHERE, "chipRun");
+table_section($db, $WHERE, "camRun");
+table_section($db, $WHERE, "fakeRun");
+table_section($db, $WHERE, "warpRun");
+table_section($db, $WHERE, "stackRun");
+table_section($db, $WHERE, "diffRun");
+table_section($db, $WHERE, "magicRun");
+table_section($db, $WHERE, "destreakRun");
+table_section($db, $WHERE, "distRun");
+// table_section($db, $WHERE, "publishRun");
+
+// close the table and form
+echo "</table>\n";
+echo "<input type=\"submit\" name=\"constraints\" value=\"refine search\">\n";
+$pass = $ID['pass'];
+$proj = $ID['proj'];
+$menu = $ID['menu'];
+echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
+echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
+echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
+echo "</form>\n";
+
+// ** TAIL CODE **
+
+echo "<small> WHERE: $WHERE<br><br></small>\n";
+echo "<small> SQL: $sql<br><br></small>\n";
+
+menu_end();
+
+?>
Index: trunk/ippMonitor/raw/showimage.php
===================================================================
--- trunk/ippMonitor/raw/showimage.php	(revision 27054)
+++ trunk/ippMonitor/raw/showimage.php	(revision 27054)
@@ -0,0 +1,54 @@
+<?php
+
+include 'site.php';
+
+global $WWWHOST;
+global $DBHOST;
+
+$debug = 0;
+$sheet = 'ipp.css';
+
+// load an image file from the image directory
+// validate request
+if ($_SERVER[REQUEST_METHOD] != 'GET') { 
+  exit ();
+}
+
+if ($debug) {
+  echo "args: $args<br>";
+}
+
+# $basename may contain filename@filerule
+$basename = $_GET[name];
+$filerule = $_GET[rule];
+$camera   = $_GET[camera];
+$class_id = $_GET[class_id];
+
+$title = $basename;
+
+if ($debug) {
+  echo "basename: $basename<br>";
+  echo "filerule: $filerule<br>";
+  echo "filerule: $filerule<br>";
+  echo "camera:   $camera<br>";
+  echo "class_id: $class_id<br>";
+  exit ();
+}
+
+  echo "<html><head><title> $title </title></head>\n\n";
+  echo "<link rel=\"STYLESHEET\" HREF=\"$sheet\">\n";
+  echo "<body>\n";
+
+  $root = "/ippMonitor";
+
+  echo "<p style=\"font-size:50%\">host: $WWWHOST, db: $DBHOST</p>\n";
+  echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
+  echo "base: $basename, camera: $camera, class_id: $class_id<br></td>\n";
+
+  echo "<tr><td>\n";
+  echo "<img src=\"getimage.php?name=$basename&rule=$filerule&camera=$camera&class_id=$class_id\">\n";
+  echo "</td></tr></table>\n";
+  echo "</body></html>\n\n";
+
+exit ();
+?>
Index: trunk/ippMonitor/raw/site.php.in
===================================================================
--- trunk/ippMonitor/raw/site.php.in	(revision 27053)
+++ trunk/ippMonitor/raw/site.php.in	(revision 27054)
@@ -1,7 +1,8 @@
 <?php
 
-$DBHOST = "@DBHOST@";
-$DBUSER = "@DBUSER@";
-$DBPASS = "@DBPASS@";
+$WWWHOST = "@HOST@";
+$DBHOST  = "@DBHOST@";
+$DBUSER  = "@DBUSER@";
+$DBPASS  = "@DBPASS@";
 
 $PERLLIB = "@PERLLIB@";
