IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10621


Ignore:
Timestamp:
Dec 11, 2006, 10:32:55 AM (19 years ago)
Author:
eugene
Message:

added forward/backward buttons; fixed table fields for pz tables

Location:
trunk/ippMonitor
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/def/autocode.php

    r9439 r10621  
    2020echo "<p> $TITLE </p>";
    2121
     22// set up the form
     23echo "<form action=\"$FILE\" method=\"POST\">\n";
     24
    2225// define restrictiosn to the queries
    2326// ** TABLE RESTRICTIONS **
    2427
     28// get the result table count
     29if ($WHERE) {
     30  $sql = "SELECT count(*) FROM $TABLE WHERE $WHERE";
     31} else {
     32  $sql = "SELECT count(*) FROM $TABLE";
     33}
     34$qry = $db->query($sql);
     35if (DB::iserror($db)) {
     36  echo "<b>error reading $TABLE table count</b><br>\n";
     37  menu_end();
     38}
     39if (!$qry->fetchInto($row)) {
     40  echo "<b>error reading $TABLE table count</b><br>\n";
     41  menu_end();
     42}
     43// set up the row counter variables
     44if ($ID['from']) {
     45  $rowStart = $ID['from'];
     46} else {
     47  $rowStart = 0;
     48}
     49$rowLast = $rowStart + $dTABLE;
     50$rowTotal = $row[0];
     51if ($rowLast > $rowTotal) { $rowLast = $rowTotal; }
     52echo "<b> $rowStart to $rowLast of $rowTotal items</b><br>\n";
     53
    2554// query the database
    2655if ($WHERE) {
    27   $sql = "SELECT $FIELDS FROM $TABLE WHERE $WHERE LIMIT 40";
     56  $sql = "SELECT $FIELDS FROM $TABLE WHERE $WHERE LIMIT $dTABLE OFFSET $rowStart";
    2857} else {
    29   $sql = "SELECT $FIELDS FROM $TABLE LIMIT 40";
     58  $sql = "SELECT $FIELDS FROM $TABLE LIMIT $dTABLE OFFSET $rowStart";
    3059}
    3160
     
    3867// ** HEAD CODE **
    3968
    40 // set up the table and form
    41 echo "<form action=\"$FILE\" method=\"POST\">\n";
     69if ($rowStart > 0) {
     70  $value = 0;
     71  $link = "$FILE" . "?" . $ID['link'] . "&from=$value";
     72  echo "<a width=10 class=\"button\" href=\"$link\">&#60&#60</a>\n";
     73} else {
     74  echo "&#60&#60\n";
     75}
     76if ($rowStart >= $dTABLE) {
     77  $value = $rowStart - $dTABLE;
     78  $link = "$FILE" . "?" . $ID['link'] . "&from=$value";
     79  echo "<a class=\"button\" href=\"$link\">&#60</a>\n";
     80} else {
     81  echo "&#60\n";
     82}
    4283
     84if ($rowLast < $rowTotal) {
     85  $value = $rowStart + $dTABLE;
     86  $link = "$FILE" . "?" . $ID['link'] . "&from=$value";
     87  echo "<a class=\"button\" href=\"$link\">&#62</a>\n";
     88} else {
     89  echo "&#62\n";
     90}
     91
     92if ($rowLast < $rowTotal) {
     93  $value = $rowTotal - $dTABLE;
     94  $link = "$FILE" . "?" . $ID['link'] . "&from=$value";
     95  echo "<a class=\"button\" href=\"$link\">&#62&#62</a>\n";
     96} else {
     97  echo "&#62&#62\n";
     98}
     99
     100echo "&nbsp; : &nbsp; or enter start row: <input type=\"text\" name=\"from\" size=\"5\" value=\"$rowStart\">\n";
     101
     102// set up the table
    43103echo "<table class=list>\n";
    44104echo "<tr>\n";
  • trunk/ippMonitor/def/pzPendingExp.d

    r9009 r10621  
    88FIELD    camera,        20,   camera
    99FIELD    telescope,     20,   telescope
    10 FIELD    exp_type,      20,   type
    11 FIELD    imfiles,       20,   N files
  • trunk/ippMonitor/def/pzPendingImfile.d

    r9323 r10621  
    88FIELD    camera,      20,   camera
    99FIELD    telescope,   20,   telescope
    10 FIELD    bytes,       20,   number of bytes
    11 FIELD    md5sum,      20,   checksum
    1210FIELD    class,       20,   class
    1311FIELD    class_id,    20,   class ID
    14 FIELD    uri,         20,   URI
  • trunk/ippMonitor/raw/ipp.css

    r9439 r10621  
    99a:link, a:visited, a:active { text-decoration: underline; font-weight: bold; color: #ff0000 }
    1010
    11 a.menutop     { text-decoration: none; color: #ffffff; font-weight: bold }
    12 a.menutops    { text-decoration: none; color: #80f0ff; font-weight: bold }
    13 a.menuext     { text-decoration: none; color: #ffffff; font-weight: bold }
     11a.button      { text-decoration: none; font-weight: bold;   color: #000000; background: #0080c0}
     12a.menutop     { text-decoration: none; font-weight: bold;   color: #ffffff}
     13a.menutops    { text-decoration: none; font-weight: bold;   color: #80f0ff}
     14a.menuext     { text-decoration: none; font-weight: bold;   color: #ffffff}
    1415a.menulink    { text-decoration: none; font-weight: normal; color: #000000}
    1516a.menuselect  { text-decoration: none; font-weight: normal; color: #0000ff}
  • trunk/ippMonitor/raw/ipp.imfiles.dat

    r9439 r10621  
    3232menulink  | menuselect   | link    | detResidImfile               | detResidImfile.php           
    3333menulink  | menuselect   | link    | masterDetrendImfiles         | masterDetrendImfiles.php
    34 menulink  | menuselect   | link    | detMasterImfile              | detMasterImfile.php                   
    3534menulink  | menuselect   | link    | pzPendingImfile              | pzPendingImfile.php                   
    3635menulink  | menuselect   | link    | p2PendingImfile              | p2PendingImfile.php                   
  • trunk/ippMonitor/raw/ipp.php

    r9439 r10621  
    11<?php
     2
     3$dTABLE = 40;
    24
    35function logintext () {
     
    126128    $ID['proj'] = $_GET[proj];
    127129    $ID['menu'] = $_GET[menu];
     130    $ID['from'] = $_GET[from];
    128131
    129132    if ($VERBOSE) {
     
    139142    $ID['proj'] = $_POST[proj];
    140143    $ID['menu'] = $_POST[menu];
     144    $ID['from'] = $_POST[from];
    141145
    142146    if ($VERBOSE) {
Note: See TracChangeset for help on using the changeset viewer.