Index: /trunk/archive/ippMonitor/Makefile
===================================================================
--- /trunk/archive/ippMonitor/Makefile	(revision 5872)
+++ /trunk/archive/ippMonitor/Makefile	(revision 5872)
@@ -0,0 +1,52 @@
+default: php
+help:
+	@echo "USAGE: make php"
+
+SRC     =       src
+DESTBIN =       /var/www/kiawe/phpipp
+
+INSTALL = \
+$(DESTBIN)/menu.php \
+$(DESTBIN)/menu.dat \
+$(DESTBIN)/ipp.css \
+$(DESTBIN)/Login.php \
+$(DESTBIN)/SelectProject.php \
+$(DESTBIN)/ScienceStats.php \
+$(DESTBIN)/DetrendStats.php \
+$(DESTBIN)/phptest.php 
+
+PICTURES = \
+$(DESTBIN)/PScolorlogo2.jpg
+
+php: $(INSTALL) $(PICTURES)
+
+# dependancy rules for binary code #########################
+# .PRECIOUS: %.$(ARCH).o
+# .PRECIOUS: $(BIN)/%.$(ARCH)
+
+$(DESTBIN)/%.php: $(SRC)/%.php
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN) || exit; fi
+	rm -f $(DESTBIN)/$*.php || exit
+	cp $(SRC)/$*.php $(DESTBIN)/$*.php || exit
+
+$(DESTBIN)/%.css: $(SRC)/%.css
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN) || exit; fi
+	rm -f $(DESTBIN)/$*.css || exit
+	cp $(SRC)/$*.css $(DESTBIN)/$*.css || exit
+
+$(DESTBIN)/%.dat: $(SRC)/%.dat
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN) || exit; fi
+	rm -f $(DESTBIN)/$*.dat || exit
+	cp $(SRC)/$*.dat $(DESTBIN)/$*.dat || exit
+
+$(DESTBIN)/%.jpg: $(SRC)/%.jpg
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN) || exit; fi
+	rm -f $(DESTBIN)/$*.jpg || exit
+	cp $(SRC)/$*.jpg $(DESTBIN)/$*.jpg || exit
+
+# utilities #################################################
+
+clean:	
+	rm -f `find . -name "*.o"`
+	rm -f `find . -name "*~"`
+	rm -f `find . -name "#*"`
Index: /trunk/archive/ippMonitor/src/DetrendStats.php
===================================================================
--- /trunk/archive/ippMonitor/src/DetrendStats.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/DetrendStats.php	(revision 5872)
@@ -0,0 +1,26 @@
+
+<? function maintext () { ?>
+<p>
+Examine the Detrend creation statistics
+</p>
+<? } ?>
+
+<?php 
+
+include 'menu.php';
+
+if ($_SERVER[REQUEST_METHOD] != 'GET') { 
+  menu('Login', 'ipp.css');
+  echo "Invalid Client Request<br>\n";
+  menu_end ();
+  exit ();
+}
+
+checkID ();
+
+menu('Login', 'ipp.css');
+maintext ();
+menu_end();
+
+
+?>
Index: /trunk/archive/ippMonitor/src/Login.php
===================================================================
--- /trunk/archive/ippMonitor/src/Login.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/Login.php	(revision 5872)
@@ -0,0 +1,77 @@
+
+<? function logoutform ($myID) { ?>
+<p>
+You are currently logged in.  Click here to log out.<br>
+<form action="Login.php" method="POST">
+<input type="hidden" name="myID" value="<? $myID ?>"><br>
+<input type="submit" name="logout">
+</form>
+</p>
+<? } ?>
+
+<?php 
+
+include 'menu.php';
+
+if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+  $myID = $_GET[myID];
+  if ($myID == "") {
+    menu ('Login', 'ipp.css');
+    logintext ();
+    loginform ();
+    menu_end ();
+    exit ();
+ } else {
+    menu ('Login', 'ipp.css');
+    logoutform ($myID);
+    menu_end ();
+    exit ();
+ }
+} 
+
+if ($_SERVER[REQUEST_METHOD] != 'POST') { 
+  menu ('Login', 'ipp.css');
+  echo "Invalid Client Request<br>\n";
+  menu_end ();
+  exit ();
+}
+
+if (key_exists (login, $_POST)) {
+  $username = $_POST[username];
+  $password = $_POST[password];
+
+  $success = (($username == "eugene") && ($password == "test"));
+
+  if (!$success) {  
+    menu ('Login', 'ipp.css');
+    echo "Login Failed, please try again<br>\n";
+    loginform ();
+    menu_end ();
+    exit ();
+  }
+
+  $_GET[myID] = "foobar";
+  menu ('Login', 'ipp.css');
+  echo "Login Accepted\n";
+  menu_end();
+  exit ();
+}
+
+if (key_exists (logout, $_POST)) {
+  $oldID = $_POST[myID];
+  menu ('Login', 'ipp.css');
+  echo "You are now logged out<br>\n";
+  logintext ();
+  loginform ();
+  menu_end ();
+  exit ();
+}
+
+menu ('Login', 'ipp.css');
+echo "Invalid Client Post Request<br>\n";
+foreach ($_POST as $key => $value) {
+  echo "$key : $value<br>\n";
+}
+menu_end ();
+
+?>
Index: /trunk/archive/ippMonitor/src/ScienceStats.php
===================================================================
--- /trunk/archive/ippMonitor/src/ScienceStats.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/ScienceStats.php	(revision 5872)
@@ -0,0 +1,26 @@
+
+<? function maintext () { ?>
+<p>
+Explore the Science results
+</p>
+<? } ?>
+
+<?php 
+
+include 'menu.php';
+
+if ($_SERVER[REQUEST_METHOD] != 'GET') { 
+  menu('Login', 'ipp.css');
+  echo "Invalid Client Request<br>\n";
+  menu_end ();
+  exit ();
+}
+
+checkID ();
+
+menu('Login', 'ipp.css');
+maintext ();
+menu_end();
+
+
+?>
Index: /trunk/archive/ippMonitor/src/SelectProject.php
===================================================================
--- /trunk/archive/ippMonitor/src/SelectProject.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/SelectProject.php	(revision 5872)
@@ -0,0 +1,46 @@
+
+<? function projectform () { ?>
+  <p>
+  Select the project of interest
+  </p>
+  <form action="<? $myPage ?>" method="POST">
+  Project: <input type="text" name="proj"><br>
+  <input type="submit" name="project">
+  </form>
+<? } ?>
+
+<?php 
+
+include 'menu.php';
+
+checkID ();
+
+if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    menu ('Project', 'ipp.css');
+    projectform ();
+    menu_end ();
+}
+
+if ($_SERVER[REQUEST_METHOD] != 'POST') { 
+  menu ('Project', 'ipp.css');
+  echo "Invalid Client Request<br>\n";
+  menu_end ();
+}
+
+if (key_exists (project, $_POST)) {
+  $myProj = $_POST[proj];
+  # validate the existence of the project
+  $_GET[proj] = $myProj;
+  menu ('Project', 'ipp.css');
+  echo "New project is : $myProj\n";
+  menu_end();
+}
+  
+menu ('Project', 'ipp.css');
+echo "Invalid Client Post Request<br>\n";
+foreach ($_POST as $key => $value) {
+  echo "$key : $value<br>\n";
+}
+menu_end ();
+
+?>
Index: /trunk/archive/ippMonitor/src/ipp.css
===================================================================
--- /trunk/archive/ippMonitor/src/ipp.css	(revision 5872)
+++ /trunk/archive/ippMonitor/src/ipp.css	(revision 5872)
@@ -0,0 +1,47 @@
+
+/* internal link line: c0d0d0 : d8d0f0
+   external link line: 303070 
+   border:             0080c0
+ */
+
+body  { bgcolor: #a0d0e0; background-color: #a0d0e0; padding: 5px; margin: 5px }
+
+a:link, a:visited, a:active { text-decoration: underline; font-weight: bold; color: #ff0000 }
+
+a.menutop     { text-decoration: none; color: #ffffff; font-weight: bold }
+a.menuext     { text-decoration: none; color: #ffffff; font-weight: bold }
+a.menulink    { text-decoration: none; font-weight: normal; color: #000000}
+a.menuselect  { text-decoration: none; font-weight: normal; color: #0000ff}
+a.piclink     { text-decoration: none; font-weight: normal; color: #0080c0}
+
+td.menutop    { text-align: left; background: #0080c0; font-size: small; color: #ffffff; padding: 2px; }
+td.menuext    { text-align: left; background: #303070; font-size: small; color: #ffffff; padding: 2px; }
+td.menulink   { text-align: left; background: #d0d0ff; font-size: small; color: #000000; padding: 2px; font-weight: normal; text-indent: 0px; }
+td.menuselect { text-align: left; background: #d0d0ff; font-size: small; color: #ff0000; padding: 2px; font-weight: normal; text-indent: 0px; }
+td.menuline   { text-align: left; background: #d0d0ff; font-size: small; color: #000000; padding: 2px; font-weight: normal; text-indent: 0px; }
+
+td.picture    { text-align: left; background: #00ffff; font-size: small; color: #ff0000; padding: 0px; text-indent: 2px; font-weight: normal; }
+td.piclink    { text-align: left; background: #0080c0; font-size: small; color: #ff0000; padding: 0px; text-indent: 0px; font-weight: normal; }
+
+table.page { border: 0px solid #0080c0; background: #a0d0e0; padding: 0px}
+
+td.title { background-color: #ff0000; padding: 5px; font-size: x-large; text-align: left; vertical-align: top}
+
+td.body  { 
+           text-align: left; 
+           font-size: normal;  
+           font-weight: normal;  
+           vertical-align: top;
+	   background: #d0d0ff; 
+	   background-color: #d0d0ff; 
+	   border: 3px solid #0080c0; 
+	   padding: 5px; 
+}
+
+table.menu { text-align: left; 
+             font-size: small; 
+	     font-weight: normal; 
+	     background: #ff0000; 
+	     border: 3px solid #0080c0; 
+	     padding: 0px; 
+}
Index: /trunk/archive/ippMonitor/src/menu.dat
===================================================================
--- /trunk/archive/ippMonitor/src/menu.dat	(revision 5872)
+++ /trunk/archive/ippMonitor/src/menu.dat	(revision 5872)
@@ -0,0 +1,20 @@
+# style   | select-style | type    | menu line   		  | link page       
+
+# we have four valid menu types: picture, piclink, link, plain
+# picture   | picture 	 | picture | PScolorlogo2.jpg     	  | none
+# piclink   | piclink 	 | piclink | PScolorlogo2.jpg     	  | http://panstarrs.ifa.hawaii.edu
+# menulink  | menuselect | link    | other page   		  | notest.php     
+# menutop   | menutop	 | plain   | foo bar     		  | none            
+
+piclink   | piclink 	 | piclink | PScolorlogo2.jpg     	  | http://panstarrs.ifa.hawaii.edu
+menuext   | menuext	 | link    | Pan-STARRS public		  | http://panstarrs.ifa.hawaii.edu
+menuext   | menuext	 | link    | Pan-STARRS project		  | http://panstarrs.ifa.hawaii.edu/project
+menuext   | menuext	 | link    | Pan-STARRS IPP 		  | http://panstarrs.ifa.hawaii.edu/project/IPP
+menutop   | menutop      | plain   | &nbsp;                       | 
+menulink  | menuselect	 | link    | Login       		  | Login.php     
+menulink  | menuselect	 | link    | Select Project   		  | SelectProject.php     
+menulink  | menuselect	 | link    | Science Stats   		  | ScienceStats.php     
+menulink  | menuselect	 | link    | Detrend Stats   		  | DetrendStats.php     
+
+menutop   | menutop	 | plain   | foo bar     		  | none            
+menutop   | menutop	 | link    | test page   		  | phptest.php     
Index: /trunk/archive/ippMonitor/src/menu.php
===================================================================
--- /trunk/archive/ippMonitor/src/menu.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/menu.php	(revision 5872)
@@ -0,0 +1,113 @@
+
+<? function loginform () { ?>
+  <form action="Login.php" method="POST">
+  Username: <input type="text" name="username"><br>
+  Password: <input type="text" name="password"><br>
+  <input type="submit" name="login">
+  </form>
+<? } ?>
+
+<? function logintext () { ?>
+<p>
+Welcome to the IPP status pages.  From these pages, you may examine
+summary information about the IPP processing results.  In order to
+continue, it is necessary to login as an authorized IPP user.
+</p>
+<? } ?>
+
+<?php
+
+function checkID () {
+
+  $myID = $_GET[myID];
+
+  if ($myID == "") {
+    menu('Login', 'ipp.css');
+    logintext ();    
+    loginform ();
+    menu_end ();
+  }
+
+  if ($myID != "foobar") {
+    menu('Login', 'ipp.css');
+    echo "unknown user, please login again<br>\n";
+    loginform ();
+    menu_end ();
+  }
+  $myPage = $_SERVER[SCRIPT_NAME] . "?myID=$myID";
+}
+
+function menu ($title, $sheet) {
+
+  echo "<html><head><title>\n";
+  echo "$title\n";
+  echo "</title></head>\n\n";
+
+  echo "<link rel=\"STYLESHEET\" HREF=\"$sheet\">\n";
+  echo "<body>\n";
+
+  $root = "/phpipp";
+
+  $file = fopen ("menu.dat", "r");
+  $myID = $_GET[myID];
+  $myProj = $_GET[proj];
+
+  echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
+  echo "<table class=menu cellspacing=0px>\n";
+
+  while ($line = fgetcsv ($file, 1024, "|")) {
+    if (count($line) != 5) continue;
+    if (ereg ('^[:blank:]*#', $line[0])) continue;
+
+    $type = trim($line[2]);
+    $name = trim($line[3]);
+    $base = trim($line[4]);
+
+    $link = $base;
+    if ($myID || $myProj) {
+       $link = $link . "?";        
+    }
+    if ($myID) {
+        $link = $link . "myID=$myID";
+    } 
+    if ($myProj && !$myID) {
+        $link = $link . "proj=$myProj";
+    }
+    if ($myProj && $myID) {
+        $link = $link . "&proj=$myProj";
+    }
+	
+    $this = $_SERVER[SCRIPT_NAME]; 
+    $page = "$root/" . $base;
+    if ($page == $this) {
+	$style = $line[1];
+    } else { 
+	$style = $line[0];
+    }       
+
+    switch ($type) { 
+      case 'plain':
+        echo "<tr><td class=$style> $name </td></tr>\n";  
+        break;
+      case 'picture':
+        echo "<tr><td class=$style> <img src=\"$name\"> </td></tr>\n";     
+        break;
+      case 'piclink':
+        echo "<tr><td class=$style> <a class=$style href=\"$link\"> <img class=$style src=\"$name\"> </a></td></tr>\n";     
+        break;
+      default:
+        echo "<tr><td class=$style> <a class=$style href=\"$link\"> $name </a></td></tr>\n";     
+        break;
+    } 
+  }
+  fclose ($file);
+  echo "</table></td><td class=body valign=top>\n";
+}
+
+function menu_end () { 
+  echo "</td></tr></table>\n";
+  echo "</body></html>\n";
+  exit ();
+}
+
+?>
Index: /trunk/archive/ippMonitor/src/phptest.php
===================================================================
--- /trunk/archive/ippMonitor/src/phptest.php	(revision 5872)
+++ /trunk/archive/ippMonitor/src/phptest.php	(revision 5872)
@@ -0,0 +1,26 @@
+<?php include 'menu.php'; ?>
+
+<?php menu('test.page', 'ipp.css'); ?>
+
+<?
+
+$varlist = array ('SERVER_NAME', 'GATEWAY_INTERFACE', 'SERVER_PROTOCOL',
+'SERVER_PORT', 'REQUEST_METHOD', 'PATH_INFO', 'PATH_TRANSLATED', 'SCRIPT_NAME',
+'QUERY_STRING', 'REMOTE_HOST', 'REMOTE_ADDR', 'AUTH_TYPE', 'REMOTE_USER',
+'REMOTE_IDENT', 'CONTENT_TYPE', 'CONTENT_LENGTH');
+
+foreach ($varlist as $name) {
+  echo "$name : $_SERVER[$name]<br>\n";
+}
+
+echo "get list<br>\n";
+foreach ($_GET as $key => $value) {
+  echo "$key : $value<br>\n";
+}
+
+?>
+
+<?php menu_dataend(); ?>
+
+</body>
+</html>
Index: /trunk/archive/p2tools/src/p2search.h
===================================================================
--- /trunk/archive/p2tools/src/p2search.h	(revision 5871)
+++ /trunk/archive/p2tools/src/p2search.h	(revision 5872)
@@ -57,5 +57,5 @@
     char url[128];			// locator for file (neb / file)
     char state;				// current load state
-} ppRawImage;
+} ppRawImfile;
 
 // this structure should be defined using the mddb api tools
@@ -82,5 +82,5 @@
     char smf[16];			// extension for object table
     char state;				// current P2 state
-} p2PendingImage;
+} p2PendingImfile;
 
 // this structure should be defined using the mddb api tools
@@ -107,5 +107,5 @@
     char smf[16];			// extension for object table
     char state;				// current P2 state
-} p2DoneImage;
+} p2DoneImfile;
 
 typedef struct {
