]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - tools/bddb/doedlog.php
db27c37eb937d1fbaefbca74fb60920c4c2044f1
[karo-tx-uboot.git] / tools / bddb / doedlog.php
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
29         if (isset($details))
30                 $query.=", details='" . rawurlencode($details) . "'";
31
32         $query.=" where serno=$serno and logno=$logno";
33
34         mysql_query($query);
35         if(mysql_errno()) {
36                 $errstr = mysql_error();
37                 echo "\t<font size=+4>\n";
38                 echo "\t\t<p>\n";
39                 echo "\t\t\tThe following error was encountered:\n";
40                 echo "\t\t</p>\n";
41                 echo "\t\t<center>\n";
42                 printf("\t\t\t<b>%s</b>\n", $errstr);
43                 echo "\t\t</center>\n";
44                 echo "\t</font>\n";
45         }
46         else {
47                 echo "\t<font size=+2>\n";
48                 echo "\t\t<p>\n";
49                 echo "\t\t\tThe log entry with log number <b>$logno</b> and\n";
50                 echo "\t\t\tserial number <b>$serno</b> ";
51                 echo "was successfully updated\n";
52                 echo "\t\t</p>\n";
53                 echo "\t</font>\n";
54         }
55
56 ?>
57 <p>
58 <table align=center width="100%">
59 <tr>
60   <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a></td>
61   <td align=center><a href="index.php">Back to Start</a></td>
62 </tr>
63 </table>
64 <?php
65         pg_foot();
66 ?>