1 <?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?>
4 // Murray Jensen <Murray.Jensen@csiro.au>
5 // CSIRO Manufacturing Science and Technology, Preston Lab
7 // doedit page (hymod_bddb / boards)
11 pg_head("$bddb_label - Edit Board Results");
14 die("the board serial number was not specified");
16 $query="update boards set";
18 if (isset($ethaddr)) {
19 if (!eth_addr_is_valid($ethaddr))
20 die("ethaddr is invalid ('$ethaddr')");
21 $query.=" ethaddr='$ethaddr',";
25 list($y, $m, $d) = split("-", $date);
26 if (!checkdate($m, $d, $y) || $y < 1999)
27 die("date is invalid (input '$date', " .
28 "yyyy-mm-dd '$y-$m-$d')");
29 $query.=" date='$date'";
33 if (strlen($batch) > 32)
34 die("batch field too long (>32)");
35 $query.=", batch='$batch'";
39 if (!in_array($type, $type_vals))
40 die("Invalid type ($type) specified");
41 $query.=", type='$type'";
45 if (($rev = intval($rev)) <= 0 || $rev > 255)
46 die("Revision number is invalid ($rev)");
47 $query.=sprintf(", rev=%d", $rev);
50 if (isset($location)) {
51 if (strlen($location) > 64)
52 die("location field too long (>64)");
53 $query.=", location='$location'";
57 $query.=", comments='" . rawurlencode($comments) . "'";
59 $query.=gather_enum_multi_query("sdram", 4);
61 $query.=gather_enum_multi_query("flash", 4);
63 $query.=gather_enum_multi_query("zbt", 16);
65 $query.=gather_enum_multi_query("xlxtyp", 4);
66 $nxlx = count_enum_multi("xlxtyp", 4);
68 $query.=gather_enum_multi_query("xlxspd", 4);
69 if (count_enum_multi("xlxspd", 4) != $nxlx)
70 die("number of xilinx speeds not same as number of types");
72 $query.=gather_enum_multi_query("xlxtmp", 4);
73 if (count_enum_multi("xlxtmp", 4) != $nxlx)
74 die("number of xilinx temps. not same as number of types");
76 $query.=gather_enum_multi_query("xlxgrd", 4);
77 if (count_enum_multi("xlxgrd", 4) != $nxlx)
78 die("number of xilinx grades not same as number of types");
81 $query.=", cputyp='$cputyp'";
83 die("must specify cpu speed if cpu type is defined");
84 $query.=", cpuspd='$cpuspd'";
86 die("must specify cpm speed if cpu type is defined");
87 $query.=", cpmspd='$cpmspd'";
89 die("must specify bus speed if cpu type is defined");
90 $query.=", busspd='$busspd'";
94 die("can't specify cpu speed if there is no cpu");
96 die("can't specify cpm speed if there is no cpu");
98 die("can't specify bus speed if there is no cpu");
101 if (isset($hschin)) {
102 if (($hschin = intval($hschin)) < 0 || $hschin > 4)
103 die("Invalid number of hs input chans ($hschin)");
107 if (isset($hschout)) {
108 if (($hschout = intval($hschout)) < 0 || $hschout > 4)
109 die("Invalid number of hs output chans ($hschout)");
114 $query.=", hstype='$hstype'";
117 die("number of high-speed input channels must be zero"
118 . " if high-speed chip is not present");
120 die("number of high-speed output channels must be zero"
121 . " if high-speed chip is not present");
123 $query.=", hschin='$hschin'";
124 $query.=", hschout='$hschout'";
126 $query.=" where serno=$serno";
130 $errstr = mysql_error();
131 echo "\t<font size=+4>\n";
133 echo "\t\t\tThe following error was encountered:\n";
135 echo "\t\t<center>\n";
136 printf("\t\t\t<b>%s</b>\n", $errstr);
137 echo "\t\t</center>\n";
141 $sernos = array($serno);
144 write_eeprom_cfg_file();
146 echo "\t<font size=+2>\n";
148 echo "\t\t\tThe board with serial number <b>$serno</b> was"
149 . " successfully updated";
151 $errstr = $cfgerrs[0];
153 echo "(but the cfg file update failed: $errstr)";
162 <table align=center width="100%">
164 <td align=center><a href="browse.php">Back to Browse</a></td>
165 <td align=center><a href="index.php">Back to Start</a></td>