blob: 7009aa7dad15a97535f0a0cfc37626b01dd473e6 [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001<?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?>
2<?php
3 // (C) Copyright 2001
Wolfgang Denkb3b0fd52005-08-12 23:20:59 +02004 // Murray Jensen <Murray.Jensen@csiro.au>
wdenkfe8c2802002-11-03 00:38:21 +00005 // 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 Denkd992daf2005-08-12 23:27:18 +020013 if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '')
wdenkfe8c2802002-11-03 00:38:21 +000014 die("the board serial number was not specified");
Wolfgang Denkd992daf2005-08-12 23:27:18 +020015 $serno=intval($_REQUEST['serno']);
wdenkfe8c2802002-11-03 00:38:21 +000016
Wolfgang Denkd992daf2005-08-12 23:27:18 +020017 if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '')
wdenkfe8c2802002-11-03 00:38:21 +000018 die("log number not specified!");
Wolfgang Denkd992daf2005-08-12 23:27:18 +020019 $logno=intval($_REQUEST['logno']);
wdenkfe8c2802002-11-03 00:38:21 +000020
21 $query="update log set";
22
Wolfgang Denkd992daf2005-08-12 23:27:18 +020023 if (isset($_REQUEST['date'])) {
24 $date=$_REQUEST['date'];
wdenkfe8c2802002-11-03 00:38:21 +000025 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 Denkd992daf2005-08-12 23:27:18 +020032 if (isset($_REQUEST['who'])) {
33 $who=$_REQUEST['who'];
wdenk6dd652f2003-06-19 23:40:20 +000034 $query.=", who='" . $who . "'";
Wolfgang Denkd992daf2005-08-12 23:27:18 +020035 }
wdenk6dd652f2003-06-19 23:40:20 +000036
Wolfgang Denkd992daf2005-08-12 23:27:18 +020037 if (isset($_REQUEST['details'])) {
38 $details=$_REQUEST['details'];
wdenkfe8c2802002-11-03 00:38:21 +000039 $query.=", details='" . rawurlencode($details) . "'";
Wolfgang Denkd992daf2005-08-12 23:27:18 +020040 }
wdenkfe8c2802002-11-03 00:38:21 +000041
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?>