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 |
Wolfgang Denk | b3b0fd5 | 2005-08-12 23:20:59 +0200 | [diff] [blame] | 4 | // Murray Jensen <Murray.Jensen@csiro.au> |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 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 | |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 13 | if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 14 | die("the board serial number was not specified"); |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 15 | $serno=intval($_REQUEST['serno']); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 16 | |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 17 | if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '') |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 18 | die("log number not specified!"); |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 19 | $logno=intval($_REQUEST['logno']); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 20 | |
| 21 | $query="update log set"; |
| 22 | |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 23 | if (isset($_REQUEST['date'])) { |
| 24 | $date=$_REQUEST['date']; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 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'"; |
| 30 | } |
| 31 | |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 32 | if (isset($_REQUEST['who'])) { |
| 33 | $who=$_REQUEST['who']; |
wdenk | 6dd652f | 2003-06-19 23:40:20 +0000 | [diff] [blame] | 34 | $query.=", who='" . $who . "'"; |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 35 | } |
wdenk | 6dd652f | 2003-06-19 23:40:20 +0000 | [diff] [blame] | 36 | |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 37 | if (isset($_REQUEST['details'])) { |
| 38 | $details=$_REQUEST['details']; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 39 | $query.=", details='" . rawurlencode($details) . "'"; |
Wolfgang Denk | d992daf | 2005-08-12 23:27:18 +0200 | [diff] [blame^] | 40 | } |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 41 | |
| 42 | $query.=" where serno=$serno and logno=$logno"; |
| 43 | |
| 44 | mysql_query($query); |
| 45 | if(mysql_errno()) { |
| 46 | $errstr = mysql_error(); |
| 47 | echo "\t<font size=+4>\n"; |
| 48 | echo "\t\t<p>\n"; |
| 49 | echo "\t\t\tThe following error was encountered:\n"; |
| 50 | echo "\t\t</p>\n"; |
| 51 | echo "\t\t<center>\n"; |
| 52 | printf("\t\t\t<b>%s</b>\n", $errstr); |
| 53 | echo "\t\t</center>\n"; |
| 54 | echo "\t</font>\n"; |
| 55 | } |
| 56 | else { |
| 57 | echo "\t<font size=+2>\n"; |
| 58 | echo "\t\t<p>\n"; |
| 59 | echo "\t\t\tThe log entry with log number <b>$logno</b> and\n"; |
| 60 | echo "\t\t\tserial number <b>$serno</b> "; |
| 61 | echo "was successfully updated\n"; |
| 62 | echo "\t\t</p>\n"; |
| 63 | echo "\t</font>\n"; |
| 64 | } |
| 65 | |
| 66 | ?> |
| 67 | <p> |
| 68 | <table align=center width="100%"> |
| 69 | <tr> |
| 70 | <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a></td> |
| 71 | <td align=center><a href="index.php">Back to Start</a></td> |
| 72 | </tr> |
| 73 | </table> |
| 74 | <?php |
| 75 | pg_foot(); |
| 76 | ?> |