]> git.sur5r.net Git - u-boot/commitdiff
Update Hymod Board Database PHP code in "tools" directory
authorWolfgang Denk <wd@pollux.denx.de>
Fri, 12 Aug 2005 21:27:18 +0000 (23:27 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Fri, 12 Aug 2005 21:27:18 +0000 (23:27 +0200)
Patch by Murray Jensen, 01 Jul 2005

16 files changed:
CHANGELOG
tools/bddb/brlog.php
tools/bddb/browse.php
tools/bddb/create_tables.sql
tools/bddb/defs.php
tools/bddb/dodelete.php
tools/bddb/dodellog.php
tools/bddb/doedit.php
tools/bddb/doedlog.php
tools/bddb/donew.php
tools/bddb/donewlog.php
tools/bddb/edit.php
tools/bddb/edlog.php
tools/bddb/execute.php
tools/bddb/new.php
tools/bddb/newlog.php

index 5860117f2582b0e21617136ad67d15ed850ba71c..483135f94ea6fd75630f623f5ac761c79fccc037 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes for U-Boot 1.1.3:
 ======================================================================
 
+* Update Hymod Board Database PHP code in "tools" directory
+  Patch by Murray Jensen, 01 Jul 2005
+
 * Make "tr" command use POSIX compliant; export HOSTOS make variable
   Patch by Murray Jensen, 30 Jun 2005
 
index e95d694a9778dfa41be5c2e896b6bb6e7d22532d..fccfbd011c295c668cd675b134a65b33b2997ae4 100644 (file)
@@ -10,8 +10,9 @@
 
        pg_head("$bddb_label - Browse Board Log");
 
-       if (!isset($serno) || $serno == 0)
-               die("serial number not specified!");
+       $serno=intval($serno);
+       if ($serno == 0)
+               die("serial number not specified or invalid!");
 
        function print_cell($str) {
                if ($str == '')
 <hr></hr>
 <p></p>
 <?php
-       $limit=abs(isset($limit)?$limit:20);
-       $offset=abs(isset($offset)?$offset:0);
+       $limit=abs(isset($_REQUEST['limit'])?$_REQUEST['limit']:20);
+       $offset=abs(isset($_REQUEST['offset'])?$_REQUEST['offset']:0);
        $lr=mysql_query("select count(*) as n from log where serno=$serno");
        $lrow=mysql_fetch_array($lr);
        if($lrow['n']>$limit){
                $preoffset=max(0,$offset-$limit);
                $postoffset=$offset+$limit;
                echo "<table width=\"100%\">\n<tr align=center>\n";
-               printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
-               printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
+               printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
+               printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
                echo "</tr>\n</table>\n";
        }
        mysql_free_result($lr);
index 0e94f7d22d204bed51e7b7f9c912142757e58991..675dfab749d0ec58d675ad310b49e8f7a3bf0b63 100644 (file)
@@ -8,29 +8,31 @@
 
        require("defs.php");
 
-       if (!isset($verbose))
-               $verbose = 0;
+       $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:'';
 
-       if (!isset($serno))
-               $serno = 0;
+       $verbose=isset($_REQUEST['verbose'])?intval($_REQUEST['verbose']):0;
 
        pg_head("$bddb_label - Browse database" . ($verbose?" (verbose)":""));
 ?>
 <p></p>
 <?php
-       if ($serno == 0) {
-               $limit=abs(isset($limit)?$limit:20);
-               $offset=abs(isset($offset)?$offset:0);
+       $limit=isset($_REQUEST['limit'])?abs(intval($_REQUEST['limit'])):20;
+       $offset=isset($_REQUEST['offset'])?abs(intval($_REQUEST['offset'])):0;
+
+       if ($serno == '') {
+
                $lr=mysql_query("select count(*) as n from boards");
                $lrow=mysql_fetch_array($lr);
+
                if($lrow['n']>$limit){
                        $preoffset=max(0,$offset-$limit);
                        $postoffset=$offset+$limit;
-                       echo "<table width=\"100%\">\n<tr align=center>\n";
-                       printf("<td><%sa href=\"%s?offset=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
-                       printf("<td><%sa href=\"%s?offset=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
+                       echo "<table width=\"100%\">\n<tr>\n";
+                       printf("<td align=left><%sa href=\"%s?submit=Browse&offset=%d&verbose=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset, $verbose);
+                       printf("<td align=right><%sa href=\"%s?submit=Browse&offset=%d&verbose=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset, $offset);
                        echo "</tr>\n</table>\n";
                }
+
                mysql_free_result($lr);
        }
 ?>
 ?>
 </tr>
 <?php
-       if ($serno == 0)
-               $r=mysql_query("select * from boards order by serno limit $offset,$limit");
-       else
-               $r=mysql_query("select * from boards where serno=$serno");
+       $query = "select * from boards";
+       if ($serno != '') {
+               $pre = " where ";
+               foreach (preg_split("/[\s,]+/", $serno) as $s) {
+                       if (preg_match('/^[0-9]+$/',$s))
+                               $query .= $pre . "serno=" . $s;
+                       else if (preg_match('/^([0-9]+)-([0-9]+)$/',$s,$m)) {
+                               $m1 = intval($m[1]); $m2 = intval($m[2]);
+                               if ($m2 <= $m1)
+                                       die("bad serial number range ($s)");
+                               $query .= $pre . "(serno>=$m[1] and serno<=$m[2])";
+                       }
+                       else
+                               die("illegal serial number ($s)");
+                       $pre = " or ";
+               }
+       }
+       $query .= " order by serno";
+       if ($serno == '')
+               $query .= " limit $offset,$limit";
+
+       $r = mysql_query($query);
 
        function print_cell($str) {
                if ($str == '')
 <table width="100%">
 <tr>
   <td align=center><?php
-       if ($verbose)
-               echo "<a href=\"browse.php?verbose=0\">Terse Listing</a>";
-       else
-               echo "<a href=\"browse.php?verbose=1\">Verbose Listing</a>";
+       printf("<a href=\"%s?submit=Browse&offset=%d&verbose=%d%s\">%s Listing</a>\n", $PHP_SELF, $offset, $verbose?0:1, $serno!=''?"&serno=$serno":'', $verbose?"Terse":"Verbose");
   ?></td>
   <td align=center><a href="index.php">Back to Start</a></td>
 </tr>
index 4c25dd138e1af232903b0ccc8540a11e171e62ec..a2a578867fd7e3ab16c2302f16ed391c32d76b79 100644 (file)
@@ -22,38 +22,38 @@ CREATE TABLE boards (
    rev tinyint(3) unsigned zerofill NOT NULL,
    location char(64),
    comments text,
-   sdram0 enum('32M','64M','128M','256M'),
-   sdram1 enum('32M','64M','128M','256M'),
-   sdram2 enum('32M','64M','128M','256M'),
-   sdram3 enum('32M','64M','128M','256M'),
-   flash0 enum('4M','8M','16M','32M','64M'),
-   flash1 enum('4M','8M','16M','32M','64M'),
-   flash2 enum('4M','8M','16M','32M','64M'),
-   flash3 enum('4M','8M','16M','32M','64M'),
-   zbt0 enum('512K','1M','2M','4M'),
-   zbt1 enum('512K','1M','2M','4M'),
-   zbt2 enum('512K','1M','2M','4M'),
-   zbt3 enum('512K','1M','2M','4M'),
-   zbt4 enum('512K','1M','2M','4M'),
-   zbt5 enum('512K','1M','2M','4M'),
-   zbt6 enum('512K','1M','2M','4M'),
-   zbt7 enum('512K','1M','2M','4M'),
-   zbt8 enum('512K','1M','2M','4M'),
-   zbt9 enum('512K','1M','2M','4M'),
-   zbta enum('512K','1M','2M','4M'),
-   zbtb enum('512K','1M','2M','4M'),
-   zbtc enum('512K','1M','2M','4M'),
-   zbtd enum('512K','1M','2M','4M'),
-   zbte enum('512K','1M','2M','4M'),
-   zbtf enum('512K','1M','2M','4M'),
-   xlxtyp0 enum('XCV300E','XCV400E','XCV600E'),
-   xlxtyp1 enum('XCV300E','XCV400E','XCV600E'),
-   xlxtyp2 enum('XCV300E','XCV400E','XCV600E'),
-   xlxtyp3 enum('XCV300E','XCV400E','XCV600E'),
-   xlxspd0 enum('6','7','8'),
-   xlxspd1 enum('6','7','8'),
-   xlxspd2 enum('6','7','8'),
-   xlxspd3 enum('6','7','8'),
+   sdram0 enum('32M','64M','128M','256M','512M','1G','2G','4G'),
+   sdram1 enum('32M','64M','128M','256M','512M','1G','2G','4G'),
+   sdram2 enum('32M','64M','128M','256M','512M','1G','2G','4G'),
+   sdram3 enum('32M','64M','128M','256M','512M','1G','2G','4G'),
+   flash0 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'),
+   flash1 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'),
+   flash2 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'),
+   flash3 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'),
+   zbt0 enum('512K','1M','2M','4M','8M','16M'),
+   zbt1 enum('512K','1M','2M','4M','8M','16M'),
+   zbt2 enum('512K','1M','2M','4M','8M','16M'),
+   zbt3 enum('512K','1M','2M','4M','8M','16M'),
+   zbt4 enum('512K','1M','2M','4M','8M','16M'),
+   zbt5 enum('512K','1M','2M','4M','8M','16M'),
+   zbt6 enum('512K','1M','2M','4M','8M','16M'),
+   zbt7 enum('512K','1M','2M','4M','8M','16M'),
+   zbt8 enum('512K','1M','2M','4M','8M','16M'),
+   zbt9 enum('512K','1M','2M','4M','8M','16M'),
+   zbta enum('512K','1M','2M','4M','8M','16M'),
+   zbtb enum('512K','1M','2M','4M','8M','16M'),
+   zbtc enum('512K','1M','2M','4M','8M','16M'),
+   zbtd enum('512K','1M','2M','4M','8M','16M'),
+   zbte enum('512K','1M','2M','4M','8M','16M'),
+   zbtf enum('512K','1M','2M','4M','8M','16M'),
+   xlxtyp0 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'),
+   xlxtyp1 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'),
+   xlxtyp2 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'),
+   xlxtyp3 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'),
+   xlxspd0 enum('6','7','8','4','5','9','10','11','12'),
+   xlxspd1 enum('6','7','8','4','5','9','10','11','12'),
+   xlxspd2 enum('6','7','8','4','5','9','10','11','12'),
+   xlxspd3 enum('6','7','8','4','5','9','10','11','12'),
    xlxtmp0 enum('COM','IND'),
    xlxtmp1 enum('COM','IND'),
    xlxtmp2 enum('COM','IND'),
@@ -62,13 +62,13 @@ CREATE TABLE boards (
    xlxgrd1 enum('NORMAL','ENGSAMP'),
    xlxgrd2 enum('NORMAL','ENGSAMP'),
    xlxgrd3 enum('NORMAL','ENGSAMP'),
-   cputyp enum('MPC8260'),
-   cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ'),
-   cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ'),
-   busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ'),
-   hstype enum('AMCC-S2064A'),
-   hschin enum('0','1','2','3','4'),
-   hschout enum('0','1','2','3','4'),
+   cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)','MPC8560'),
+   cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'),
+   cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'),
+   busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'),
+   hstype enum('AMCC-S2064A','Xilinx-Rockets'),
+   hschin enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'),
+   hschout enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'),
    PRIMARY KEY (serno),
    KEY serno (serno),
    UNIQUE serno_2 (serno)
index be8a3b97d73e73f07e61003c7c3716511889ace1..b7518e3f797554b32b4b70300c23368572932aa9 100644 (file)
@@ -7,7 +7,7 @@
        // contains mysql user id and password - keep secret
        require("config.php");
 
-       if (isset($logout)) {
+       if (isset($_REQUEST['logout'])) {
                Header("status: 401 Unauthorized");
                Header("HTTP/1.0 401 Unauthorized");
                Header("WWW-authenticate: basic realm=\"$bddb_label\"");
        // board type
        $type_vals = array('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY');
 
-       // sdram sizes (nbits array is for write into eeprom config file)
-       $sdram_vals = array('','32M','64M','128M','256M');
-       $sdram_nbits = array(0,25,26,27,28);
+       // Xilinx fpga types
+       $xlxtyp_vals = array('','XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140');
 
-       // flash sizes (nbits array is for write into eeprom config file)
-       $flash_vals = array('','4M','8M','16M','32M','64M');
-       $flash_nbits = array(0,22,23,24,25,26);
+       // Xilinx fpga speeds
+       $xlxspd_vals = array('','6','7','8','4','5','9','10','11','12');
 
-       // zbt ram sizes (nbits array is for write into eeprom config file)
-       $zbt_vals = array('','512K','1M','2M','4M');
-       $zbt_nbits = array(0,19,20,21,22);
-
-       // Xilinx attributes
-       $xlxtyp_vals = array('','XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000');
-       $xlxspd_vals = array('','6','7','8','4','5');
+       // Xilinx fpga temperatures (commercial or industrial)
        $xlxtmp_vals = array('','COM','IND');
+
+       // Xilinx fpga grades (normal or engineering sample)
        $xlxgrd_vals = array('','NORMAL','ENGSAMP');
 
-       // processor attributes
-       $cputyp_vals = array('','MPC8260');
-       $clk_vals = array('','33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ');
+       // CPU types
+       $cputyp_vals = array('','MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)','MPC8560');
+
+       // CPU/BUS/CPM clock speeds 
+       $clk_vals = array('','33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ');
+
+       // sdram sizes (nbits array is for eeprom config file)
+       $sdram_vals = array('','32M','64M','128M','256M','512M','1G','2G','4G');
+       $sdram_nbits = array(0,25,26,27,28,29,30,31,32);
+
+       // flash sizes (nbits array is for eeprom config file)
+       $flash_vals = array('','4M','8M','16M','32M','64M','128M','256M','512M','1G');
+       $flash_nbits = array(0,22,23,24,25,26,27,28,29,30);
+
+       // zbt ram sizes (nbits array is for write into eeprom config file)
+       $zbt_vals = array('','512K','1M','2M','4M','8M','16M');
+       $zbt_nbits = array(0,19,20,21,22,23,24);
 
        // high-speed serial attributes
-       $hstype_vals = array('','AMCC-S2064A');
-       $hschin_vals = array('0','1','2','3','4');
-       $hschout_vals = array('0','1','2','3','4');
+       $hstype_vals = array('','AMCC-S2064A','Xilinx-Rockets');
+       $hschin_vals = array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16');
+       $hschout_vals = array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16');
 
        // value filters - used when outputting html
        function rev_filter($num) {
                end_field();
        }
 
+       // print a mysql ENUM as an html SELECT INPUT
+       function print_enum_select($name, $array, $vals, $def = -1) {
+
+               begin_field($name);
+
+               echo "\t\t<select name=$name>\n";
+
+               if (key_in_array($name, $array))
+                       $chk = array_search($array[$name], $vals, FALSE);
+               else
+                       $chk = $def;
+
+               $nval = count($vals);
+
+               for ($i = 0; $i < $nval; $i++) {
+
+                       $val = $vals[$i];
+                       if ($val == '')
+                               $pval = "none";
+                       else
+                               $pval = "$val";
+
+                       printf("\t\t\t<option " .
+                               "value=\"%s\"%s>%s</option>\n",
+                               $val, $i == $chk ? " selected" : "", $pval);
+               }
+
+               echo "\t\t</select>\n";
+
+               end_field();
+       }
+
        // print a group of mysql ENUMs (e.g. name0,name1,...) as an html SELECT
        function print_enum_multi($base, $array, $vals, $cnt, $defs, $grp = 0) {
 
 
                        $name = sprintf("%s%x", $base, $i);
 
-                       if (isset($GLOBALS[$name])) {
+                       if (isset($_REQUEST[$name])) {
                                $retval .= sprintf(", %s='%s'",
-                                       $name, $GLOBALS[$name]);
+                                       $name, $_REQUEST[$name]);
                        }
                }
 
 
                        $name = sprintf("%s%x", $base, $i);
 
-                       if (isset($GLOBALS[$name]))
+                       if (isset($_REQUEST[$name]))
                                $retval++;
                }
 
 
        function gen_eth_addr($serno) {
 
-               $ethaddr_high = (mt_rand(0, 65535) & 0xfeff) | 0x0200;
-               $ethaddr_low = mt_rand(0, 4294967295);
+               $ethaddr_hgh = (mt_rand(0, 65535) & 0xfeff) | 0x0200;
+               $ethaddr_mid = mt_rand(0, 65535);
+               $ethaddr_low = mt_rand(0, 65535);
 
                return sprintf("%02lx:%02lx:%02lx:%02lx:%02lx:%02lx",
-                       $ethaddr_high >> 8, $ethaddr_high & 0xff,
-                       $ethaddr_low >> 24, ($ethaddr_low >> 16) & 0xff,
-                       ($ethaddr_low >> 8) & 0xff, $ethaddr_low & 0xff);
+                       $ethaddr_hgh >> 8, $ethaddr_hgh & 0xff,
+                       $ethaddr_mid >> 8, $ethaddr_mid & 0xff,
+                       $ethaddr_low >> 8, $ethaddr_low & 0xff);
        }
 
        // check that an ethernet address is valid
index f1567d2d891bc5c35a932f14bc36238f4bc41cc4..4839e36e60e3acad6cf1758dffb9ca7c15616390 100644 (file)
@@ -10,8 +10,9 @@
 
        pg_head("$bddb_label - Delete Board Results");
 
-       if (!($serno=intval($serno)))
+       if (!isset($_REQUEST['serno']))
                die("the board serial number was not specified");
+       $serno=intval($_REQUEST['serno']);
 
        mysql_query("delete from boards where serno=$serno");
 
index 5942ec9a520b006d73a486c6503c279501bd7e4f..9dd78c11b6d0f313ccc5b8e04a2d5bfdaad2fedd 100644 (file)
 
        pg_head("$bddb_label - Delete Log Entry Results");
 
-       if (!($serno=intval($serno)))
+       if (!isset($_REQUEST['serno']))
                die("the board serial number was not specified");
+       $serno=intval($_REQUEST['serno']);
 
-       if (!isset($logno) || $logno == 0)
+       if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == 0)
                die("the log entry number not specified!");
+       $logno=$_REQUEST['logno'];
 
        mysql_query("delete from log where serno=$serno and logno=$logno");
 
index a46ea10cb6893f4c3835837a6b077eb3bb2e2ea1..13fbb694790f7a775d1a7acaaf270d05c6df4d66 100644 (file)
 
        pg_head("$bddb_label - Edit Board Results");
 
-       if ($serno == 0)
+       if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
                die("the board serial number was not specified");
+       $serno=intval($_REQUEST['serno']);
 
        $query="update boards set";
 
-       if (isset($ethaddr)) {
+       if (isset($_REQUEST['ethaddr'])) {
+               $ethaddr=$_REQUEST['ethaddr'];
                if (!eth_addr_is_valid($ethaddr))
                        die("ethaddr is invalid ('$ethaddr')");
                $query.=" ethaddr='$ethaddr',";
        }
 
-       if (isset($date)) {
+       if (isset($_REQUEST['date'])) {
+               $date=$_REQUEST['date'];
                list($y, $m, $d) = split("-", $date);
                if (!checkdate($m, $d, $y) || $y < 1999)
                        die("date is invalid (input '$date', " .
                $query.=" date='$date'";
        }
 
-       if (isset($batch)) {
+       if (isset($_REQUEST['batch'])) {
+               $batch=$_REQUEST['batch'];
                if (strlen($batch) > 32)
                        die("batch field too long (>32)");
                $query.=", batch='$batch'";
        }
 
-       if (isset($type)) {
+       if (isset($_REQUEST['type'])) {
+               $type=$_REQUEST['type'];
                if (!in_array($type, $type_vals))
                        die("Invalid type ($type) specified");
                $query.=", type='$type'";
        }
 
-       if (isset($rev)) {
+       if (isset($_REQUEST['rev'])) {
+               $rev=$_REQUEST['rev'];
                if (($rev = intval($rev)) <= 0 || $rev > 255)
                        die("Revision number is invalid ($rev)");
                $query.=sprintf(", rev=%d", $rev);
        }
 
-       if (isset($location)) {
+       if (isset($_REQUEST['location'])) {
+               $location=$_REQUEST['location'];
                if (strlen($location) > 64)
                        die("location field too long (>64)");
                $query.=", location='$location'";
        }
 
-       if (isset($comments))
+       if (isset($_REQUEST['comments']))
+               $comments=$_REQUEST['comments'];
                $query.=", comments='" . rawurlencode($comments) . "'";
 
        $query.=gather_enum_multi_query("sdram", 4);
        if (count_enum_multi("xlxgrd", 4) != $nxlx)
                die("number of xilinx grades not same as number of types");
 
-       if (isset($cputyp)) {
+       if (isset($_REQUEST['cputyp'])) {
+               $cputyp=$_REQUEST['cputyp'];
                $query.=", cputyp='$cputyp'";
-               if ($cpuspd == '')
+               if (!isset($_REQUEST['cpuspd']) || $_REQUEST['cpuspd'] == '')
                        die("must specify cpu speed if cpu type is defined");
+               $cpuspd=$_REQUEST['cpuspd'];
                $query.=", cpuspd='$cpuspd'";
-               if ($cpmspd == '')
+               if (!isset($_REQUEST['cpmspd']) || $_REQUEST['cpmspd'] == '')
                        die("must specify cpm speed if cpu type is defined");
+               $cpmspd=$_REQUEST['cpmspd'];
                $query.=", cpmspd='$cpmspd'";
-               if ($busspd == '')
+               if (!isset($_REQUEST['busspd']) || $_REQUEST['busspd'] == '')
                        die("must specify bus speed if cpu type is defined");
+               $busspd=$_REQUEST['busspd'];
                $query.=", busspd='$busspd'";
        }
        else {
-               if (isset($cpuspd))
+               if (isset($_REQUEST['cpuspd']))
                        die("can't specify cpu speed if there is no cpu");
-               if (isset($cpmspd))
+               if (isset($_REQUEST['cpmspd']))
                        die("can't specify cpm speed if there is no cpu");
-               if (isset($busspd))
+               if (isset($_REQUEST['busspd']))
                        die("can't specify bus speed if there is no cpu");
        }
 
-       if (isset($hschin)) {
+       if (isset($_REQUEST['hschin'])) {
+               $hschin=$_REQUEST['hschin'];
                if (($hschin = intval($hschin)) < 0 || $hschin > 4)
                        die("Invalid number of hs input chans ($hschin)");
        }
        else
                $hschin = 0;
-       if (isset($hschout)) {
+       if (isset($_REQUEST['hschout'])) {
+               $hschout=$_REQUEST['hschout'];
                if (($hschout = intval($hschout)) < 0 || $hschout > 4)
                        die("Invalid number of hs output chans ($hschout)");
        }
        else
                $hschout = 0;
-       if (isset($hstype))
+       if (isset($_REQUEST['hstype'])) {
+               $hstype=$_REQUEST['hstype'];
                $query.=", hstype='$hstype'";
+       }
        else {
-               if ($hschin != 0)
+               if ($_REQUEST['hschin'] != 0)
                        die("number of high-speed input channels must be zero"
                                . " if high-speed chip is not present");
-               if ($hschout != 0)
+               if ($_REQUEST['hschout'] != 0)
                        die("number of high-speed output channels must be zero"
                                . " if high-speed chip is not present");
        }
index 21e50b0e189aee52326f7f089a8c934a08978984..7009aa7dad15a97535f0a0cfc37626b01dd473e6 100644 (file)
 
        pg_head("$bddb_label - Edit Log Entry Results");
 
-       if ($serno == 0)
+       if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
                die("the board serial number was not specified");
+       $serno=intval($_REQUEST['serno']);
 
-       if (!isset($logno) || $logno == 0)
+       if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '')
                die("log number not specified!");
+       $logno=intval($_REQUEST['logno']);
 
        $query="update log set";
 
-       if (isset($date)) {
+       if (isset($_REQUEST['date'])) {
+               $date=$_REQUEST['date'];
                list($y, $m, $d) = split("-", $date);
                if (!checkdate($m, $d, $y) || $y < 1999)
                        die("date is invalid (input '$date', " .
                $query.=" date='$date'";
        }
 
-       if (isset($who))
+       if (isset($_REQUEST['who'])) {
+               $who=$_REQUEST['who'];
                $query.=", who='" . $who . "'";
+       }
 
-       if (isset($details))
+       if (isset($_REQUEST['details'])) {
+               $details=$_REQUEST['details'];
                $query.=", details='" . rawurlencode($details) . "'";
+       }
 
        $query.=" where serno=$serno and logno=$logno";
 
index b1288d68a3528b866a9ebdd38f7c2c7d0775b00a..39b2c78fcae1970b8a431b19040f04145f673dd0 100644 (file)
 
        pg_head("$bddb_label - Board Registration Results");
 
-       if (($serno=intval($serno)) != 0)
+       if (isset($_REQUEST['serno'])) {
+               $serno=$_REQUEST['serno'];
                die("serial number must not be set ($serno) when Creating!");
+       }
 
        $query="update boards set";
 
index c3b960650f2b0a3da536d5345f6123f06ff8d462..7635d2992d9d3c471c79cced9ef0e3c0f33fe858 100644 (file)
 
        pg_head("$bddb_label - Add Log Entry Results");
 
-       if ($serno == 0)
+       if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
                die("serial number not specified!");
+       $serno=intval($_REQUEST['serno']);
 
-       if (isset($logno))
+       if (isset($_REQUEST['logno'])) {
+               $logno=$_REQUEST['logno'];
                die("log number must not be set ($logno) when Creating!");
+       }
 
        $query="update log set serno=$serno";
 
                die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')");
        $query.=", date='$date'";
 
-       if (isset($who))
+       if (isset($_REQUEST['who'])) {
+               $who=$_REQUEST['who'];
                $query.=", who='" . $who . "'";
+       }
 
-       if (isset($details))
+       if (isset($_REQUEST['details'])) {
+               $details=$_REQUEST['details'];
                $query.=", details='" . rawurlencode($details) . "'";
+       }
 
        // echo "final query = '$query'<br>\n";
 
index 155e848659f43ab4507cce34d073a2415e41e75d..dd8c26c5cd356288ee5539a656c5d21e56bfd0a9 100644 (file)
@@ -11,7 +11,7 @@
        pg_head("$bddb_label - Edit Board Registration");
 
        if ($serno == 0)
-               die("serial number not specified!");
+               die("serial number not specified or invalid!");
 
        $pserno = sprintf("%010d", $serno);
 
        // xlxgrd[0-3] enum('NORMAL','ENGSAMP')
        print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(), 1);
 
-       // cputyp enum('MPC8260')
+       // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)')
        print_enum("cputyp", $row, $cputyp_vals);
 
-       // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("cpuspd", $row, $clk_vals);
+       // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("cpuspd", $row, $clk_vals);
 
-       // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("cpmspd", $row, $clk_vals);
+       // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("cpmspd", $row, $clk_vals);
 
-       // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("busspd", $row, $clk_vals);
+       // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("busspd", $row, $clk_vals);
 
        // hstype enum('AMCC-S2064A')
        print_enum("hstype", $row, $hstype_vals);
index 375dca32405486c8facf5d0b20605d74d091e141..8befd35b92475592958d021508b0bad615215318 100644 (file)
 
        pg_head("$bddb_label - Edit Board Log Entry");
 
-       if ($serno == 0)
+       if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
                die("serial number not specified!");
+       $serno=intval($_REQUEST['serno']);
 
-       if (!isset($logno) || $logno == 0)
+       if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '')
                die("log number not specified!");
+       $logno=intval($_REQUEST['logno']);
 
        $pserno = sprintf("%010d", $serno);
        $plogno = sprintf("%010d", $logno);
index 4cc87c7a4d1e852c5bbb3d95d132864d3d39351b..0b62882d75135bead4e54dc3908f28d1633bcd9d 100644 (file)
@@ -4,13 +4,9 @@
        // Murray Jensen <Murray.Jensen@csiro.au>
        // CSIRO Manufacturing Science and Technology, Preston Lab
 
-       if (!isset($serno))
-               $serno = 0;
-       else
-               $serno = intval($serno);
+       $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:'';
 
-       if (!isset($submit))
-               $submit = "[NOT SET]";
+       $submit=isset($_REQUEST['submit'])?$_REQUEST['submit']:"[NOT SET]";
 
        switch ($submit) {
 
index 618194cea1f25b68269c52a3f0841ae17ac1a045..30323ff8192117494ad67496c878a37920ae6621 100644 (file)
@@ -13,6 +13,7 @@
 <form action=donew.php method=POST>
 <p></p>
 <?php
+       $serno=intval($serno);
        // if a serial number was supplied, fetch the record
        // and use its contents as defaults
        if ($serno != 0) {
@@ -23,8 +24,6 @@
        else
                $row = array();
 
-       echo "<input type=hidden name=serno value=0>\n";
-
        begin_table(5);
 
        // date date
        // xlxgrd[0-3] enum('NORMAL','ENGSAMP')
        print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(1), 1);
 
-       // cputyp enum('MPC8260')
+       // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)')
        print_enum("cputyp", $row, $cputyp_vals, 1);
 
-       // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("cpuspd", $row, $clk_vals, 4);
+       // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("cpuspd", $row, $clk_vals, 4);
 
-       // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("cpmspd", $row, $clk_vals, 4);
+       // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("cpmspd", $row, $clk_vals, 4);
 
-       // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ')
-       print_enum("busspd", $row, $clk_vals, 2);
+       // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ')
+       print_enum_select("busspd", $row, $clk_vals, 2);
 
        // hstype enum('AMCC-S2064A')
        print_enum("hstype", $row, $hstype_vals, 1);
index 70f62ff49d9e76dbeef8235ba570e1e0c0238e95..609bb855c5ad5863d312548d9609593da1ab13a2 100644 (file)
 
        pg_head("$bddb_label - New Log Entry");
 
-       if ($serno == 0)
-               die("serial number not specified!");
-
-       if (isset($logno))
-               die("log number must not be specified when adding!");
+       if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
+               die("serial number not specified or invalid!");
+       $serno=intval($_REQUEST['serno']);
+
+       if (isset($_REQUEST['logno'])) {
+               $logno=$_REQUEST['logno'];
+               die("log number must not be specified when adding! ($logno)");
+       }
 ?>
 <form action=donewlog.php method=POST>
 <p></p>
@@ -27,7 +30,7 @@
        print_field("date", array('date' => date("Y-m-d")));
 
        // who char(20)
-       print_field("who", "");
+       print_field("who", array());
 
        // details text
        print_field_multiline("details", array(), 60, 10, 'text_filter');