doedlog.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // doedit page (hymod_bddb / boards)
  7. require("defs.php");
  8. pg_head("$bddb_label - Edit Log Entry Results");
  9. if ($serno == 0)
  10. die("the board serial number was not specified");
  11. if (!isset($logno) || $logno == 0)
  12. die("log number not specified!");
  13. $query="update log set";
  14. if (isset($date)) {
  15. list($y, $m, $d) = split("-", $date);
  16. if (!checkdate($m, $d, $y) || $y < 1999)
  17. die("date is invalid (input '$date', " .
  18. "yyyy-mm-dd '$y-$m-$d')");
  19. $query.=" date='$date'";
  20. }
  21. if (isset($who))
  22. $query.=", who='" . $who . "'";
  23. if (isset($details))
  24. $query.=", details='" . rawurlencode($details) . "'";
  25. $query.=" where serno=$serno and logno=$logno";
  26. mysql_query($query);
  27. if(mysql_errno()) {
  28. $errstr = mysql_error();
  29. echo "\t<font size=+4>\n";
  30. echo "\t\t<p>\n";
  31. echo "\t\t\tThe following error was encountered:\n";
  32. echo "\t\t</p>\n";
  33. echo "\t\t<center>\n";
  34. printf("\t\t\t<b>%s</b>\n", $errstr);
  35. echo "\t\t</center>\n";
  36. echo "\t</font>\n";
  37. }
  38. else {
  39. echo "\t<font size=+2>\n";
  40. echo "\t\t<p>\n";
  41. echo "\t\t\tThe log entry with log number <b>$logno</b> and\n";
  42. echo "\t\t\tserial number <b>$serno</b> ";
  43. echo "was successfully updated\n";
  44. echo "\t\t</p>\n";
  45. echo "\t</font>\n";
  46. }
  47. ?>
  48. <p>
  49. <table align=center width="100%">
  50. <tr>
  51. <td align=center><a href="brlog.php?serno=<?php echo "$serno"; ?>">Back to Log</a></td>
  52. <td align=center><a href="index.php">Back to Start</a></td>
  53. </tr>
  54. </table>
  55. <?php
  56. pg_foot();
  57. ?>