From b17a8c113fdaf68a2ecc314602a61a327934d4d6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Pigeon Date: Fri, 12 Dec 2025 06:11:00 -0500 Subject: [PATCH] Better way to change display language --- www/gesdis.php | 14 +++-- www/gessql.php | 4 +- www/index.php | 143 ++++++++++++++++++++++++++++++++++++++++++++++++- www/lvllog.php | 4 ++ www/unilng.php | 3 ++ 5 files changed, 162 insertions(+), 6 deletions(-) mode change 120000 => 100644 www/index.php diff --git a/www/gesdis.php b/www/gesdis.php index b4a3982..3bf19e8 100644 --- a/www/gesdis.php +++ b/www/gesdis.php @@ -18,8 +18,16 @@ function topper($isadmin,$logname,$pageref) { global $userlang; +global $dislang; $entete=getenv("APPNAME"); +$sellang = << + + + + +EOT; $click1=""; $click2=""; $click3=""; @@ -28,6 +36,7 @@ if ($isadmin==true) $admcolor="red"; switch ($pageref) { case "lvllog" : + $sellang=""; break; case "lvlmai" : $entete=gettranslate($userlang,"Main screen"); @@ -78,10 +87,7 @@ $entete + + + + + +
- + $sellang $logname diff --git a/www/gessql.php b/www/gessql.php index 272201e..bad49ca 100644 --- a/www/gessql.php +++ b/www/gessql.php @@ -241,6 +241,7 @@ function sql_setlogname($dbsql) global $isadmin; global $logname; global $userlang; +global $dislang; $OPEP="gessql.php:sql_setlogname"; @@ -291,6 +292,7 @@ while ($proceed==true) { } break; case 5 : //getting user working language + $dislang="en"; $userlang=lng::en; $language=$stmt->fetch(PDO::FETCH_ASSOC)['lang']; rou_alert(0,"$OPEP, JMPDBG langage=$language"); @@ -298,10 +300,10 @@ while ($proceed==true) { switch ($language) { case "FRA" : $userlang=lng::fr; + $dislang="fr"; break; case "ENG" : default : //NO BREAK - $userlang=lng::en; break; } } diff --git a/www/index.php b/www/index.php deleted file mode 120000 index 336b484..0000000 --- a/www/index.php +++ /dev/null @@ -1 +0,0 @@ -lvllog.php \ No newline at end of file diff --git a/www/index.php b/www/index.php new file mode 100644 index 0000000..d0f465a --- /dev/null +++ b/www/index.php @@ -0,0 +1,142 @@ + +
+ + Authentication + +
+ + + +
+
+ + + + + + + + + + +
Email: + + +
Password: + + + Show +
+ + + + + +
+ + + + + +
+ +
+
+
+
+
+
+
+ +EOT; + +return $STR; +} + +//============================================================== +// +// To display login screen body +// +//============================================================== +function body() + +{ +global $isadmin; + +$start=starthtml("translations"); +$stop=endhtml(); +$top=topper($isadmin,NULL,"lvllog"); +$footer=footer("lvllog"); +$login=login(); + +$STR = <<"; + echo "alert('wrong username or password. Please try again.');"; + echo ""; + break; + default : + header('Location: lvlmai.php'); + break; + } + } + +//display main screen +echo body(); +?> + + + diff --git a/www/lvllog.php b/www/lvllog.php index fd0b774..d0f465a 100644 --- a/www/lvllog.php +++ b/www/lvllog.php @@ -43,6 +43,10 @@ $STR = <<Email: + diff --git a/www/unilng.php b/www/unilng.php index c02e9ec..439b715 100644 --- a/www/unilng.php +++ b/www/unilng.php @@ -4,6 +4,8 @@ // To manage language // //============================================================== +include_once "subrou.php"; + //list of available word @@ -32,6 +34,7 @@ function gettranslate(lng $lang,$mot) { global $TR; +rou_alert(0,"JMPDBG lang="); foreach ($TR as $row) { if ($row[0]===$mot) { switch ($lang) { -- 2.47.3