Index: trunk/ippMonitor/raw/ipp.detrend.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9009)
+++ trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9011)
@@ -23,5 +23,5 @@
 
 menutop   | menutop      | plain   | &nbsp;                       | 
-menulink  | menuselect 	 | link    | Master Detrend Images        | masterDetrendImages.php
+menulink  | menuselect 	 | link    | Master Detrend Frames        | masterDetrendFrames.php
 menulink  | menuselect 	 | link    | Detrend Runs                 | detRunSummary.php             
 menulink  | menuselect 	 | link    | Input Detrend Exp            | detInputExp.php                    
Index: trunk/ippMonitor/raw/masterDetrendImfiles.php
===================================================================
--- trunk/ippMonitor/raw/masterDetrendImfiles.php	(revision 9011)
+++ trunk/ippMonitor/raw/masterDetrendImfiles.php	(revision 9011)
@@ -0,0 +1,94 @@
+<?php 
+
+include 'ipp.php';
+
+$ID = checkID ();
+
+if ($ID['menu']) {
+  $myMenu = $ID['menu'];
+} else {
+  $myMenu = "ipp.detrend.dat";
+}
+
+menu($myMenu, 'Master Detrend Imfiles', 'ipp.css', $ID['link']);
+
+echo "<p> Master Detrend Imfiles </p>";
+
+$db = dbconnect();
+
+// define restrictiosn to the queries
+// ** TABLE RESTRICTIONS **
+$WHERE = check_restrict ('det_id', $WHERE);
+$WHERE = check_restrict ('iteration', $WHERE);
+$WHERE = check_restrict ('uri', $WHERE);
+
+echo "WHERE: $WHERE<br><br>\n";
+
+// query the database
+if ($WHERE) {
+  $sql = "SELECT det_id,iteration,uri FROM detNormalizedImfile WHERE $WHERE UNION SELECT det_id,iteration,uri FROM detStackedImfile WHERE normalize = 0 AND $WHERE LIMIT 20";
+} else {
+  $sql = "SELECT det_id,iteration,uri FROM detNormalizedImfile UNION SELECT det_id,iteration,uri FROM detStackedImfile WHERE normalize = 0 LIMIT 20";
+}
+
+echo "SQL: $sql<br><br>\n";
+
+$qry = $db->query($sql);
+if (DB::iserror($db)) {
+  echo "<b>error reading detStackedImfile table</b><br>\n";
+  menu_end();
+}
+
+// ** HEAD CODE **
+
+// set up the table and form
+echo "<form action=\"masterDetrendImfiles.php\" method=\"POST\">\n";
+
+echo "<table class=list>\n";
+echo "<tr>\n";
+// ** TABLE HEADER **
+echo "<th class=\"list\"> det_id </th>\n";
+echo "<th class=\"list\"> iter </th>\n";
+echo "<th class=\"list\"> uri </th>\n";
+// echo "<th class=list> FIELD </th>\n";
+echo "</tr>\n";
+
+// list the results
+while ($qry->fetchInto($row)) {
+  // $link = "masterDetrendImfiles.php" . "?expID=" . $row[0] . "&" . $ID['link'];
+
+  echo "<tr>\n";
+  // ** TABLE DATA **
+  echo "<td class=\"list\"> $row[0] </td>\n";
+  echo "<td class=\"list\"> $row[1] </td>\n";
+  echo "<td class=\"list\"> $row[2] </td>\n";
+  // echo "<td class=list><a href=\"$link\"> $row[0] </a></td>\n";
+  // echo "<td class=list> $row[1] </td>\n";
+  echo "</tr>\n";
+}
+
+// query restriction form
+echo "<tr>\n";
+// echo "<td class=list> <input type=\"text\" name=\"expID\"></td>\n";
+// ** TABLE QUERY **
+write_query_row ('det_id', 7);
+write_query_row ('iteration', 5);
+write_query_row ('uri', 5);
+echo "</tr>\n";
+
+// 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 **
+
+menu_end();
+
+?>
