include_once "gesdis.php";
include_once "gessql.php";
+function tblheader(string $remoteip,int $numrec,int $offset,int $limit)
+
+{
+global $userlang;
+
+$debut=$offset+1;
+$email=gettranslate($userlang,"Received email");
+
+$STR = <<<EOT
+<TR>
+<TD align=left>
+<FORM action="lvlrmt.php" method="post">
+<input type="hidden" name="username" value="$username"/>
+<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="goprevious">
+<FONT SIZE=+3>
+←
+</FONT>
+</Button>
+<button name="scanner" value="gonext">
+<FONT SIZE=+3>
+→
+</FONT>
+</Button>
+<button name="scanner" value="golast">
+<FONT SIZE=+3>
+⇥
+</FONT>
+</Button>
+<FONT SIZE=+2>$debut/$numrec</FONT>
+</FORM>
+</TD>
+<TD align=left>
+<FORM action="lvlrmt.php" method="post">
+<FONT SIZE=+1>
+$email:
+<input type="text" value="$username" name="remoteip" size=20 style="font-size: 100%;">
+<input type="submit" style="display:none"/>
+</FONT>
+</FORM>
+</TD>
+<TD align=right>
+<FORM method="post">
+<input type="hidden" name="username" value="$username"/>
+<input type="hidden" name="offset" value="$offset"/>
+<input type="hidden" name="limit" value="$limit"/>
+<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>
+<option value=80>80</option>
+<option value=100>100</option>
+</SELECT>
+</FORM>
+</TD>
+</TR>
+EOT;
+
+return $STR;
+}
+
//==============================================================
//
// section to generate the main screen body
{
global $isadmin;
-$start=starthtml(NULL);
-$stop=endhtml();
-$top=topper($isadmin,$logname,"lvlmai");
-$footer=footer("lvlmai");
$limit=20;
$offset=0;
if (isset($_POST['username'])) {
$username=trim(($_POST['username']));
$rqst->where("smtpfrom","like","%$username%");
+}
+$numrec=$rqst->getnumrec();
+if (isset($_POST['scanner'])) {
+ $scanner=$_POST['scanner'];
+ switch ($scanner) {
+ case "golast" :
+ $offset=$rqst->goLast();
+ break;
+ case "gonext" :
+ $offset=$rqst->goNext();
+ break;
+ case "goprevious" :
+ $offset=$rqst->goPrevious();
+ break;
+ case "gofirst" :
+ $offset=$rqst->goFirst();
+ break;
+ default :
+ break;
+ }
}
$actions=$rqst->order("smtpfrom asc")
->limit($limit)
->GET();
$line="";
-$count=$offset+1;
+$count=$offset;
foreach($actions as $action) {
rou_alert(0,"JMPDBG count=$count");
$info=substr($action['info'],3,1);
$line=$line."</TR>";
//end of generation
$count++;
- }
+}
+$start=starthtml(NULL);
+$stop=endhtml();
+$top=topper($isadmin,$logname,"lvlmai");
+$footer=footer("lvlmai");
+$tblheader=tblheader($username,$numrec,$offset,$limit);
+
$rqst->close();
$STR = <<<EOT
$top
<CENTER>
<table WIDTH="100%" BORDER="0" CellSpacing="0">
+$tblheader
<table class="table-userlist" WIDTH="100%" BORDER="1" CellSpacing="0">
<TR>
<TH align=center>Status</TH>