<TR>
<TH align=left>
<FORM action="lvlusr.php" method="post">
-<button name="scanner" value="gottop">
+<input type="hidden" name="offset" value="$offset"/>
+<input type="hidden" name="limit" value="$limit"/>
+<button name="scanner" value="gofirst">
<FONT SIZE=+3>
⇤
</FONT>
</Button>
-<button name="scanner" value="rewind">
+<button name="scanner" value="goprevious">
<FONT SIZE=+3>
←
</FONT>
</Button>
-<FONT SIZE=+2>$offset/$numrec</FONT>
-<button name="scanner" value="forward">
+<button name="scanner" value="gonext">
<FONT SIZE=+3>
→
</FONT>
⇥
</FONT>
</Button>
+<FONT SIZE=+2>$offset/$numrec</FONT>
</FORM>
</TH>
<TD align=right>
<FORM method="post">
-<select name="tbllim" onchange='if (this.value!=0) {this.form.submit();}'>
+<input type="hidden" name="offset" value="$offset"/>
+<select name="limit" style="font-size: 130%;" onchange='if (this.value!=0) {this.form.submit();}'>
<option selected="selected">$limit</option>
<option value=20>20</option>
<option value=40>40</option>
global $logname;
$limit=20;
-$scanner=$_POST['scanner'];
-rou_alert(0,"JMPDBG scanner=$scanner");
-$agent_id=$_POST['tbllim'];
-if ( $agent_id!=NULL)
- $limit=intval($agent_id);
-$offset=2*$limit;
-$line="";
+$offset=0;
$dbsql=sql_connect();
$numrec=sql_getnumrec($dbsql,"emails");
+if (isset($_POST['limit']))
+ $limit=intval($_POST['limit']);
+if (isset($_POST['offset']))
+ $offset=intval($_POST['offset']);
+if (isset($_POST['scanner'])) {
+ $scanner=$_POST['scanner'];
+ switch ($scanner) {
+ case "golast" :
+ $offset=$numrec-$limit;
+ break;
+ case "gonext" :
+ $offset+=$limit;
+ if ($offset>($numrec-$limit))
+ $offset=$numrec-$limit;
+ break;
+ case "goprevious" :
+ $offset-=$limit;
+ if ($offset<0)
+ $offset=0;
+ break;
+ case "gofirst" :
+ $offset=0;
+ break;
+ default :
+ break;
+ }
+ rou_alert(0,"JMPDBG scanner=$scanner");
+ }
+rou_alert(0,"JMPDBG scanner=$scanner offset=$offset");
+$line="";
$emails=sql_getemaillist($dbsql,$limit,$offset);
$count=$offset;
foreach($emails as $email) {