diff options
author | Marek Vasut <marex@denx.de> | 2014-10-22 21:34:48 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2014-10-27 14:35:55 +0100 |
commit | 5038d7f189267004d924e827cf51d7520d65e42b (patch) | |
tree | 90b84cc661c559ae4878c0775cd135d32f5baa9c /tools | |
parent | 1655f9f6c73c2b4b5d3f3b3c8aab999c194d8486 (diff) | |
download | u-boot-5038d7f189267004d924e827cf51d7520d65e42b.zip u-boot-5038d7f189267004d924e827cf51d7520d65e42b.tar.gz u-boot-5038d7f189267004d924e827cf51d7520d65e42b.tar.bz2 |
ppc: Zap Hymod board
Remove this board as this is the only one last user of eeprom_probe(),
which is pretty non-standard stuff.
This patch also removes all the PHP, SQL and CSS stuff from U-Boot,
which probably makes U-Boot a bit less IoT ;-)
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bddb/README | 116 | ||||
-rw-r--r-- | tools/bddb/badsubmit.php | 23 | ||||
-rw-r--r-- | tools/bddb/bddb.css | 207 | ||||
-rw-r--r-- | tools/bddb/brlog.php | 109 | ||||
-rw-r--r-- | tools/bddb/browse.php | 147 | ||||
-rw-r--r-- | tools/bddb/config.php | 16 | ||||
-rw-r--r-- | tools/bddb/create_tables.sql | 90 | ||||
-rw-r--r-- | tools/bddb/defs.php | 710 | ||||
-rw-r--r-- | tools/bddb/dodelete.php | 65 | ||||
-rw-r--r-- | tools/bddb/dodellog.php | 57 | ||||
-rw-r--r-- | tools/bddb/doedit.php | 186 | ||||
-rw-r--r-- | tools/bddb/doedlog.php | 76 | ||||
-rw-r--r-- | tools/bddb/donew.php | 230 | ||||
-rw-r--r-- | tools/bddb/donewlog.php | 86 | ||||
-rw-r--r-- | tools/bddb/edit.php | 131 | ||||
-rw-r--r-- | tools/bddb/edlog.php | 86 | ||||
-rw-r--r-- | tools/bddb/execute.php | 33 | ||||
-rw-r--r-- | tools/bddb/index.php | 38 | ||||
-rw-r--r-- | tools/bddb/new.php | 120 | ||||
-rw-r--r-- | tools/bddb/newlog.php | 54 |
20 files changed, 0 insertions, 2580 deletions
diff --git a/tools/bddb/README b/tools/bddb/README deleted file mode 100644 index 9bee59a..0000000 --- a/tools/bddb/README +++ /dev/null @@ -1,116 +0,0 @@ -Hymod Board Database - -(C) Copyright 2001 -Murray Jensen <Murray.Jensen@csiro.au> -CSIRO Manufacturing Science and Technology, Preston Lab - -25-Jun-01 - -This stuff is a set of PHP/MySQL scripts to implement a custom board -database. It will need *extensive* hacking to modify it to keep the -information about your custom boards that you want, however it is a good -starting point. - -How it is used: - - 1. a board has gone through all the hardware testing etc and is - ready to have the flash programmed for the first time - first you - go to a web page and fill in information about the board in a form - to register it in a database - - 2. the web stuff allocates a (unique) serial number and (optionally) - a (locally administered) ethernet address and stores the information - in a database using the serial number as the key (can do whole - batches of boards in one go and/or use a previously registered board - as defaults for the new board(s)) - - 3. it then creates a file in the tftp area of a server somewhere - containing the board information in a simple text format (one - per serial number) - - 4. all hymod boards have an i2c eeprom, and when U-Boot sees that - the eeprom is unitialised, it prompts for a serial number and - ethernet address (if not set), then transfers the file created - in step 3 from the server and initialises the eeprom from its - contents - -What this means is you can't boot the board until you have allocated a serial -number, but you don't have to type it all twice - you do it once on the web -and the board then finds the info it needs to initialise its eeprom. The -other side of the coin is the reading of the eeprom and how it gets passed -to Linux (or another O/S). - -To see how this is all done for the hymod boards look at the code in the -"board/hymod" directory and in the file "include/asm/hymod.h". Hymod boards -can have a mezzanine card which also have an eeprom that needs allocating, -the same process is used for these as well - just a different i2c address. - -Other forms provide the following functions: - - - browsing the board database - - editing board information (one at a time) - - maintaining/browsing a (simple) per board event log - -You will need: MySQL (I use version 3.23.7-alpha), PHP4 (with MySQL -support enabled) and a web server (I use Apache 1.3.x). - -I originally started by using phpMyBuilder (http://kyber.dk/phpMyBuilder) -but it soon got far more complicated than that could handle (but I left -the copyright messages in there anyway). Most of the code resides in the -common defs.php file, which shouldn't need much alteration - all the work -will be in shaping the front-end php files to your liking. - -Here's a quick summary of what needs doing to use it for your boards: - -1. get phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/) - it's an - invaluable tool for this sort of stuff (this step is optional of course) - -2. edit "bddb.css" to your taste, if you could be bothered - I have no - idea what is in there or what it does - I copied it from somewhere else - ("user.css" from the phpMyEdit (http://phpmyedit.sourcerforge.net) package, - I think) - I figure one day I'll see what sort of things I can change - in there. - -3. create a mysql database - call it whatever you like - -4. edit "create_tables.sql" and modify the "boards" table schema to - reflect the information you want to keep about your boards. It may or - may not be easier to do this and the next step in phpMyAdmin. Check out - the MySQL documentation at http://www.mysql.com/doc/ in particular the - column types at http://www.mysql.com/doc/C/o/Column_types.html - Note - there is only support for a few data types: - - int - presented as an html text input - char/text - presented as an html text input - date - presented as an html text input - enum - presented as an html radio input - - I also have what I call "enum_multi" which is a set of enums with the - same name, but suffixed with a number e.g. fred0, fred1, fred2. These - are presented as a number of html select's with a single label "fred" - this is useful for board characteristics that have multiple items of - the same type e.g. multiple banks of sdram. - -5. use the "create_tables.sql" file to create the "boards" table in the - database e.g. mysql dbname < create_tables.sql - -6. create a user and password for the web server to log into the MySQL - database with; give this user select, insert and update privileges - to the database created in 3 (and delete, if you want the "delete" - functions in the edit forms to work- I have this turned off). phpMyAdmin - helps in this step. - -7. edit "config.php" and set the variables: $mysql_user, $mysql_pw, $mysql_db, - $bddb_cfgdir and $bddb_label - keep the contents of this file secret - it - contains the web servers username and password (the three $mysql_* vars - are set from the previous step) - -8. edit "defs.php" and a. adjust the various enum value arrays and b. edit - the function "pg_foot()" to remove my email address :-) - -9. do major hacking on the following files: browse.php, doedit.php, donew.php, - edit.php and new.php to reflect your database schema - fortunately the - hacking is fairly straight-forward, but it is boring and time-consuming. - -These notes were written rather hastily - if you find any obvious problems -please let me know. diff --git a/tools/bddb/badsubmit.php b/tools/bddb/badsubmit.php deleted file mode 100644 index 5092a31..0000000 --- a/tools/bddb/badsubmit.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - require("defs.php"); - pg_head("$bddb_label - Unknown Submit Type"); -?> -<center> - <font size="+4"> - <b> - The <?php echo "$bddb_label"; ?> form was submitted with an - unknown SUBMIT type <?php echo "(value was '$submit')" ?>. - <br></br> - Perhaps you typed the URL in directly? Click here to go to the - home page of the <a href="index.php"><?php echo "$bddb_label"; ?></a>. - </b> - </font> -</center> -<?php - pg_foot(); -?> diff --git a/tools/bddb/bddb.css b/tools/bddb/bddb.css deleted file mode 100644 index dee2b2e..0000000 --- a/tools/bddb/bddb.css +++ /dev/null @@ -1,207 +0,0 @@ -BODY { - background: #e0ffff; - color: #000000; - font-family: Arial, Verdana, Helvetica; -} -H1 { - font-family: "Copperplate Gothic Bold"; - background: transparent; - color: #993300; - text-align: center; -} -H2, H3, H4, H5 { - background: transparent; - color: #993300; - margin-top: 4%; - text-align: center; -} -Body.Plain Div.Abstract, Body.Plain P.Abstract { - background: #cccc99; - color: #333300; - border: white; - padding: 3%; - font-family: Times, Verdana; -} -TH.Nav { - background: #0000cc; - color: #ff9900; -} -TH.Menu { - background: #3366cc; - color: #ff9900; -} -A:hover { - color: #ff6600; -} -A.Menu:hover { - color: #ff6600; -} -A.HoMe:hover { - color: #ff6600; -} -A.Menu { - background: transparent; - color: #ffcc33; - font-family: Verdana, Helvetica, Arial; - font-size: smaller; - text-decoration: none; -} -A.Menu:visited { - background: transparent; - color: #ffcc99; -} -A.HoMe { - background: transparent; - color: #ffcc33; - font-family: Verdana, Helvetica, Arial; - text-decoration:none; -} -A.HoMe:visited { - background: transparent; - color: #ffcc99; -} -TH.Xmp { - background: #eeeeee; - color: #330066; - font-family: courier; - font-weight: normal; -} -TH.LuT { - background: #cccccc; - color: #000000; -} -TD.LuT { - background: #ffffcc; - color: #000000; - font-size: 85%; -} -TH.Info, TD.Info { - background: #ffffcc; - color: #660000; - font-family: "Comic Sans MS", Cursive, Verdana; - font-size: smaller; -} -Div.Info, P.Info { - background: #ffff99; - color: #990033; - text-align: left; - padding: 2%; - font-family: "Comic Sans MS", Cursive, Verdana; - font-size: 85%; - } -Div.Info A { - background: transparent; - color: #ff6600; -} -.HL { - background: #ffff99; - color: #000000; -} -TD.HL { - background: #ccffff; - color: #000000; -} -Div.Margins { - width: 512px; - text-align: center; -} -TD.Plain { - background: #ffffcc; - color: #000033; -} -.Type { - background: #cccccc; - color: #660000; -} -.Name { - background: #eeeeee; - color: #660000; - vertical-align: top; - text-align: right; -} -.Value { - background: #ffffee; - color: #000066; -} -.Drop { - background: #333366; - color: #ffcc33; - font-family: "Copperplate Gothic Light", Helvetica, Verdana, Arial; -} -A.Button:hover { - color: #ff6600; -} -A.Button { - text-decoration:none; - color: #003366; - background: #ffcc66; -} -.Button { - font-size: 9pt; - text-align: center; - text-decoration:none; - color: #003366; - background: #ffcc66; - margin-bottom: 2pt; - border-top: 2px solid #ffff99; - border-left: 2px solid #ffff99; - border-right: 2px solid #cc9933; - border-bottom: 2px solid #cc9933; - font-family: Verdana, Arial, "Comic Sans MS"; -} -.Banner { - width: 468; - font-size: 12pt; - text-align: center; - text-decoration:none; - color: #003366; - background: #ffcc66; - border-top: 4px solid #ffff99; - border-left: 4px solid #ffff99; - border-right: 4px solid #cc9933; - border-bottom: 4px solid #cc9933; - font-family: Verdana, Arial, "Comic Sans MS"; -} -TD.Nova, Body.Nova { - background: #000000; - font-family: "Times New Roman"; - font-weight: light; - color: #ffcc00; -} -Body.Nova A.Button { - background: gold; - color: #003366; -} -Body.Nova A.Banner { - background: transparent; - color: #003366; -} -Body.Nova A { - background: transparent; - text-decoration:none; - color: #ffd766; -} -Body.Nova H1, Body.Nova H2, Body.Nova H3, Body.Nova H4 { - background: transparent; - color: white; - margin-top: 4%; - text-align: center; - filter: Blur(Add=1, Direction=0, Strength=8); -} -Body.Nova Div.Abstract { - background: #000000; - color: #ffffff; - font-family: Times, Verdana; -} -Body.Nova A.Abstract { - background: transparent; - color: #ffeedd; -} -Body.Nova TH.LuT { - background: black; - color: #ffff99; -} -Body.Nova TD.LuT { - background: navy; - color: #ffff99; -} diff --git a/tools/bddb/brlog.php b/tools/bddb/brlog.php deleted file mode 100644 index fccfbd0..0000000 --- a/tools/bddb/brlog.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // list page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Browse Board Log"); - - $serno=intval($serno); - if ($serno == 0) - die("serial number not specified or invalid!"); - - function print_cell($str) { - if ($str == '') - $str = ' '; - echo "\t<td>$str</td>\n"; - } -?> -<table align=center border=1 cellpadding=10> -<tr> -<th>serno / edit</th> -<th>ethaddr</th> -<th>date</th> -<th>batch</th> -<th>type</th> -<th>rev</th> -<th>location</th> -</tr> -<?php - $r=mysql_query("select * from boards where serno=$serno"); - - while($row=mysql_fetch_array($r)){ - foreach ($columns as $key) { - if (!key_in_array($key, $row)) - $row[$key] = ''; - } - - echo "<tr>\n"; - print_cell("<a href=\"edit.php?serno=$row[serno]\">$row[serno]</a>"); - print_cell($row['ethaddr']); - print_cell($row['date']); - print_cell($row['batch']); - print_cell($row['type']); - print_cell($row['rev']); - print_cell($row['location']); - echo "</tr>\n"; - } - - mysql_free_result($r); -?> -</table> -<hr></hr> -<p></p> -<?php - $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?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"<\" 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=\">\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset); - echo "</tr>\n</table>\n"; - } - mysql_free_result($lr); -?> -<table width="100%" border=1 cellpadding=10> -<tr valign=top> -<th>logno / edit</th> -<th>date</th> -<th>who</th> -<th width="70%">details</th> -</tr> -<?php - $r=mysql_query("select * from log where serno=$serno order by logno limit $offset,$limit"); - - while($row=mysql_fetch_array($r)){ - echo "<tr>\n"; - print_cell("<a href=\"edlog.php?serno=$row[serno]&logno=$row[logno]\">$row[logno]</a>"); - print_cell($row['date']); - print_cell($row['who']); - print_cell("<pre>" . urldecode($row['details']) . "</pre>"); - echo "</tr>\n"; - } - - mysql_free_result($r); -?> -</table> -<hr></hr> -<p></p> -<table width="100%"> -<tr> - <td align=center> - <a href="newlog.php?serno=<?php echo "$serno"; ?>">Add to Log</a> - </td> - <td align=center> - <a href="index.php">Back to Start</a> - </td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/browse.php b/tools/bddb/browse.php deleted file mode 100644 index 675dfab..0000000 --- a/tools/bddb/browse.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // list page (hymod_bddb / boards) - - require("defs.php"); - - $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:''; - - $verbose=isset($_REQUEST['verbose'])?intval($_REQUEST['verbose']):0; - - pg_head("$bddb_label - Browse database" . ($verbose?" (verbose)":"")); -?> -<p></p> -<?php - $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>\n"; - printf("<td align=left><%sa href=\"%s?submit=Browse&offset=%d&verbose=%d\"><img border=0 alt=\"<\" 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=\">\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset, $offset); - echo "</tr>\n</table>\n"; - } - - mysql_free_result($lr); - } -?> -<table align=center border=1 cellpadding=10> -<tr> -<th></th> -<th>serno / edit</th> -<th>ethaddr</th> -<th>date</th> -<th>batch</th> -<th>type</th> -<th>rev</th> -<th>location</th> -<?php - if ($verbose) { - echo "<th>comments</th>\n"; - echo "<th>sdram</th>\n"; - echo "<th>flash</th>\n"; - echo "<th>zbt</th>\n"; - echo "<th>xlxtyp</th>\n"; - echo "<th>xlxspd</th>\n"; - echo "<th>xlxtmp</th>\n"; - echo "<th>xlxgrd</th>\n"; - echo "<th>cputyp</th>\n"; - echo "<th>cpuspd</th>\n"; - echo "<th>cpmspd</th>\n"; - echo "<th>busspd</th>\n"; - echo "<th>hstype</th>\n"; - echo "<th>hschin</th>\n"; - echo "<th>hschout</th>\n"; - } -?> -</tr> -<?php - $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 == '') - $str = ' '; - echo "\t<td>$str</td>\n"; - } - - while($row=mysql_fetch_array($r)){ - foreach ($columns as $key) { - if (!key_in_array($key, $row)) - $row[$key] = ''; - } - - echo "<tr>\n"; - print_cell("<a href=\"brlog.php?serno=$row[serno]\">Log</a>"); - print_cell("<a href=\"edit.php?serno=$row[serno]\">$row[serno]</a>"); - print_cell($row['ethaddr']); - print_cell($row['date']); - print_cell($row['batch']); - print_cell($row['type']); - print_cell($row['rev']); - print_cell($row['location']); - if ($verbose) { - print_cell("<pre>\n" . urldecode($row['comments']) . - "\n\t</pre>"); - print_cell(gather_enum_multi_print("sdram", 4, $row)); - print_cell(gather_enum_multi_print("flash", 4, $row)); - print_cell(gather_enum_multi_print("zbt", 16, $row)); - print_cell(gather_enum_multi_print("xlxtyp", 4, $row)); - print_cell(gather_enum_multi_print("xlxspd", 4, $row)); - print_cell(gather_enum_multi_print("xlxtmp", 4, $row)); - print_cell(gather_enum_multi_print("xlxgrd", 4, $row)); - print_cell($row['cputyp']); - print_cell($row['cpuspd']); - print_cell($row['cpmspd']); - print_cell($row['busspd']); - print_cell($row['hstype']); - print_cell($row['hschin']); - print_cell($row['hschout']); - } - echo "</tr>\n"; - } -?> -</table> -<p></p> -<table width="100%"> -<tr> - <td align=center><?php - 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> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/config.php b/tools/bddb/config.php deleted file mode 100644 index 6725757..0000000 --- a/tools/bddb/config.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // mysql database access info - $mysql_user="fred"; - $mysql_pw="apassword"; - $mysql_db="mydbname"; - - // where to put the eeprom config files - $bddb_cfgdir = '/tftpboot/bddb'; - - // what this database is called - $bddb_label = 'Hymod Board Database'; -?> diff --git a/tools/bddb/create_tables.sql b/tools/bddb/create_tables.sql deleted file mode 100644 index a2a5788..0000000 --- a/tools/bddb/create_tables.sql +++ /dev/null @@ -1,90 +0,0 @@ -# phpMyAdmin MySQL-Dump -# http://phpwizard.net/phpMyAdmin/ -# -# Host: localhost Database : hymod_bddb - -# (C) Copyright 2001 -# Murray Jensen <Murray.Jensen@csiro.au> -# CSIRO Manufacturing and Infrastructure Technology, Preston Lab - -# -------------------------------------------------------- -# -# Table structure for table 'boards' -# - -DROP TABLE IF EXISTS boards; -CREATE TABLE boards ( - serno int(10) unsigned zerofill NOT NULL auto_increment, - ethaddr char(17), - date date NOT NULL, - batch char(32), - type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') NOT NULL, - rev tinyint(3) unsigned zerofill NOT NULL, - location char(64), - comments text, - 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'), - xlxtmp3 enum('COM','IND'), - xlxgrd0 enum('NORMAL','ENGSAMP'), - xlxgrd1 enum('NORMAL','ENGSAMP'), - xlxgrd2 enum('NORMAL','ENGSAMP'), - xlxgrd3 enum('NORMAL','ENGSAMP'), - 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) -); - -# -# Table structure for table 'log' -# - -DROP TABLE IF EXISTS log; -CREATE TABLE log ( - logno int(10) unsigned zerofill NOT NULL auto_increment, - serno int(10) unsigned zerofill NOT NULL, - date date NOT NULL, - details text NOT NULL, - PRIMARY KEY (logno), - KEY logno (logno, serno, date), - UNIQUE logno_2 (logno) -); diff --git a/tools/bddb/defs.php b/tools/bddb/defs.php deleted file mode 100644 index 0b50602..0000000 --- a/tools/bddb/defs.php +++ /dev/null @@ -1,710 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // contains mysql user id and password - keep secret - require("config.php"); - - if (isset($_REQUEST['logout'])) { - Header("status: 401 Unauthorized"); - Header("HTTP/1.0 401 Unauthorized"); - Header("WWW-authenticate: basic realm=\"$bddb_label\""); - - echo "<html><head><title>" . - "Access to '$bddb_label' Denied" . - "</title></head>\n"; - echo "<body bgcolor=#ffffff><br></br><br></br><center><h1>" . - "You must be an Authorised User " . - "to access the '$bddb_label'" . - "</h1>\n</center></body></html>\n"; - exit; - } - - // contents of the various enumerated types - if first item is - // empty ('') then the enum is allowed to be null (ie "not null" - // is not set on the column) - - // all column names in the database table - $columns = array( - 'serno','ethaddr','date','batch', - 'type','rev','location','comments', - 'sdram0','sdram1','sdram2','sdram3', - 'flash0','flash1','flash2','flash3', - 'zbt0','zbt1','zbt2','zbt3','zbt4','zbt5','zbt6','zbt7', - 'zbt8','zbt9','zbta','zbtb','zbtc','zbtd','zbte','zbtf', - 'xlxtyp0','xlxtyp1','xlxtyp2','xlxtyp3', - 'xlxspd0','xlxspd1','xlxspd2','xlxspd3', - 'xlxtmp0','xlxtmp1','xlxtmp2','xlxtmp3', - 'xlxgrd0','xlxgrd1','xlxgrd2','xlxgrd3', - 'cputyp','cpuspd','cpmspd','busspd', - 'hstype','hschin','hschout' - ); - - // board type - $type_vals = array('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY'); - - // Xilinx fpga types - $xlxtyp_vals = array('','XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'); - - // Xilinx fpga speeds - $xlxspd_vals = array('','6','7','8','4','5','9','10','11','12'); - - // Xilinx fpga temperatures (commercial or industrial) - $xlxtmp_vals = array('','COM','IND'); - - // Xilinx fpga grades (normal or engineering sample) - $xlxgrd_vals = array('','NORMAL','ENGSAMP'); - - // 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','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) { - if ($num == 0) - return "001"; - else - return sprintf("%03d", $num); - } - - function text_filter($str) { - return urldecode($str); - } - - mt_srand(time() | getmypid()); - - // set up MySQL connection - mysql_connect("", $mysql_user, $mysql_pw) || die("cannot connect"); - mysql_select_db($mysql_db) || die("cannot select db"); - - // page header - function pg_head($title) - { - echo "<html>\n<head>\n"; - echo "<link rel=stylesheet href=\"bddb.css\" type=\"text/css\" title=\"style sheet\"></link>\n"; - echo "<title>$title</title>\n"; - echo "</head>\n"; - echo "<body>\n"; - echo "<center><h1>$title</h1></center>\n"; - echo "<hr></hr>\n"; - } - - // page footer - function pg_foot() - { - echo "<hr></hr>\n"; - echo "<table width=\"100%\"><tr><td align=left>\n<address>" . - "If you have any problems, email " . - "<a href=\"mailto:Murray.Jensen@csiro.au\">" . - "Murray Jensen" . - "</a></address>\n" . - "</td><td align=right>\n" . - "<a href=\"index.php?logout=true\">logout</a>\n" . - "</td></tr></table>\n"; - echo "<p><small><i>Made with " . - "<a href=\"http://kyber.dk/phpMyBuilder/\">" . - "Kyber phpMyBuilder</a></i></small></p>\n"; - echo "</body>\n"; - echo "</html>\n"; - } - - // some support functions - - if (!function_exists('array_search')) { - - function array_search($needle, $haystack, $strict = false) { - - if (is_array($haystack) && count($haystack)) { - - $ntype = gettype($needle); - - foreach ($haystack as $key => $value) { - - if ($value == $needle && (!$strict || - gettype($value) == $ntype)) - return $key; - } - } - - return false; - } - } - - if (!function_exists('in_array')) { - - function in_array($needle, $haystack, $strict = false) { - - if (is_array($haystack) && count($haystack)) { - - $ntype = gettype($needle); - - foreach ($haystack as $key => $value) { - - if ($value == $needle && (!$strict || - gettype($value) == $ntype)) - return true; - } - } - - return false; - } - } - - function key_in_array($key, $array) { - return in_array($key, array_keys($array), true); - } - - function enum_to_index($name, $vals) { - $index = array_search($GLOBALS[$name], $vals); - if ($vals[0] != '') - $index++; - return $index; - } - - // fetch a value from an array - return empty string is not present - function get_key_value($key, $array) { - if (key_in_array($key, $array)) - return $array[$key]; - else - return ''; - } - - function fprintf() { - $n = func_num_args(); - if ($n < 2) - return FALSE; - $a = func_get_args(); - $fp = array_shift($a); - $x = "\$s = sprintf"; - $sep = '('; - foreach ($a as $z) { - $x .= "$sep'$z'"; - $sep = ','; - } - $x .= ');'; - eval($x); - $l = strlen($s); - $r = fwrite($fp, $s, $l); - if ($r != $l) - return FALSE; - else - return TRUE; - } - - // functions to display (print) a database table and its columns - - function begin_table($ncols) { - global $table_ncols; - $table_ncols = $ncols; - echo "<table align=center width=\"100%\"" - . " border=1 cellpadding=4 cols=$table_ncols>\n"; - } - - function begin_field($name, $span = 0) { - global $table_ncols; - echo "<tr valign=top>\n"; - echo "\t<th align=center>$name</th>\n"; - if ($span <= 0) - $span = $table_ncols - 1; - if ($span > 1) - echo "\t<td colspan=$span>\n"; - else - echo "\t<td>\n"; - } - - function cont_field($span = 1) { - echo "\t</td>\n"; - if ($span > 1) - echo "\t<td colspan=$span>\n"; - else - echo "\t<td>\n"; - } - - function end_field() { - echo "\t</td>\n"; - echo "</tr>\n"; - } - - function end_table() { - echo "</table>\n"; - } - - function print_field($name, $array, $size = 0, $filt='') { - - begin_field($name); - - if (key_in_array($name, $array)) - $value = $array[$name]; - else - $value = ''; - - if ($filt != '') - $value = $filt($value); - - echo "\t\t<input name=$name value=\"$value\""; - if ($size > 0) - echo " size=$size maxlength=$size"; - echo "></input>\n"; - - end_field(); - } - - function print_field_multiline($name, $array, $cols, $rows, $filt='') { - - begin_field($name); - - if (key_in_array($name, $array)) - $value = $array[$name]; - else - $value = ''; - - if ($filt != '') - $value = $filt($value); - - echo "\t\t<textarea name=$name " . - "cols=$cols rows=$rows wrap=off>\n"; - echo "$value"; - echo "</textarea>\n"; - - end_field(); - } - - // print a mysql ENUM as an html RADIO INPUT - function print_enum($name, $array, $vals, $def = -1) { - - begin_field($name); - - 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<input type=radio name=$name" - . " value=\"$val\"%s>$pval</input>\n", - $i == $chk ? " checked" : ""); - } - - 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) { - - global $table_ncols; - - if ($grp <= 0) - $grp = $cnt; - $ncell = $cnt / $grp; - $span = ($table_ncols - 1) / $ncell; - - begin_field($base, $span); - - $nval = count($vals); - - for ($i = 0; $i < $cnt; $i++) { - - if ($i > 0 && ($i % $grp) == 0) - cont_field($span); - - $name = sprintf("%s%x", $base, $i); - - echo "\t\t<select name=$name>\n"; - - if (key_in_array($name, $array)) - $ai = array_search($array[$name], $vals, FALSE); - else { - if (key_in_array($i, $defs)) - $ai = $defs[$i]; - else - $ai = 0; - } - - for ($j = 0; $j < $nval; $j++) { - - $val = $vals[$j]; - if ($val == '') - $pval = " "; - else - $pval = "$val"; - - printf("\t\t\t<option " . - "value=\"%s\"%s>%s</option>\n", - $val, - $j == $ai ? " selected" : "", - $pval); - } - - echo "\t\t</select>\n"; - } - - end_field(); - } - - // functions to handle the form input - - // fetch all the parts of an "enum_multi" into a string suitable - // for a MySQL query - function gather_enum_multi_query($base, $cnt) { - - $retval = ''; - - for ($i = 0; $i < $cnt; $i++) { - - $name = sprintf("%s%x", $base, $i); - - if (isset($_REQUEST[$name])) { - $retval .= sprintf(", %s='%s'", - $name, $_REQUEST[$name]); - } - } - - return $retval; - } - - // fetch all the parts of an "enum_multi" into a string suitable - // for a display e.g. in an html table cell - function gather_enum_multi_print($base, $cnt, $array) { - - $retval = ''; - - for ($i = 0; $i < $cnt; $i++) { - - $name = sprintf("%s%x", $base, $i); - - if ($array[$name] != '') { - if ($retval != '') - $retval .= ','; - $retval .= $array[$name]; - } - } - - return $retval; - } - - // fetch all the parts of an "enum_multi" into a string suitable - // for writing to the eeprom data file - function gather_enum_multi_write($base, $cnt, $vals, $xfrm = array()) { - - $retval = ''; - - for ($i = 0; $i < $cnt; $i++) { - - $name = sprintf("%s%x", $base, $i); - - if ($GLOBALS[$name] != '') { - if ($retval != '') - $retval .= ','; - $index = enum_to_index($name, $vals); - if ($xfrm != array()) - $retval .= $xfrm[$index]; - else - $retval .= $index; - } - } - - return $retval; - } - - // count how many parts of an "enum_multi" are actually set - function count_enum_multi($base, $cnt) { - - $retval = 0; - - for ($i = 0; $i < $cnt; $i++) { - - $name = sprintf("%s%x", $base, $i); - - if (isset($_REQUEST[$name])) - $retval++; - } - - return $retval; - } - - // ethernet address functions - - // generate a (possibly not unique) random vendor ethernet address - // (setting bit 6 in the ethernet address - motorola wise i.e. bit 0 - // is the most significant bit - means it is not an assigned ethernet - // address - it is a "locally administered" address). Also, make sure - // it is NOT a multicast ethernet address (by setting bit 7 to 0). - // e.g. the first byte of all ethernet addresses generated here will - // have 2 in the bottom two bits (incidentally, these are the first - // two bits transmitted on the wire, since the octets in ethernet - // addresses are transmitted LSB first). - - function gen_eth_addr($serno) { - - $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_hgh >> 8, $ethaddr_hgh & 0xff, - $ethaddr_mid >> 8, $ethaddr_mid & 0xff, - $ethaddr_low >> 8, $ethaddr_low & 0xff); - } - - // check that an ethernet address is valid - function eth_addr_is_valid($ethaddr) { - - $ethbytes = split(':', $ethaddr); - - if (count($ethbytes) != 6) - return FALSE; - - for ($i = 0; $i < 6; $i++) { - $ethbyte = $ethbytes[$i]; - if (!ereg('^[0-9a-f][0-9a-f]$', $ethbyte)) - return FALSE; - } - - return TRUE; - } - - // write a simple eeprom configuration file - function write_eeprom_cfg_file() { - - global $sernos, $nsernos, $bddb_cfgdir, $numerrs, $cfgerrs; - global $date, $batch, $type_vals, $rev; - global $sdram_vals, $sdram_nbits; - global $flash_vals, $flash_nbits; - global $zbt_vals, $zbt_nbits; - global $xlxtyp_vals, $xlxspd_vals, $xlxtmp_vals, $xlxgrd_vals; - global $cputyp, $cputyp_vals, $clk_vals; - global $hstype, $hstype_vals, $hschin, $hschout; - - $numerrs = 0; - $cfgerrs = array(); - - for ($i = 0; $i < $nsernos; $i++) { - - $serno = sprintf("%010d", $sernos[$i]); - - $wfp = @fopen($bddb_cfgdir . "/$serno.cfg", "w"); - if (!$wfp) { - $cfgerrs[$i] = 'file create fail'; - $numerrs++; - continue; - } - set_file_buffer($wfp, 0); - - if (!fprintf($wfp, "serno=%d\n", $sernos[$i])) { - $cfgerrs[$i] = 'cfg wr fail (serno)'; - fclose($wfp); - $numerrs++; - continue; - } - - if (!fprintf($wfp, "date=%s\n", $date)) { - $cfgerrs[$i] = 'cfg wr fail (date)'; - fclose($wfp); - $numerrs++; - continue; - } - - if ($batch != '') { - if (!fprintf($wfp, "batch=%s\n", $batch)) { - $cfgerrs[$i] = 'cfg wr fail (batch)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $typei = enum_to_index("type", $type_vals); - if (!fprintf($wfp, "type=%d\n", $typei)) { - $cfgerrs[$i] = 'cfg wr fail (type)'; - fclose($wfp); - $numerrs++; - continue; - } - - if (!fprintf($wfp, "rev=%d\n", $rev)) { - $cfgerrs[$i] = 'cfg wr fail (rev)'; - fclose($wfp); - $numerrs++; - continue; - } - - $s = gather_enum_multi_write("sdram", 4, - $sdram_vals, $sdram_nbits); - if ($s != '') { - $b = fprintf($wfp, "sdram=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (sdram)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("flash", 4, - $flash_vals, $flash_nbits); - if ($s != '') { - $b = fprintf($wfp, "flash=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (flash)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("zbt", 16, - $zbt_vals, $zbt_nbits); - if ($s != '') { - $b = fprintf($wfp, "zbt=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (zbt)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("xlxtyp", 4, $xlxtyp_vals); - if ($s != '') { - $b = fprintf($wfp, "xlxtyp=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (xlxtyp)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("xlxspd", 4, $xlxspd_vals); - if ($s != '') { - $b = fprintf($wfp, "xlxspd=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (xlxspd)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("xlxtmp", 4, $xlxtmp_vals); - if ($s != '') { - $b = fprintf($wfp, "xlxtmp=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (xlxtmp)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - $s = gather_enum_multi_write("xlxgrd", 4, $xlxgrd_vals); - if ($s != '') { - $b = fprintf($wfp, "xlxgrd=%s\n", $s); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (xlxgrd)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - if ($cputyp != '') { - $cputypi = enum_to_index("cputyp",$cputyp_vals); - $cpuspdi = enum_to_index("cpuspd", $clk_vals); - $busspdi = enum_to_index("busspd", $clk_vals); - $cpmspdi = enum_to_index("cpmspd", $clk_vals); - $b = fprintf($wfp, "cputyp=%d\ncpuspd=%d\n" . - "busspd=%d\ncpmspd=%d\n", - $cputypi, $cpuspdi, $busspdi, $cpmspdi); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (cputyp)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - if ($hstype != '') { - $hstypei = enum_to_index("hstype",$hstype_vals); - $b = fprintf($wfp, "hstype=%d\n" . - "hschin=%s\nhschout=%s\n", - $hstypei, $hschin, $hschout); - if (!$b) { - $cfgerrs[$i] = 'cfg wr fail (hstype)'; - fclose($wfp); - $numerrs++; - continue; - } - } - - if (!fclose($wfp)) { - $cfgerrs[$i] = 'file cls fail'; - $numerrs++; - } - } - - return $numerrs; - } -?> diff --git a/tools/bddb/dodelete.php b/tools/bddb/dodelete.php deleted file mode 100644 index 4839e36..0000000 --- a/tools/bddb/dodelete.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // dodelete page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Delete Board Results"); - - if (!isset($_REQUEST['serno'])) - die("the board serial number was not specified"); - $serno=intval($_REQUEST['serno']); - - mysql_query("delete from boards where serno=$serno"); - - if(mysql_errno()) { - $errstr = mysql_error(); - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $errstr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - else { - echo "\t<font size=+2>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe board with serial number <b>$serno</b> was" - . " successfully deleted\n"; - mysql_query("delete from log where serno=$serno"); - if (mysql_errno()) { - $errstr = mysql_error(); - echo "\t\t\t<font size=+4>\n"; - echo "\t\t\t\t<p>\n"; - echo "\t\t\t\t\tBut the following error occurred " . - "when deleting the log entries:\n"; - echo "\t\t\t\t</p>\n"; - echo "\t\t\t\t<center>\n"; - printf("\t\t\t\t\t<b>%s</b>\n", $errstr); - echo "\t\t\t\t</center>\n"; - echo "\t\t\t</font>\n"; - } - echo "\t\t</p>\n"; - echo "\t</font>\n"; - } -?> -<p> -<table width="100%"> -<tr> - <td align=center> - <a href="browse.php">Back to Browse</a> - </td> - <td align=center> - <a href="index.php">Back to Start</a> - </td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/dodellog.php b/tools/bddb/dodellog.php deleted file mode 100644 index 9dd78c1..0000000 --- a/tools/bddb/dodellog.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // dodelete page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Delete Log Entry Results"); - - if (!isset($_REQUEST['serno'])) - die("the board serial number was not specified"); - $serno=intval($_REQUEST['serno']); - - 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"); - - if(mysql_errno()) { - $errstr = mysql_error(); - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $errstr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - else { - echo "\t<font size=+2>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe log entry with log number <b>$logno</b>\n"; - echo "\t\t\tand serial number <b>$serno</b> "; - echo "was successfully deleted\n"; - echo "\t\t</p>\n"; - echo "\t</font>\n"; - } -?> -<p> -<table width="100%"> -<tr> - <td align=center> - <a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a> - </td> - <td align=center> - <a href="index.php">Back to Start</a> - </td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/doedit.php b/tools/bddb/doedit.php deleted file mode 100644 index 13fbb69..0000000 --- a/tools/bddb/doedit.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // doedit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Edit Board Results"); - - if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') - die("the board serial number was not specified"); - $serno=intval($_REQUEST['serno']); - - $query="update boards set"; - - if (isset($_REQUEST['ethaddr'])) { - $ethaddr=$_REQUEST['ethaddr']; - if (!eth_addr_is_valid($ethaddr)) - die("ethaddr is invalid ('$ethaddr')"); - $query.=" ethaddr='$ethaddr',"; - } - - 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', " . - "yyyy-mm-dd '$y-$m-$d')"); - $query.=" date='$date'"; - } - - if (isset($_REQUEST['batch'])) { - $batch=$_REQUEST['batch']; - if (strlen($batch) > 32) - die("batch field too long (>32)"); - $query.=", batch='$batch'"; - } - - if (isset($_REQUEST['type'])) { - $type=$_REQUEST['type']; - if (!in_array($type, $type_vals)) - die("Invalid type ($type) specified"); - $query.=", type='$type'"; - } - - 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($_REQUEST['location'])) { - $location=$_REQUEST['location']; - if (strlen($location) > 64) - die("location field too long (>64)"); - $query.=", location='$location'"; - } - - if (isset($_REQUEST['comments'])) - $comments=$_REQUEST['comments']; - $query.=", comments='" . rawurlencode($comments) . "'"; - - $query.=gather_enum_multi_query("sdram", 4); - - $query.=gather_enum_multi_query("flash", 4); - - $query.=gather_enum_multi_query("zbt", 16); - - $query.=gather_enum_multi_query("xlxtyp", 4); - $nxlx = count_enum_multi("xlxtyp", 4); - - $query.=gather_enum_multi_query("xlxspd", 4); - if (count_enum_multi("xlxspd", 4) != $nxlx) - die("number of xilinx speeds not same as number of types"); - - $query.=gather_enum_multi_query("xlxtmp", 4); - if (count_enum_multi("xlxtmp", 4) != $nxlx) - die("number of xilinx temps. not same as number of types"); - - $query.=gather_enum_multi_query("xlxgrd", 4); - if (count_enum_multi("xlxgrd", 4) != $nxlx) - die("number of xilinx grades not same as number of types"); - - if (isset($_REQUEST['cputyp'])) { - $cputyp=$_REQUEST['cputyp']; - $query.=", cputyp='$cputyp'"; - if (!isset($_REQUEST['cpuspd']) || $_REQUEST['cpuspd'] == '') - die("must specify cpu speed if cpu type is defined"); - $cpuspd=$_REQUEST['cpuspd']; - $query.=", cpuspd='$cpuspd'"; - if (!isset($_REQUEST['cpmspd']) || $_REQUEST['cpmspd'] == '') - die("must specify cpm speed if cpu type is defined"); - $cpmspd=$_REQUEST['cpmspd']; - $query.=", cpmspd='$cpmspd'"; - 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($_REQUEST['cpuspd'])) - die("can't specify cpu speed if there is no cpu"); - if (isset($_REQUEST['cpmspd'])) - die("can't specify cpm speed if there is no cpu"); - if (isset($_REQUEST['busspd'])) - die("can't specify bus speed if there is no cpu"); - } - - 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($_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($_REQUEST['hstype'])) { - $hstype=$_REQUEST['hstype']; - $query.=", hstype='$hstype'"; - } - else { - if ($_REQUEST['hschin'] != 0) - die("number of high-speed input channels must be zero" - . " if high-speed chip is not present"); - if ($_REQUEST['hschout'] != 0) - die("number of high-speed output channels must be zero" - . " if high-speed chip is not present"); - } - $query.=", hschin='$hschin'"; - $query.=", hschout='$hschout'"; - - $query.=" where serno=$serno"; - - mysql_query($query); - if(mysql_errno()) { - $errstr = mysql_error(); - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $errstr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - else { - $sernos = array($serno); - $nsernos = 1; - - write_eeprom_cfg_file(); - - echo "\t<font size=+2>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe board with serial number <b>$serno</b> was" - . " successfully updated"; - if ($numerrs > 0) { - $errstr = $cfgerrs[0]; - echo "<br>\n\t\t\t"; - echo "(but the cfg file update failed: $errstr)"; - } - echo "\n"; - echo "\t\t</p>\n"; - echo "\t</font>\n"; - } - -?> -<p> -<table align=center width="100%"> -<tr> - <td align=center><a href="browse.php">Back to Browse</a></td> - <td align=center><a href="index.php">Back to Start</a></td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/doedlog.php b/tools/bddb/doedlog.php deleted file mode 100644 index 7009aa7..0000000 --- a/tools/bddb/doedlog.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // doedit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Edit Log Entry Results"); - - if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') - die("the board serial number was not specified"); - $serno=intval($_REQUEST['serno']); - - if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '') - die("log number not specified!"); - $logno=intval($_REQUEST['logno']); - - $query="update log set"; - - 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', " . - "yyyy-mm-dd '$y-$m-$d')"); - $query.=" date='$date'"; - } - - if (isset($_REQUEST['who'])) { - $who=$_REQUEST['who']; - $query.=", who='" . $who . "'"; - } - - if (isset($_REQUEST['details'])) { - $details=$_REQUEST['details']; - $query.=", details='" . rawurlencode($details) . "'"; - } - - $query.=" where serno=$serno and logno=$logno"; - - mysql_query($query); - if(mysql_errno()) { - $errstr = mysql_error(); - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $errstr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - else { - echo "\t<font size=+2>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe log entry with log number <b>$logno</b> and\n"; - echo "\t\t\tserial number <b>$serno</b> "; - echo "was successfully updated\n"; - echo "\t\t</p>\n"; - echo "\t</font>\n"; - } - -?> -<p> -<table align=center width="100%"> -<tr> - <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a></td> - <td align=center><a href="index.php">Back to Start</a></td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/donew.php b/tools/bddb/donew.php deleted file mode 100644 index 39b2c78..0000000 --- a/tools/bddb/donew.php +++ /dev/null @@ -1,230 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // doedit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Board Registration Results"); - - if (isset($_REQUEST['serno'])) { - $serno=$_REQUEST['serno']; - die("serial number must not be set ($serno) when Creating!"); - } - - $query="update boards set"; - - list($y, $m, $d) = split("-", $date); - if (!checkdate($m, $d, $y) || $y < 1999) - die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')"); - $query.=" date='$date'"; - - if ($batch != '') { - if (strlen($batch) > 32) - die("batch field too long (>32)"); - $query.=", batch='$batch'"; - } - - if (!in_array($type, $type_vals)) - die("Invalid type ($type) specified"); - $query.=", type='$type'"; - - if (($rev = intval($rev)) <= 0 || $rev > 255) - die("Revision number is invalid ($rev)"); - $query.=sprintf(", rev=%d", $rev); - - $query.=gather_enum_multi_query("sdram", 4); - - $query.=gather_enum_multi_query("flash", 4); - - $query.=gather_enum_multi_query("zbt", 16); - - $query.=gather_enum_multi_query("xlxtyp", 4); - $nxlx = count_enum_multi("xlxtyp", 4); - - $query.=gather_enum_multi_query("xlxspd", 4); - if (count_enum_multi("xlxspd", 4) != $nxlx) - die("number of xilinx speeds not same as number of types"); - - $query.=gather_enum_multi_query("xlxtmp", 4); - if (count_enum_multi("xlxtmp", 4) != $nxlx) - die("number of xilinx temps. not same as number of types"); - - $query.=gather_enum_multi_query("xlxgrd", 4); - if (count_enum_multi("xlxgrd", 4) != $nxlx) - die("number of xilinx grades not same as number of types"); - - if ($cputyp == '') { - if ($cpuspd != '') - die("can't specify cpu speed if there is no cpu"); - if ($cpmspd != '') - die("can't specify cpm speed if there is no cpu"); - if ($busspd != '') - die("can't specify bus speed if there is no cpu"); - } - else { - $query.=", cputyp='$cputyp'"; - if ($cpuspd == '') - die("must specify cpu speed if cpu type is defined"); - $query.=", cpuspd='$cpuspd'"; - if ($cpmspd == '') - die("must specify cpm speed if cpu type is defined"); - $query.=", cpmspd='$cpmspd'"; - if ($busspd == '') - die("must specify bus speed if cpu type is defined"); - $query.=", busspd='$busspd'"; - } - - if (($hschin = intval($hschin)) < 0 || $hschin > 4) - die("Invalid number of hs input chans ($hschin)"); - if (($hschout = intval($hschout)) < 0 || $hschout > 4) - die("Invalid number of hs output chans ($hschout)"); - if ($hstype == '') { - if ($hschin != 0) - die("number of high-speed input channels must be zero" - . " if high-speed chip is not present"); - if ($hschout != 0) - die("number of high-speed output channels must be zero" - . " if high-speed chip is not present"); - } - else - $query.=", hstype='$hstype'"; - $query.=", hschin='$hschin'"; - $query.=", hschout='$hschout'"; - - // echo "final query = '$query'<br>\n"; - - $quant = intval($quant); - if ($quant <= 0) $quant = 1; - - $sernos = array(); - if ($geneths) - $ethaddrs = array(); - - $sqlerr = ''; - - while ($quant-- > 0) { - - mysql_query("insert into boards (serno) values (null)"); - if (mysql_errno()) { - $sqlerr = mysql_error(); - break; - } - - $serno = mysql_insert_id(); - if (!$serno) { - $sqlerr = "couldn't allocate new serial number"; - break; - } - - mysql_query($query . " where serno=$serno"); - if (mysql_errno()) { - $sqlerr = mysql_error(); - break; - } - - array_push($sernos, $serno); - - if ($geneths) { - - $ethaddr = gen_eth_addr($serno); - - mysql_query("update boards set ethaddr='$ethaddr'" . - " where serno=$serno"); - if (mysql_errno()) { - $sqlerr = mysql_error(); - - array_push($ethaddrs, - "<font color=#ff0000><b>" . - "db save fail" . - "</b></font>"); - break; - } - - array_push($ethaddrs, $ethaddr); - } - } - - $nsernos = count($sernos); - - if ($nsernos > 0) { - - write_eeprom_cfg_file(); - - echo "<font size=+2>\n"; - echo "\t<p>\n"; - echo "\t\tThe following board serial numbers were" - . " successfully allocated"; - if ($numerrs > 0) - echo " (but with $numerrs cfg file error" . - ($numerrs > 1 ? "s" : "") . ")"; - echo ":\n"; - echo "\t</p>\n"; - - echo "</font>\n"; - - echo "<table align=center width=\"100%\">\n"; - echo "<tr>\n"; - echo "\t<th>Serial Number</th>\n"; - if ($numerrs > 0) - echo "\t<th>Cfg File Errs</th>\n"; - if ($geneths) - echo "\t<th>Ethernet Address</th>\n"; - echo "</tr>\n"; - - for ($i = 0; $i < $nsernos; $i++) { - - $serno = sprintf("%010d", $sernos[$i]); - - echo "<tr>\n"; - - echo "\t<td align=center><font size=+2>" . - "<b>$serno</b></font></td>\n"; - - if ($numerrs > 0) { - if (($errstr = $cfgerrs[$i]) == '') - $errstr = ' '; - echo "\t<td align=center>" . - "<font size=+2 color=#ff0000><b>" . - $errstr . - "</b></font></td>\n"; - } - - if ($geneths) { - echo "\t<td align=center>" . - "<font size=+2 color=#00ff00><b>" . - $ethaddrs[$i] . - "</b></font></td>\n"; - } - - echo "</tr>\n"; - } - - echo "</table>\n"; - } - - if ($sqlerr != '') { - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following SQL error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $sqlerr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - -?> -<p> -<table align=center width="100%"> -<tr> - <td align=center><a href="browse.php">Go to Browse</a></td> - <td align=center><a href="index.php">Back to Start</a></td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/donewlog.php b/tools/bddb/donewlog.php deleted file mode 100644 index 7635d29..0000000 --- a/tools/bddb/donewlog.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // doedit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Add Log Entry Results"); - - if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') - die("serial number not specified!"); - $serno=intval($_REQUEST['serno']); - - if (isset($_REQUEST['logno'])) { - $logno=$_REQUEST['logno']; - die("log number must not be set ($logno) when Creating!"); - } - - $query="update log set serno=$serno"; - - list($y, $m, $d) = split("-", $date); - if (!checkdate($m, $d, $y) || $y < 1999) - die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')"); - $query.=", date='$date'"; - - if (isset($_REQUEST['who'])) { - $who=$_REQUEST['who']; - $query.=", who='" . $who . "'"; - } - - if (isset($_REQUEST['details'])) { - $details=$_REQUEST['details']; - $query.=", details='" . rawurlencode($details) . "'"; - } - - // echo "final query = '$query'<br>\n"; - - $sqlerr = ''; - - mysql_query("insert into log (logno) values (null)"); - if (mysql_errno()) - $sqlerr = mysql_error(); - else { - $logno = mysql_insert_id(); - if (!$logno) - $sqlerr = "couldn't allocate new serial number"; - else { - mysql_query($query . " where logno=$logno"); - if (mysql_errno()) - $sqlerr = mysql_error(); - } - } - - if ($sqlerr == '') { - echo "<font size=+2>\n"; - echo "\t<p>\n"; - echo "\t\tA log entry with log number '$logno' was " . - "added to the board with serial number '$serno'\n"; - echo "\t</p>\n"; - echo "</font>\n"; - } - else { - echo "\t<font size=+4>\n"; - echo "\t\t<p>\n"; - echo "\t\t\tThe following SQL error was encountered:\n"; - echo "\t\t</p>\n"; - echo "\t\t<center>\n"; - printf("\t\t\t<b>%s</b>\n", $sqlerr); - echo "\t\t</center>\n"; - echo "\t</font>\n"; - } - -?> -<p></p> -<table width="100%"> -<tr> - <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Go to Browse</a></td> - <td align=center><a href="index.php">Back to Start</a></td> -</tr> -</table> -<?php - pg_foot(); -?> diff --git a/tools/bddb/edit.php b/tools/bddb/edit.php deleted file mode 100644 index dd8c26c..0000000 --- a/tools/bddb/edit.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // edit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Edit Board Registration"); - - if ($serno == 0) - die("serial number not specified or invalid!"); - - $pserno = sprintf("%010d", $serno); - - echo "<center><b><font size=+2>"; - echo "Board Serial Number: $pserno"; - echo "</font></b></center>\n"; - -?> -<p> -<form action=doedit.php method=POST> -<?php - echo "<input type=hidden name=serno value=$serno>\n"; - - $r=mysql_query("select * from boards where serno=$serno"); - $row=mysql_fetch_array($r); - if(!$row) die("no record of serial number '$serno' in database"); - - begin_table(5); - - // ethaddr char(17) - print_field("ethaddr", $row, 17); - - // date date - print_field("date", $row); - - // batch char(32) - print_field("batch", $row, 32); - - // type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') - print_enum("type", $row, $type_vals); - - // rev tinyint(3) unsigned zerofill - print_field("rev", $row, 3, 'rev_filter'); - - // location char(64) - print_field("location", $row, 64); - - // comments text - print_field_multiline("comments", $row, 60, 10, 'text_filter'); - - // sdram[0-3] enum('32M','64M','128M','256M') - print_enum_multi("sdram", $row, $sdram_vals, 4, array()); - - // flash[0-3] enum('4M','8M','16M','32M','64M') - print_enum_multi("flash", $row, $flash_vals, 4, array()); - - // zbt[0-f] enum('512K','1M','2M','4M') - print_enum_multi("zbt", $row, $zbt_vals, 16, array()); - - // xlxtyp[0-3] enum('XCV300E','XCV400E','XCV600E') - print_enum_multi("xlxtyp", $row, $xlxtyp_vals, 4, array(), 1); - - // xlxspd[0-3] enum('6','7','8') - print_enum_multi("xlxspd", $row, $xlxspd_vals, 4, array(), 1); - - // xlxtmp[0-3] enum('COM','IND') - print_enum_multi("xlxtmp", $row, $xlxtmp_vals, 4, array(), 1); - - // xlxgrd[0-3] enum('NORMAL','ENGSAMP') - print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(), 1); - - // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)') - print_enum("cputyp", $row, $cputyp_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','233MHZ','266MHZ') - print_enum_select("cpmspd", $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); - - // hschin enum('0','1','2','3','4') - print_enum("hschin", $row, $hschin_vals); - - // hschout enum('0','1','2','3','4') - print_enum("hschout", $row, $hschout_vals); - - end_table(); - - echo "<p>\n"; - echo "<center><b>"; - echo "<font color=#ff0000>WARNING: NO UNDO ON DELETE!</font>"; - echo "<br></br>\n"; - echo "<tt>[ <a href=\"dodelete.php?serno=$serno\">delete</a> ]</tt>"; - echo "</b></center>\n"; - echo "</p>\n"; -?> -<p> -<table align=center width="100%"> -<tr> - <td align=center> - <input type=submit value=Edit> - </td> - <td> - - </td> - <td align=center> - <input type=reset value=Reset> - </td> - <td> - - </td> - <td align=center> - <a href="index.php">Back to Start</a> - </td> -</tr> -</table> -</p> -</form> -<?php - pg_foot(); -?> diff --git a/tools/bddb/edlog.php b/tools/bddb/edlog.php deleted file mode 100644 index 8befd35..0000000 --- a/tools/bddb/edlog.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // edit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - Edit Board Log Entry"); - - if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') - die("serial number not specified!"); - $serno=intval($_REQUEST['serno']); - - if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '') - die("log number not specified!"); - $logno=intval($_REQUEST['logno']); - - $pserno = sprintf("%010d", $serno); - $plogno = sprintf("%010d", $logno); - - echo "<center><b><font size=+2>"; - echo "Board Serial Number: $pserno, Log Number: $plogno"; - echo "</font></b></center>\n"; - -?> -<p> -<form action=doedlog.php method=POST> -<?php - echo "<input type=hidden name=serno value=$serno>\n"; - echo "<input type=hidden name=logno value=$logno>\n"; - - $r=mysql_query("select * from log where serno=$serno and logno=$logno"); - $row=mysql_fetch_array($r); - if(!$row) - die("no record of log entry with serial number '$serno' " . - "and log number '$logno' in database"); - - begin_table(3); - - // date date - print_field("date", $row); - - // who char(20) - print_field("who", $row); - - // details text - print_field_multiline("details", $row, 60, 10, 'text_filter'); - - end_table(); - - echo "<p>\n"; - echo "<center><b>"; - echo "<font color=#ff0000>WARNING: NO UNDO ON DELETE!</font>"; - echo "<br></br>\n"; - echo "<tt>[ <a href=\"dodellog.php?serno=$serno&logno=$logno\">delete</a> ]</tt>"; - echo "</b></center>\n"; - echo "</p>\n"; -?> -<p> -<table align=center width="100%"> -<tr> - <td align=center> - <input type=submit value=Edit> - </td> - <td> - - </td> - <td align=center> - <input type=reset value=Reset> - </td> - <td> - - </td> - <td align=center> - <a href="index.php">Back to Start</a> - </td> -</tr> -</table> -</p> -</form> -<?php - pg_foot(); -?> diff --git a/tools/bddb/execute.php b/tools/bddb/execute.php deleted file mode 100644 index 0b62882..0000000 --- a/tools/bddb/execute.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:''; - - $submit=isset($_REQUEST['submit'])?$_REQUEST['submit']:"[NOT SET]"; - - switch ($submit) { - - case "New": - require("new.php"); - break; - - case "Edit": - require("edit.php"); - break; - - case "Browse": - require("browse.php"); - break; - - case "Log": - require("brlog.php"); - break; - - default: - require("badsubmit.php"); - break; - } -?> diff --git a/tools/bddb/index.php b/tools/bddb/index.php deleted file mode 100644 index 842aed5..0000000 --- a/tools/bddb/index.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - require("defs.php"); - pg_head("$bddb_label"); -?> -<font size="+4"> - <form action=execute.php method=POST> - <table width="100%" cellspacing=10 cellpadding=10> - <tr> - <td align=center> - <input type=submit name=submit value="New"></input> - </td> - <td align=center> - <input type=submit name=submit value="Edit"></input> - </td> - <td align=center> - <input type=submit name=submit value="Browse"></input> - </td> - <td align=center> - <input type=submit name=submit value="Log"></input> - </td> - </tr> - <tr> - <td align=center colspan=4> - <b>Serial Number:</b> - <input type=text name=serno size=10 maxsize=10 value=""></input> - </td> - </tr> - </table> - </form> -</font> -<?php - pg_foot(); -?> diff --git a/tools/bddb/new.php b/tools/bddb/new.php deleted file mode 100644 index 30323ff..0000000 --- a/tools/bddb/new.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // edit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - New Board Registration"); -?> -<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) { - $r=mysql_query("select * from boards where serno=$serno"); - $row=mysql_fetch_array($r); - if(!$row)die("no record of serial number '$serno' in database"); - } - else - $row = array(); - - begin_table(5); - - // date date - print_field("date", array('date' => date("Y-m-d"))); - - // batch char(32) - print_field("batch", $row, 32); - - // type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') - print_enum("type", $row, $type_vals, 0); - - // rev tinyint(3) unsigned zerofill - print_field("rev", $row, 3, 'rev_filter'); - - // sdram[0-3] enum('32M','64M','128M','256M') - print_enum_multi("sdram", $row, $sdram_vals, 4, array(2)); - - // flash[0-3] enum('4M','8M','16M','32M','64M') - print_enum_multi("flash", $row, $flash_vals, 4, array(2)); - - // zbt[0-f] enum('512K','1M','2M','4M') - print_enum_multi("zbt", $row, $zbt_vals, 16, array(2, 2)); - - // xlxtyp[0-3] enum('XCV300E','XCV400E','XCV600E') - print_enum_multi("xlxtyp", $row, $xlxtyp_vals, 4, array(1), 1); - - // xlxspd[0-3] enum('6','7','8') - print_enum_multi("xlxspd", $row, $xlxspd_vals, 4, array(1), 1); - - // xlxtmp[0-3] enum('COM','IND') - print_enum_multi("xlxtmp", $row, $xlxtmp_vals, 4, array(1), 1); - - // xlxgrd[0-3] enum('NORMAL','ENGSAMP') - print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(1), 1); - - // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)') - print_enum("cputyp", $row, $cputyp_vals, 1); - - // 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','233MHZ','266MHZ') - print_enum_select("cpmspd", $row, $clk_vals, 4); - - // 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); - - // hschin enum('0','1','2','3','4') - print_enum("hschin", $row, $hschin_vals, 4); - - // hschout enum('0','1','2','3','4') - print_enum("hschout", $row, $hschout_vals, 4); - - end_table(); -?> -<p></p> -<table width="100%"> -<tr> - <td align=center colspan=3> - Allocate - <input type=text name=quant size=2 maxlength=2 value=" 1"> - board serial number(s) - </td> -</tr> -<tr> - <td align=center colspan=3> - <input type=checkbox name=geneths checked> - Generate Ethernet Address(es) - </td> -</tr> -<tr> - <td colspan=3> - - </td> -</tr> -<tr> - <td align=center> - <input type=submit value="Register Board"> - </td> - <td> - - </td> - <td align=center> - <input type=reset value="Reset Form Contents"> - </td> -</tr> -</table> -</form> -<?php - pg_foot(); -?> diff --git a/tools/bddb/newlog.php b/tools/bddb/newlog.php deleted file mode 100644 index 609bb85..0000000 --- a/tools/bddb/newlog.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> -<?php - // (C) Copyright 2001 - // Murray Jensen <Murray.Jensen@csiro.au> - // CSIRO Manufacturing Science and Technology, Preston Lab - - // edit page (hymod_bddb / boards) - - require("defs.php"); - - pg_head("$bddb_label - New Log Entry"); - - 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> -<?php - echo "<input type=hidden name=serno value=$serno>\n"; - - begin_table(3); - - // date date - print_field("date", array('date' => date("Y-m-d"))); - - // who char(20) - print_field("who", array()); - - // details text - print_field_multiline("details", array(), 60, 10, 'text_filter'); - - end_table(); -?> -<p></p> -<table width="100%"> -<tr> - <td align=center> - <input type=submit value="Add Log Entry"> - </td> - <td align=center> - <input type=reset value="Reset Form Contents"> - </td> -</tr> -</table> -</form> -<?php - pg_foot(); -?> |