]> SAFE projects GIT repository - jmp/mailleur/commitdiff
able to define display limit within lvlusr
authorJean-Marc Pigeon <jmp@safe.c>
Mon, 8 Sep 2025 17:38:31 +0000 (13:38 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Mon, 8 Sep 2025 17:38:31 +0000 (13:38 -0400)
www/directives.js
www/gesdis.php
www/lvllog.php
www/lvlusr.php

index eac869691f65248fef2c35e61fdc1fc629e02750..50ecc1f67581e9ab5ae8916417bbe1d906a674e6 100644 (file)
@@ -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();
+}
 
index a30e6b61689c6185978f63bfee62da01dc3dc7f3..8d566e083acde39089b324b4935a0e5248b0a7a0 100644 (file)
@@ -136,7 +136,7 @@ function starthtml($js)
 $JSTR=NULL;
 if ($js!=NULL) {
   $JSTR = <<<EOT
-  <script defer src="$js"></script>
+  <script defer src="$js.js"></script>
   EOT;
   }
 
index 0d6749887e46c00c9f2bceb1218a26b3c69d7bca..cc08d9577af4b1910bf04037ea3f7835fbbce1aa 100644 (file)
@@ -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");
index b68d7236106453c8c693453edd949a1595948634..13e63ab622a9112a3112726d93ebb08ee580a833 100644 (file)
@@ -10,6 +10,30 @@ include_once "unienv.php";
 include_once "gesdis.php";
 include_once "gessql.php";
 
+function tblheader(int $limit)
+
+{
+$STR  = <<<EOT
+<TR>
+<TH align=left>LEFT</TH>
+<TD align=center> <p id="demo"></p> </TD>
+<TD align=right>
+<FORM method="post">
+<select name="tbllim" 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
 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  = <<<EOT
 $start
@@ -67,7 +96,9 @@ $top
 </style>
 
 <CENTER>
-<table class="table-userlist" WIDTH="80%" BORDER="1" CellSpacing="0">
+<table WIDTH="100%" BORDER="0" CellSpacing="0">
+$tblheader
+<table class="table-userlist" WIDTH="100%" BORDER="1" CellSpacing="0">
 <TR>
 <TH align=center>Email</TH>
 <TH align=center>lastemail</TH>
@@ -76,6 +107,7 @@ $top
 </TR>
 $line
 </Table>
+</Table>
 </CENTER>
 $footer
 $stop