Index: trunk/ippMonitor/raw/ipp.php
===================================================================
--- trunk/ippMonitor/raw/ipp.php	(revision 13264)
+++ trunk/ippMonitor/raw/ipp.php	(revision 13566)
@@ -1,5 +1,5 @@
 <?php
 
-$dTABLE = 10;
+$dTABLE = 80;
 
 function logintext () {
@@ -282,33 +282,128 @@
 }
 
+function navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, $file) {
+
+  if ($rowStart > 0) {
+    $value = 0;
+    $link = "$file" . "?" . $ID['link'] . "&from=$value";
+    if ($buttonLink != "") {
+      $link = $link . "&$buttonLink";
+    }
+    echo "<a width=10 class=\"button\" href=\"$link\">&#60&#60</a>\n";
+  } else {
+    echo "&#60&#60\n";
+  }
+  if ($rowStart >= $dTABLE) {
+    $value = $rowStart - $dTABLE;
+    $link = "$file" . "?" . $ID['link'] . "&from=$value";
+    if ($buttonLink != "") {
+      $link = $link . "&$buttonLink";
+    }
+    echo "<a class=\"button\" href=\"$link\">&#60</a>\n";
+  } else {
+    echo "&#60\n";
+  }
+
+  if ($rowLast < $rowTotal) {
+    $value = $rowStart + $dTABLE;
+    $link = "$file" . "?" . $ID['link'] . "&from=$value";
+    if ($buttonLink != "") {
+      $link = $link . "&$buttonLink";
+    }
+    echo "<a class=\"button\" href=\"$link\">&#62</a>\n";
+  } else {
+    echo "&#62\n";
+  }
+
+  if ($rowLast < $rowTotal) {
+    $value = $rowTotal - $dTABLE;
+    $link = "$file" . "?" . $ID['link'] . "&from=$value";
+    if ($buttonLink != "") {
+      $link = $link . "&$buttonLink";
+    }
+    echo "<a class=\"button\" href=\"$link\">&#62&#62</a>\n";
+  } else {
+    echo "&#62&#62\n";
+  }
+}
+
 function check_restrict ($key, $where) {
   $htmlkey = preg_replace ('|\.|', '_', $key);
   if ($_SERVER[REQUEST_METHOD] == 'GET') { 
     $value = $_GET[$htmlkey]; 
-    // echo "using GET: $value<br>\n";
   } else {
     $value = $_POST[$htmlkey];
-    // echo "using POST: $value<br>\n";
-  }
-  // echo "value: $value<br>\n";
+  }
   if ($value != "") {
     if ($where) {
       $where = $where . " AND $key = '$value'";
-      // echo "where 1: $where<br>\n";
     } else {
-      $where = "$key = '$value'";
-      // echo "where 2: $where<br>\n";
+      $where = "WHERE $key = '$value'";
     }
   }
   return $where;
+}
+
+function check_ordering ($where) {
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET['sort']; 
+  } else {
+    $value = $_POST['sort'];
+  }
+  if ($value != "") {
+    $where = $where . " ORDER BY $value";
+  }
+  return $where;
+}
+
+function button_restrict ($key, $line) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") {
+    if ($line) {
+      $line = $line . "&$key=$value";
+    } else {
+      $line = "$key=$value";
+    }
+  }
+  return $line;
+}
+
+function write_table_header ($class, $name, $value, $buttonLink, $ID, $file) {
+
+  $link = "$file" . "?" . $ID['link'] . "&sort=$value";
+  if ($buttonLink != "") {
+    $link = $link . "&$buttonLink";
+  }
+  echo "<th class=\"$class\"><a href=\"$link\"> $name </a></th>\n";
 }
 
 function write_query_row ($key, $width) {
   $htmlkey = preg_replace ('|\.|', '_', $key);
-  $value = $_POST[$htmlkey];
-  if (($_SERVER[REQUEST_METHOD] == 'POST') && $value) { 
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") { 
     echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" size=\"$width\" value=\"$value\"> </td>\n";
   } else {
     echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" size=\"$width\"> </td>\n";
+  }
+}
+
+function write_table_cell ($class, $link, $value) {
+  $myValue = $value;
+  if ($myValue == "") { $myValue = "&nbsp;"; }
+
+  if ($link) {
+    echo "<td class=\"$class\"><a href=\"$link\"> $myValue </a></td>\n";
+  } else {
+    echo "<td class=\"$class\"> $myValue </td>\n";
   }
 }
