IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2007, 3:21:41 PM (19 years ago)
Author:
eugene
Message:

updating to current db table layout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/ipp.php

    r11490 r12835  
    2828    echo "</form>\n";
    2929
     30    $db = dbconnect('ippadmin');
     31
     32    // make this a DB lookup
     33    $sql = "SELECT projname FROM projects";
     34
     35    $qry = $db->query($sql);
     36    if (DB::iserror($db)) {
     37      echo "<b>error reading project list</b><br>\n";
     38      menu_end();
     39    }
     40 
     41    echo "<table class=select>\n";
     42    echo "<tr class=select><th class=select> projects </th></tr>\n";
     43    while ($qry->fetchInto($row)) {
     44      echo "<tr class=select><td class=select> $row[0] </td></tr>\n";
     45    }
     46    echo "</table>\n";
     47
    3048    menu_end ();
    3149}
     
    3452
    3553  // connect to the database
     54  // these should be set on installation
    3655  require_once('DB.php');
    37   $db = DB::connect("mysql://ipp:ipp@alala/$database");
     56  $password = "ipp";
     57  $username = "ipp";
     58  $hostname = "alala";
     59  $db = DB::connect("mysql://$username:$password@$hostname/$database");
    3860  if (DB::iserror($db)) {
    3961    echo "<b>error accessing database</b><br>\n";
    40     echo "<b>tried mysql://ipp:ipp@localhost/ipp</b><br>\n";
     62    echo "<b>tried mysql://$username:$password@$hostname/$database</b><br>\n";
    4163    menu_end();
    4264  }
     
    5779  $db = dbconnect('ippadmin');
    5880
    59   // make this a DB lookup
     81  // get the users from the DB
    6082  $sql = "SELECT username FROM users WHERE username = '$username' AND password = '$password'";
    6183
     
    227249    }
    228250       
    229     $this = $_SERVER[SCRIPT_NAME];
     251    $thisname = $_SERVER[SCRIPT_NAME];
    230252    $page = "$root/" . $base;
    231     if ($page == $this) {
     253    if ($page == $thisname) {
    232254        $style = trim($line[1]);
    233255    } else {
Note: See TracChangeset for help on using the changeset viewer.