Update Hymod Board Database PHP code in "tools" directory
Patch by Murray Jensen, 01 Jul 2005
This commit is contained in:
@@ -10,8 +10,9 @@
|
||||
|
||||
pg_head("$bddb_label - Browse Board Log");
|
||||
|
||||
if (!isset($serno) || $serno == 0)
|
||||
die("serial number not specified!");
|
||||
$serno=intval($serno);
|
||||
if ($serno == 0)
|
||||
die("serial number not specified or invalid!");
|
||||
|
||||
function print_cell($str) {
|
||||
if ($str == '')
|
||||
@@ -55,16 +56,16 @@
|
||||
<hr></hr>
|
||||
<p></p>
|
||||
<?php
|
||||
$limit=abs(isset($limit)?$limit:20);
|
||||
$offset=abs(isset($offset)?$offset:0);
|
||||
$limit=abs(isset($_REQUEST['limit'])?$_REQUEST['limit']:20);
|
||||
$offset=abs(isset($_REQUEST['offset'])?$_REQUEST['offset']:0);
|
||||
$lr=mysql_query("select count(*) as n from log where serno=$serno");
|
||||
$lrow=mysql_fetch_array($lr);
|
||||
if($lrow['n']>$limit){
|
||||
$preoffset=max(0,$offset-$limit);
|
||||
$postoffset=$offset+$limit;
|
||||
echo "<table width=\"100%\">\n<tr align=center>\n";
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
echo "</tr>\n</table>\n";
|
||||
}
|
||||
mysql_free_result($lr);
|
||||
|
||||
Reference in New Issue
Block a user