1 <?php // php pages made with phpMyBuilder <http://kyber.dk/phpMyBuilder> ?>
4 // Murray Jensen <Murray.Jensen@cmst.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 if (!isset($serno) || $serno == 0)
14 die("serial number not specified!");
16 function print_cell($str) {
19 echo "\t<td>$str</td>\n";
22 <table align=center border=1 cellpadding=10>
33 $r=mysql_query("select * from boards where serno=$serno");
35 while($row=mysql_fetch_array($r)){
36 foreach ($columns as $key) {
37 if (!key_in_array($key, $row))
42 print_cell("<a href=\"edit.php?serno=$row[serno]\">$row[serno]</a>");
43 print_cell($row['ethaddr']);
44 print_cell($row['date']);
45 print_cell($row['batch']);
46 print_cell($row['type']);
47 print_cell($row['rev']);
48 print_cell($row['location']);
52 mysql_free_result($r);
58 $limit=abs(isset($limit)?$limit:20);
59 $offset=abs(isset($offset)?$offset:0);
60 $lr=mysql_query("select count(*) as n from log where serno=$serno");
61 $lrow=mysql_fetch_array($lr);
62 if($lrow['n']>$limit){
63 $preoffset=max(0,$offset-$limit);
64 $postoffset=$offset+$limit;
65 echo "<table width=\"100%\">\n<tr align=center>\n";
66 printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\"<\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
67 printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\">\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
68 echo "</tr>\n</table>\n";
70 mysql_free_result($lr);
72 <table width="100%" border=1 cellpadding=10>
76 <th width="70%">details</th>
79 $r=mysql_query("select * from log where serno=$serno order by logno limit $offset,$limit");
81 while($row=mysql_fetch_array($r)){
83 print_cell("<a href=\"edlog.php?serno=$row[serno]&logno=$row[logno]\">$row[logno]</a>");
84 print_cell($row['date']);
85 print_cell("<pre>" . urldecode($row['details']) . "</pre>");
89 mysql_free_result($r);
97 <a href="newlog.php?serno=<?php echo "$serno"; ?>">Add to Log</a>
100 <a href="index.php">Back to Start</a>