]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Abale to keep search string within input field
authorJean-Marc Pigeon <jmp@safe.c>
Tue, 9 Sep 2025 09:34:28 +0000 (05:34 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Tue, 9 Sep 2025 09:34:28 +0000 (05:34 -0400)
www/lvlusr.php

index 282a9c736379fae508216bd61c71e71cd18fb9da..4cdb33d9e444fbbaa75ace503f736503d4286cd8 100644 (file)
@@ -10,7 +10,7 @@ include_once "unienv.php";
 include_once "gesdis.php";
 include_once "gessql.php";
 
-function tblheader(int $numrec,int $offset,int $limit)
+function tblheader(string $username,int $numrec,int $offset,int $limit)
 
 {
 global $userlang;
@@ -21,6 +21,7 @@ $STR  = <<<EOT
 <TR>
 <TD align=left>
 <FORM action="lvlusr.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">
@@ -50,14 +51,16 @@ $STR  = <<<EOT
 <FORM action="lvlusr.php" method="post">
 <FONT SIZE=+1>
 $email:
-<input type="text" name="username" size=20 style="font-size: 100%;">
+<input type="text" value="$username" 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="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>
@@ -82,7 +85,7 @@ global $logname;
 
 $limit=20;
 $offset=0;
-$username=NULL;
+$username="";
 $dbsql=sql_connect();
 $numrec=sql_getnumrec($dbsql,"emails");
 if (isset($_POST['username']))
@@ -114,9 +117,7 @@ if (isset($_POST['scanner'])) {
     default             :
       break;
     }
-  rou_alert(0,"JMPDBG scanner=$scanner");
   }
-rou_alert(0,"JMPDBG scanner=$scanner offset=$offset");
 $line="";
 $emails=sql_getemaillist($dbsql,$username,$limit,$offset);
 $count=$offset;
@@ -146,7 +147,7 @@ $start=starthtml("directives");
 $stop=endhtml();
 $top=topper($isadmin,$logname,"lvlusr");
 $footer=footer("lvlusr");
-$tblheader=tblheader($numrec,$offset,$limit);
+$tblheader=tblheader($username,$numrec,$offset,$limit);
 
 $STR  = <<<EOT
 $start