1 <?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?>
4 // Murray Jensen <Murray.Jensen@csiro.au>
5 // CSIRO Manufacturing Science and Technology, Preston Lab
7 // list page (hymod_bddb / boards)
11 pg_head("$bddb_label - Browse Board Log");
13 $serno=intval($serno);
15 die("serial number not specified or invalid!");
17 function print_cell($str) {
20 echo "\t<td>$str</td>\n";
23 <table align=center border=1 cellpadding=10>
34 $r=mysql_query("select * from boards where serno=$serno");
36 while($row=mysql_fetch_array($r)){
37 foreach ($columns as $key) {
38 if (!key_in_array($key, $row))
43 print_cell("<a href=\"edit.php?serno=$row[serno]\">$row[serno]</a>");
44 print_cell($row['ethaddr']);
45 print_cell($row['date']);
46 print_cell($row['batch']);
47 print_cell($row['type']);
48 print_cell($row['rev']);
49 print_cell($row['location']);
53 mysql_free_result($r);
59 $limit=abs(isset($_REQUEST['limit'])?$_REQUEST['limit']:20);
60 $offset=abs(isset($_REQUEST['offset'])?$_REQUEST['offset']:0);
61 $lr=mysql_query("select count(*) as n from log where serno=$serno");
62 $lrow=mysql_fetch_array($lr);
63 if($lrow['n']>$limit){
64 $preoffset=max(0,$offset-$limit);
65 $postoffset=$offset+$limit;
66 echo "<table width=\"100%\">\n<tr align=center>\n";
67 printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"<\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
68 printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\">\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
69 echo "</tr>\n</table>\n";
71 mysql_free_result($lr);
73 <table width="100%" border=1 cellpadding=10>
78 <th width="70%">details</th>
81 $r=mysql_query("select * from log where serno=$serno order by logno limit $offset,$limit");
83 while($row=mysql_fetch_array($r)){
85 print_cell("<a href=\"edlog.php?serno=$row[serno]&logno=$row[logno]\">$row[logno]</a>");
86 print_cell($row['date']);
87 print_cell($row['who']);
88 print_cell("<pre>" . urldecode($row['details']) . "</pre>");
92 mysql_free_result($r);
100 <a href="newlog.php?serno=<?php echo "$serno"; ?>">Add to Log</a>
103 <a href="index.php">Back to Start</a>