]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to improve lvlmai.php
authorJean-Marc Pigeon <jmp@safe.c>
Mon, 24 Nov 2025 15:33:15 +0000 (10:33 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Mon, 24 Nov 2025 15:33:15 +0000 (10:33 -0500)
www/lvlmai.php

index e72dc9c1df8fb34ea194f9f909787a45695ea784..e0a1b5a1f2d10b4ae7e84b583dde160eb9eb6dd2 100644 (file)
@@ -10,25 +10,6 @@ include_once "unienv.php";
 include_once "gesdis.php";
 include_once "gessql.php";
 
-//==============================================================
-//
-//      Procedure to extract the list of actions
-//
-//==============================================================
-function getactions($dbsql,$offset)
-
-{
-$limit=20;
-if (isset($_POST['username']))
-  $username=trim(($_POST['username']));
-if (isset($_POST['limit']))
-  $limit=intval($_POST['limit']);
-$numrec=sql_getnumactions($dbsql,$username);
-$actions=sql_getactionslist($dbsql,$username,$limit,$offset);
-
-return $actions;
-}
-
 //==============================================================
 //
 //      section to generate the main screen body
@@ -44,12 +25,21 @@ $stop=endhtml();
 $top=topper($isadmin,$logname,"lvlmai");
 $footer=footer("lvlmai");
 
+$limit=20;
 $offset=0;
 $username="";
+if (isset($_POST['limit']))
+  $limit=intval($_POST['limit']);
 if (isset($_POST['offset']))
   $offset=intval($_POST['offset']);
-$dbsql=sql_connect();
-$actions=getactions($dbsql,$offset);
+$rqst=NEW probe("actions",$limit,$offset);
+if (isset($_POST['username'])) {
+  $username=trim(($_POST['username']));
+  $rqst->where("username","like","%$username%");
+  }
+$actions=$rqst->order("username asc")
+              ->limit($limit)
+              ->GET();
 $line="";
 $count=$offset+1;
 foreach($actions as $action) {
@@ -97,7 +87,7 @@ foreach($actions as $action) {
   //end of generation
   $count++;
   }
-sql_close($dbsql);
+$rqst->close();
 
 $STR  = <<<EOT