1 <?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?>
4 // Murray Jensen <Murray.Jensen@cmst.csiro.au>
5 // CSIRO Manufacturing Science and Technology, Preston Lab
7 // doedit page (hymod_bddb / boards)
11 pg_head("$bddb_label - Add Log Entry Results");
14 die("serial number not specified!");
17 die("log number must not be set ($logno) when Creating!");
19 $query="update log set serno=$serno";
21 list($y, $m, $d) = split("-", $date);
22 if (!checkdate($m, $d, $y) || $y < 1999)
23 die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')");
24 $query.=", date='$date'";
27 $query.=", who='" . $who . "'";
30 $query.=", details='" . rawurlencode($details) . "'";
32 // echo "final query = '$query'<br>\n";
36 mysql_query("insert into log (logno) values (null)");
38 $sqlerr = mysql_error();
40 $logno = mysql_insert_id();
42 $sqlerr = "couldn't allocate new serial number";
44 mysql_query($query . " where logno=$logno");
46 $sqlerr = mysql_error();
51 echo "<font size=+2>\n";
53 echo "\t\tA log entry with log number '$logno' was " .
54 "added to the board with serial number '$serno'\n";
59 echo "\t<font size=+4>\n";
61 echo "\t\t\tThe following SQL error was encountered:\n";
63 echo "\t\t<center>\n";
64 printf("\t\t\t<b>%s</b>\n", $sqlerr);
65 echo "\t\t</center>\n";
73 <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Go to Browse</a></td>
74 <td align=center><a href="index.php">Back to Start</a></td>