From d6b79012397bfe8da539765a7b786fa2c04b587b Mon Sep 17 00:00:00 2001 From: Jean-Marc Pigeon Date: Mon, 24 Nov 2025 10:33:15 -0500 Subject: [PATCH] Starting to improve lvlmai.php --- www/lvlmai.php | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/www/lvlmai.php b/www/lvlmai.php index e72dc9c..e0a1b5a 100644 --- a/www/lvlmai.php +++ b/www/lvlmai.php @@ -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 = <<