]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Able to scan email received list (lvlmai.php)
authorJean-Marc Pigeon <jmp@safe.c>
Mon, 24 Nov 2025 19:39:42 +0000 (14:39 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Mon, 24 Nov 2025 19:39:42 +0000 (14:39 -0500)
www/lvlmai.php

index 2192aa0d89101333dcc2ae593f2a4345184be651..3a485a39f83b080ccf522a65af4d6b5d07912d4c 100644 (file)
@@ -10,6 +10,73 @@ include_once "unienv.php";
 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>
+&larrb;
+</FONT>
+</Button>
+<button name="scanner" value="goprevious">
+<FONT SIZE=+3>
+&larr;
+</FONT>
+</Button>
+<button name="scanner" value="gonext">
+<FONT SIZE=+3>
+&rarr;
+</FONT>
+</Button>
+<button name="scanner" value="golast">
+<FONT SIZE=+3>
+&rarrb;
+</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
@@ -20,10 +87,6 @@ function body($logname)
 {
 global $isadmin;
 
-$start=starthtml(NULL);
-$stop=endhtml();
-$top=topper($isadmin,$logname,"lvlmai");
-$footer=footer("lvlmai");
 
 $limit=20;
 $offset=0;
@@ -36,12 +99,32 @@ $rqst=NEW probe("actions",$limit,$offset);
 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);
@@ -86,7 +169,13 @@ foreach($actions as $action) {
   $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
@@ -95,6 +184,7 @@ $start
 $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>