]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Able to search within user list
authorJean-Marc Pigeon <jmp@safe.c>
Tue, 9 Sep 2025 09:24:50 +0000 (05:24 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Tue, 9 Sep 2025 09:24:50 +0000 (05:24 -0400)
www/gessql.php
www/lvlusr.php

index 80fe7cf4e4d88befb25980a8488664b15a836032..502e257908f08d24add381d78523dfe9e7653cbf 100644 (file)
@@ -165,14 +165,17 @@ rou_alert(0,"$OPEP, now logname=<$logname>");
 //      Function to retreive a some email record
 //
 //==============================================================
-function sql_getemaillist($dbsql,$limit,$skip)
+function sql_getemaillist($dbsql,$username,$limit,$skip)
 
 {
 $OPEP="gessql.php:sql_getemaillist";
 
 $strlim="";
 $strskip="";
-$strsel="Select * from emails order by email asc";
+$select="";
+if ($username!=NULL) 
+  $select="where email like '%$username%'";
+$strsel="Select * from emails $select order by email asc";
 if ($limit!=NULL) 
   $strlim="limit $limit";
 if ($skip!=NULL) 
index 76e6ff7763f1314ccf1745138e3c444d4e75bb6c..282a9c736379fae508216bd61c71e71cd18fb9da 100644 (file)
@@ -13,9 +13,13 @@ include_once "gessql.php";
 function tblheader(int $numrec,int $offset,int $limit)
 
 {
+global $userlang;
+
+$email=gettranslate($userlang,"Email");
+
 $STR  = <<<EOT
 <TR>
-<TH align=left>
+<TD align=left>
 <FORM action="lvlusr.php" method="post">
 <input type="hidden" name="offset" value="$offset"/>
 <input type="hidden" name="limit" value="$limit"/>
@@ -41,7 +45,16 @@ $STR  = <<<EOT
 </Button>
 <FONT SIZE=+2>$offset/$numrec</FONT>
 </FORM>
-</TH>
+</TD>
+<TD align=left>
+<FORM action="lvlusr.php" method="post">
+<FONT SIZE=+1>
+$email:
+<input type="text" name="username" 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="offset" value="$offset"/>
@@ -69,8 +82,12 @@ global $logname;
 
 $limit=20;
 $offset=0;
+$username=NULL;
 $dbsql=sql_connect();
 $numrec=sql_getnumrec($dbsql,"emails");
+if (isset($_POST['username']))
+  $username=($_POST['username']);
+rou_alert(0,"Post jmpdbg=<$username>");
 if (isset($_POST['limit']))
   $limit=intval($_POST['limit']);
 if (isset($_POST['offset']))
@@ -101,7 +118,7 @@ if (isset($_POST['scanner'])) {
   }
 rou_alert(0,"JMPDBG scanner=$scanner offset=$offset");
 $line="";
-$emails=sql_getemaillist($dbsql,$limit,$offset);
+$emails=sql_getemaillist($dbsql,$username,$limit,$offset);
 $count=$offset;
 foreach($emails as $email) {
   $bgcolor="white";
@@ -162,6 +179,8 @@ $line
 </Table>
 </Table>
 </CENTER>
+<BR>
+<BR>
 $footer
 $stop
 EOT;