From 481b5b0eac2d368c3ac4901b22d445ffef8b506f Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Sun, 5 Apr 2026 16:39:24 +0000 Subject: [PATCH] a --- Framework/Functions.php | 2728 +++++++++++++++++++++++---------------- 1 file changed, 1637 insertions(+), 1091 deletions(-) diff --git a/Framework/Functions.php b/Framework/Functions.php index 1c64896..63fab46 100755 --- a/Framework/Functions.php +++ b/Framework/Functions.php @@ -1,1091 +1,1637 @@ -format($number))); -} - -function format_N($nombre) -{ - if (is_numeric($nombre)) - { - return number_format($nombre, 0, ',', ' '); - } else - { - // return "0"; - return ""; - } -} - -function heureFr($d) -{ - if ($d<="0000-00-00") return ""; - return date("d/m/Y", strtotime($d)); -} - -function dateFr($d) -{ - if ($d<="0000-00-00") return ""; - return date("d/m/Y", strtotime($d)); -} - -function dateEng($d) -{ - if ($d<="0000-00-00") return ""; - return date("m/d/Y", strtotime($d)); -} - -function dateLang($d, $lang=null) -{ - if (isset($lang) && $lang=="en_US") - { - // return dateEng($d); - return dateFr($d); - } - else - { - return dateFr($d); - } -} - -function dateheureFr($d) -{ - if ($d<="0000-00-00") return ""; - return date("d/m/Y", strtotime($d)).' '.substr($d,-8); -} - -function dateheureEng($d) -{ - if ($d<="0000-00-00") return ""; - return date("m/d/Y", strtotime($d)).' '.substr($d,-8); -} - -function dateheureLang($d, $lang=null) -{ - if (isset($lang) && $lang=="en_US") - { - // return dateheureEng($d); - return dateheureFr($d); - } - else - { - return dateheureFr($d); - } -} - -function heureCourante() -{ - return date("d/m/Y H:i:s"); -} - -function heureCouranteLang($lang=null) -{ - if (isset($lang) && $lang=="en_US") - { - // return heureCouranteEng(); - return heureCouranteFr(); - } - else - { - return heureCouranteFr(); - } -} - -function heureCouranteFr() -{ - return date("d/m/Y H:i:s"); -} - -function heureCouranteEng() -{ - return date("m/d/Y H:i:s"); -} - -function dateCouranteLang($lang=null) -{ - if (isset($lang) && $lang=="en_US") - { - // return dateCouranteEng(); - return dateCouranteFr(); - } - else - { - return dateCouranteFr(); - } -} - -function dateToFrench($date, $format) -{ - $english_days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); - $french_days = array('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'); - $english_months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); - $french_months = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'); - return str_replace($english_months, $french_months, str_replace($english_days, $french_days, date($format, strtotime($date) ) ) ); -} -function dateCouranteFr() -{ - return date('d/m/Y'); -} - -function dateCouranteEng() -{ - return date("m/d/Y"); -} - -function heureCouranteSql() -{ - return date("Y-m-d H:i:s"); -} - -function dateJourSql() -{ - return date("Y-m-d"); -} - - -function existeParam($param) -{ - return (($param!==null) && ($param != "")); -} - -function contruireParam($param) -{ - return ($param == null) ? "" : trim($param); -} - -function contruireParamLike($param) -{ - $p=($param == null) ? "" : trim($param); - return "%".$p."%"; -} - -function liste_options($liste,$val_def,$strict=false) -{ - // '; - } - else - { - $select = $strict ? '' : ''; - } - - foreach ($liste as $option): - $select .= ' '; - if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US") - { - $select = $strict ? '' : ''; - } - else - { - $select = $strict ? '' : ''; - } - - foreach ($liste as $option): - $select .= '