From: Jean-Marc Pigeon Date: Mon, 24 Nov 2025 19:39:42 +0000 (-0500) Subject: Able to scan email received list (lvlmai.php) X-Git-Tag: tag-0.18~9 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=7176796b3a77ea2b2d6377bec98cbb887077a1bc;p=jmp%2Fmailleur Able to scan email received list (lvlmai.php) --- diff --git a/www/lvlmai.php b/www/lvlmai.php index 2192aa0..3a485a3 100644 --- a/www/lvlmai.php +++ b/www/lvlmai.php @@ -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 = << + +
+ + + + + + + +$debut/$numrec +
+ + +
+ +$email: + + + +
+ + +
+ + + + +
+ + +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.""; //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 = << +$tblheader
Status