Index: trunk/pstamp/web/request.php
===================================================================
--- trunk/pstamp/web/request.php	(revision 20153)
+++ trunk/pstamp/web/request.php	(revision 21415)
@@ -19,12 +19,11 @@
 // BEGIN Local configuration
 
-$WORKDIR = "/export/data1/bills/pstamp/work";
-
-$PSCONFDIR = "/export/data0/bills/psconfig";
-$PSCONFIG  = "debug";
-$PSBINDIR  = "$PSCONFDIR/$PSCONFIG.linrh64/bin";
-
-$dsroot = "/export/data1/datastore/dsroot";
-$dbname = "gpc1";
+$WORKDIR = "XXXX/pstamp-work/web";
+$dsroot = "XXXX/datastore/dsroot";
+$dbname = "XXXX";
+
+$PSCONFDIR = "XXXX";
+$PSCONFIG  = "XXXX";
+$PSBINDIR  = "$PSCONFDIR/$PSCONFIG.lin64/bin";
 
 // END Local configuration 
@@ -49,4 +48,5 @@
 $file_checked = "";
 $coord_checked = "";
+$diff_checked = "";
 $list_checked = "";
 $pstamp_checked = "";
@@ -95,12 +95,12 @@
 import_request_variables("gp", "rvar_");
 
-if ($rvar_project == "gpc1") {
+if ($rvar_project == "gpc1_rel_200901") {
     $gpc1_selected = "selected";
     $require_class_id = 1;
-} else if ($rvar_project == "simtest") {
+} else if ($rvar_project == "megacam-mops") {
+    $mops_selected = "selected";
+    $require_class_id = 0;
+} else { //    if ($rvar_project == "simtest") {
     $simtest_selected = "selected";
-    $require_class_id = 0;
-} else {
-    $mops_selected = "selected";
     $require_class_id = 0;
 }
@@ -114,4 +114,6 @@
 } else if ($rvar_select_by == "coord") {
     $coord_checked = "CHECKED";
+} else if ($rvar_select_by == "diff_image_id") {
+    $diff_checked = "CHECKED";
 } else {
     // nothing checked default to By Exposure
@@ -248,5 +250,5 @@
     global $rvar_X, $rvar_Y;
     global $rvar_W, $rvar_H;
-    global $exp_checked, $file_checked, $coord_checked;
+    global $exp_checked, $file_checked, $coord_checked, $diff_checked;
     global $rvar_img_type;
     global $rvar_id, $rvar_class_id;
@@ -317,10 +319,10 @@
     if ($exp_checked) {
         if (! $rvar_id ) {
-            throw new Exception('Must set Exposure ID.');
+            throw new Exception('Must set ID to the Exposure ID.');
         }
         $cmd .= " -byexp $rvar_img_type $rvar_id";
     } else if ($file_checked) {
         if (! $rvar_id ) {
-            throw new Exception('Must set ID.');
+            throw new Exception('Must set ID to the exposure name.');
         }
         $cmd .= " -byid $rvar_img_type $rvar_id";
@@ -330,4 +332,9 @@
         $exp_checked = "checked";
         throw new Exception("Image selection by coordinate not implemented yet.");
+    } else if ($diff_checked) {
+        if (! $rvar_id ) {
+            throw new Exception('Must set ID to Diff Image ID.');
+        }
+        $cmd .= " -bydiff $rvar_img_type $rvar_id";
     }
 
@@ -385,23 +392,33 @@
     $doURL = 1;
     if ($doURL) {
-//        echo "output_line: $line\n";
+// echo "<pre>output_line: $line\n</pre>";
+        // Parse the output from pstamp_list_jobs.pl
         $elements = explode(" ", $line);
-        if (count($elements) == 3) {
+        if (count($elements) == 6) {
             $job_id   = $elements[0];
             $state    = $elements[1];
-            $path     = $elements[2];
+            $fault    = $elements[2];
+            $req_name = $elements[3];
+            $product  = $elements[4];
+            $path     = $elements[5];
             $fileName = basename($path);
             if ($state == "stop") {
                 global $dsroot;
-                $fullpath = "$dsroot" . "$path";
-                if (file_exists($fullpath)) {
+                $dirName  = "$dsroot/$product/$req_name";
+                $filesetURL = "/ds/$product/$req_name";
+                $fullpath = "$dirName/$fileName";
+// echo "<pre>fullpath: $fullpath filesetURL: $filesetURL\n</pre>";
+                if (file_exists($dirName)) {
                     // this job is done, list the url as a link
-                    echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">";
-                    echo $fileName;
+                    // echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">";
+                    echo "<a href=\"http:$filesetURL\">";
+#                    echo $fileName;
+                    $filesetName = basename($dirName);
+                    echo "Fileset: $filesetName";
                     echo "</a>";
-                    echo "&nbsp;&nbsp;&nbsp; request_id: $last_request_id &nbsp;&nbsp;";
+                    echo "&nbsp;&nbsp;&nbsp; Base: $fileName &nbsp;&nbsp;&nbsp; request id: $last_request_id &nbsp;&nbsp;";
                     echo "job_id: $job_id &nbsp;&nbsp;&nbsp; state: $state";
                 } else {
-                    echo "request_id: $last_request_id  job_id: $job_id failed";
+                    echo "request id: $last_request_id  job id: $job_id failed";
                     echo "   $fullpath";
                 }
@@ -549,5 +566,5 @@
     <tr><td><b>Project:</b>&nbsp;&nbsp;&nbsp;</td>
         <td><select name="project">
-           <option <?php echo $gpc1_selected;?> >gpc1
+           <option <?php echo $gpc1_selected;?> >gpc1_rel_200901
            <option <?php echo $mops_selected;?> >megacam-mops
            <option <?php echo $simtest_selected;?> >simtest
@@ -563,4 +580,6 @@
 &nbsp;
 <input type=radio name="select_by" value="coord" <?php echo $coord_checked; ?> >Coordinates
+&nbsp;
+<input type=radio name="select_by" value="diff_image_id" <?php echo $diff_checked; ?> >Diff Image ID
 </td>
 </tr>
@@ -592,5 +611,5 @@
 &nbsp;&nbsp;&nbsp;&nbsp;
 <b>
-<?php if (0 && $rvar_project == "gpc1") {
+<?php if (0 && $rvar_project == "gpc1_rel_200901") {
         echo "Chip ID:";
       } else {
@@ -820,8 +839,9 @@
 <pre>
 
-<!--- rvar_select_by = <?php echo $rvar_select_by; ?>
---->
 
 <?php 
+
+//    echo "select_by: $rvar_select_by diff_checked: $diff_checked exp_checked: $exp_checked file_checked: $file_checked coord_checked: $coord_checked\n";
+
     // dump parameters 
 
