From: Jean-Marc Pigeon Date: Mon, 8 Sep 2025 17:38:31 +0000 (-0400) Subject: able to define display limit within lvlusr X-Git-Tag: end-0.15~6 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=a8bfe519729403286b9320563e6a24ebbffb6a2b;p=jmp%2Fmailleur able to define display limit within lvlusr --- diff --git a/www/directives.js b/www/directives.js index eac8696..50ecc1f 100644 --- a/www/directives.js +++ b/www/directives.js @@ -1,18 +1,14 @@ // vim: smarttab tabstop=8 shiftwidth=2 expandtab -.table-userlist tr:nth-child(odd) - { - background-color: #0074ab ; - color: yellow ; - } - -.table-userlist tr:nth-child(even) - { - background-color: #e6f7ff ; - color: black ; - } - -.myTable { background-color:#eee;border-collapse:collapse; } -.myTable th { background-color:#000;color:white;width:50%; } -.myTable td, .myTable th { padding:5px;border:1px solid #000; } +//============================================================== +//function to update screen limit +//============================================================== +function updatelimit() + +{ +let limitvalue=document.getElementById("limit-choice").value; +limitvalue*=10; +document.getElementById("demo").innerHTML = limitvalue; +window.location.reload(); +} diff --git a/www/gesdis.php b/www/gesdis.php index a30e6b6..8d566e0 100644 --- a/www/gesdis.php +++ b/www/gesdis.php @@ -136,7 +136,7 @@ function starthtml($js) $JSTR=NULL; if ($js!=NULL) { $JSTR = << + EOT; } diff --git a/www/lvllog.php b/www/lvllog.php index 0d67498..cc08d95 100644 --- a/www/lvllog.php +++ b/www/lvllog.php @@ -99,7 +99,7 @@ function body() { global $isadmin; -$start=starthtml("translations.js"); +$start=starthtml("translations"); $stop=endhtml(); $top=topper($isadmin,NULL,"lvllog"); $footer=footer("lvllog"); diff --git a/www/lvlusr.php b/www/lvlusr.php index b68d723..13e63ab 100644 --- a/www/lvlusr.php +++ b/www/lvlusr.php @@ -10,6 +10,30 @@ include_once "unienv.php"; include_once "gesdis.php"; include_once "gessql.php"; +function tblheader(int $limit) + +{ +$STR = << +LEFT +

+ +
+ +
+ + +EOT; + +return $STR; +} + //section to generate the main screen body function body($logname) @@ -17,10 +41,15 @@ function body($logname) global $isadmin; global $logname; +$limit=20; +$agent_id=$_POST['tbllim']; +if ( $agent_id!=NULL) + $limit=intval($agent_id); +rou_alert(0,"JMPDBG agent_id=$agent_id limit=$limit"); $line=""; $count=0; $dbsql=sql_connect(); -$emails=sql_getemaillist($dbsql,20,NULL); +$emails=sql_getemaillist($dbsql,$limit,NULL); foreach($emails as $email) { $bgcolor="white"; if ($count & 1 ) { @@ -43,11 +72,11 @@ foreach($emails as $email) { } sql_close($dbsql); -$start=starthtml(NULL); +$start=starthtml("directives"); $stop=endhtml(); $top=topper($isadmin,$logname,"lvlusr"); $footer=footer("lvlusr"); - +$tblheader=tblheader($limit); $STR = <<
- +
+$tblheader +
@@ -76,6 +107,7 @@ $top $line
Email lastemail
+
$footer $stop