wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 1 | <?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?> |
| 2 | <?php |
| 3 | // (C) Copyright 2001 |
| 4 | // Murray Jensen <Murray.Jensen@cmst.csiro.au> |
| 5 | // CSIRO Manufacturing Science and Technology, Preston Lab |
| 6 | |
| 7 | // doedit page (hymod_bddb / boards) |
| 8 | |
| 9 | require("defs.php"); |
| 10 | |
| 11 | pg_head("$bddb_label - Edit Log Entry Results"); |
| 12 | |
| 13 | if ($serno == 0) |
| 14 | die("the board serial number was not specified"); |
| 15 | |
| 16 | if (!isset($logno) || $logno == 0) |
| 17 | die("log number not specified!"); |
| 18 | |
| 19 | $query="update log set"; |
| 20 | |
| 21 | if (isset($date)) { |
| 22 | list($y, $m, $d) = split("-", $date); |
| 23 | if (!checkdate($m, $d, $y) || $y < 1999) |
| 24 | die("date is invalid (input '$date', " . |
| 25 | "yyyy-mm-dd '$y-$m-$d')"); |
| 26 | $query.=" date='$date'"; |
| 27 | } |
| 28 | |
wdenk | 6dd652f | 2003-06-19 23:40:20 +0000 | [diff] [blame] | 29 | if (isset($who)) |
| 30 | $query.=", who='" . $who . "'"; |
| 31 | |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 32 | if (isset($details)) |
| 33 | $query.=", details='" . rawurlencode($details) . "'"; |
| 34 | |
| 35 | $query.=" where serno=$serno and logno=$logno"; |
| 36 | |
| 37 | mysql_query($query); |
| 38 | if(mysql_errno()) { |
| 39 | $errstr = mysql_error(); |
| 40 | echo "\t<font size=+4>\n"; |
| 41 | echo "\t\t<p>\n"; |
| 42 | echo "\t\t\tThe following error was encountered:\n"; |
| 43 | echo "\t\t</p>\n"; |
| 44 | echo "\t\t<center>\n"; |
| 45 | printf("\t\t\t<b>%s</b>\n", $errstr); |
| 46 | echo "\t\t</center>\n"; |
| 47 | echo "\t</font>\n"; |
| 48 | } |
| 49 | else { |
| 50 | echo "\t<font size=+2>\n"; |
| 51 | echo "\t\t<p>\n"; |
| 52 | echo "\t\t\tThe log entry with log number <b>$logno</b> and\n"; |
| 53 | echo "\t\t\tserial number <b>$serno</b> "; |
| 54 | echo "was successfully updated\n"; |
| 55 | echo "\t\t</p>\n"; |
| 56 | echo "\t</font>\n"; |
| 57 | } |
| 58 | |
| 59 | ?> |
| 60 | <p> |
| 61 | <table align=center width="100%"> |
| 62 | <tr> |
| 63 | <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a></td> |
| 64 | <td align=center><a href="index.php">Back to Start</a></td> |
| 65 | </tr> |
| 66 | </table> |
| 67 | <?php |
| 68 | pg_foot(); |
| 69 | ?> |