alpha_full/admin/options/langues/langues.php
2026-04-06 22:58:51 +02:00

240 lines
12 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// -----------------------------------------------------
// Tables qui on une Langue pour faire un ajout avec alter table
// -----------------------------------------------------
// - langueNav
// -----------------------------------------------------
// -----------------------------------------------------
// Tables qui on une Langue pour faire un ajout avec datas
// -----------------------------------------------------
// - sous CategoriesLibelle (fait demo)
// - famillesibelle (fait demo) =categories
// - modePaieLibelle (fait demo)
// - modeLivLibelle (fait demo)
// - paysLivLibelle (fait demo)
// - codesLangueLibelle (fait demo)
// - caLibDyn (fait demo)
// - etatPrd (fait demo)
// - produitsLib (fait demo)
// - referencement (fait demo)
// - statusclis (fait demo)
// - unitesdelais (fait demo)
// - unitespoids (fait demo)
// - unitesdim (fait demo)
// -----------------------------------------------------
// Fichiers a générer
// -----------------------------------------------------
// - rererencement
// - publicité
// reste tous les CA
// -----------------------------------------------------
// Variables
// -----------------------------------------------------
$idCodeLgTab=array();
$afficherLgTab=array();
$codeLangueTab=array();
$libelleLgTab=array();
$imDrapeauWebTab=array();
$drapeauTitleTab=array();
$drapeauAltTab=array();
$drapeauLienTab=array();
$theIDLg='';
$theActivLg='';
$theLibLg='';
$theTitle='';
$theAlt='';
$theLien='';
$theCode='';
$creerFicLangue=0;
$theDesc='';
// -----------------------------------------------------
// Post
// -----------------------------------------------------
include ("langues.post.php");
// -----------------------------------------------------
// Update
// -----------------------------------------------------
if ($codeOpe==='upActiv') {include ("langues.reqUpActiv.php");}
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update activ' => ''], '');}
if ($codeOpe==='update') {include ("langues.reqUpdateLg.php");}
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update lib' => ''], '');}
if ($codeOpe==='updateDesc') {include ("langues.reqUpdateLgDesc.php");}
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update lib' => ''], '');}
// -----------------------------------------------------
// Upload
// -----------------------------------------------------
if ($codeOpe=='upIco' && isset($_FILES['fileToUpload' .$theIDLg]['tmp_name'])) {
$target_dir = "../Design/_icones_web/";
$targetExtension =['jpeg', 'jpg', 'png', 'svg', 'bmp'];
$targetSize ='5242880'; //5 Mo
$largeurMax = 0;
$hauteurMax = 0;
$largeurMin = 0;
$hauteurMin = 0;
$_FILES['fileToUpload']=$_FILES['fileToUpload' .$theIDLg];
include ($includePathAdmin. "/_fonctions/uploadGenerique.php");
if ($uploadOk==1) include ("langues.reqUpIco.php");
}
else {
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update ico' => ''], '');}
}
// -----------------------------------------------------
// Requete count langues
// -----------------------------------------------------
if (empty($tableLangueCode) or $refresh=='Oui') { include ($includePath. "/req/03-init.langueActives.php"); }
// -----------------------------------------------------
// Select
// -----------------------------------------------------
include ($includePath. "/req/03-init.langueListAll.php");
include ("langues.reqSelect.php");
// -----------------------------------------------------
// Debug
// -----------------------------------------------------
if (isset($debug[1]) && $debug[1] == '1') {include ("langues.debug.php");}
// -----------------------------------------------------
// Form
// -----------------------------------------------------
echo '<form name="LgF" id="LgF" method="POST" enctype="multipart/form-data" >';
// -----------------------------------------------------
// Creer un fichier export mysql pour le traduire et faire la requete traduite
// -----------------------------------------------------
if ($creerFicLangue==1) {include ("CREER LG.php");}
if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .='<span class="boutonsWebmaster" onClick="document.getElementById(\'creerFicLangue\').value=1; document.LgF.submit();" > Generer fichier de traduction </span>';
// -----------------------------------------------------
// Champs cachés
// -----------------------------------------------------
echo '<input type="hidden" value="' .$creerFicLangue. '" name="creerFicLangue" id="creerFicLangue" >';
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" />';
echo '<input type="hidden" name="theIDLg" id="theIDLg" value="' .$theIDLg. '" />';
echo '<input type="hidden" name="theActivLg" id="theActivLg" value="' .$theActivLg. '" />';
echo '<input type="hidden" name="theLibLg" id="theLibLg" value="' .$theLibLg. '" />';
echo '<input type="hidden" name="theAlt" id="theAlt" value="' .$theAlt. '" />';
echo '<input type="hidden" name="theTitle" id="theTitle" value="' .$theTitle. '" />';
echo '<input type="hidden" name="theLien" id="theLien" value="' .$theLien. '" />';
echo '<input type="hidden" name="theCode" id="theCode" value="' .$theCode. '" />';
echo '<input type="hidden" name="theDesc" id="theDesc" value="' .$theDesc. '" />';
echo '<input type="hidden" name="lg" id="lg" value="' .$lg. '" />';
// -----------------------------------------------------
// List box langues
// -----------------------------------------------------
if ($_SESSION['nbLg']>1) {
echo '<div id="zoneRechercheWbm" >';
$lgLien="affAdmin=6&optAff=6";
include ($includePathAdmin. "/drapeaux/drapeauxListBox.php");
echo '</div>';
}
echo '<div id="zoneFormWbm" style="text-align:left;w idth:99%; " >';
// -----------------------------------------------------
// Entete colonne
// -----------------------------------------------------
echo '<div onClick="admMsgClear();" id="langueListe" class="fondColorListe" style="display:grid;grid-template-columns:15% 9% 6% 14% 14% auto 14% ; padding:0px; grid-row-gap:0px; width:100%;" >';
echo '<span style="grid-column:1;" class="libelleLV">Libellé</span>';
echo '<span style="grid-column:2; " class="libelleLV">&#160;Activation</span>';
echo '<span style="grid-column:3; " class="libelleLV">&#160;Icône</span>';
echo '<span style="grid-column:4; " class="libelleLV">&#160;Texte de remplacement</span>';
echo '<span style="grid-column:5; " class="libelleLV">&#160;Info-bulle</span>';
echo '<span style="grid-column:6; " class="libelleLV">&#160;Lien</span>';
echo '<span style="grid-column:7; " class="libelleLV">&#160;Description</span>';
// echo '<span style="grid-column:8; " class="libelleLV">&#160;Code</span>';
// echo '<span style="grid-column:9; " class="libelleLV">&#160;Action</span>';
for ($i=0; $i<count($codeLangueTab); $i++) {
// echo '<div class="libChampsWebmaster" style="background-color:white;width:99.9%; border-radius:0px;border:0px; padding:8px;margin:0px; margin-bottom:1px;" >';
// -----------------------------------------------------
// Libelle
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:1;" >';
// echo $idCodeLgTab[$i];
echo '<input class="inputLV" type="text" style="width:90%;" onChange="upLibLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\')" id="libLg' .$idCodeLgTab[$i]. '" value="' .$libelleLgTab[$i]. '" title="Libellé de la langue"/>';
echo '</span>';
// -----------------------------------------------------
// Activation
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:2;">Activer :';
if ($afficherLgTab[$i]==1) {
echo '<input class="inputLV" type="checkbox" checked class="checkBoxWbm" onClick="activerLG(\'' .$idCodeLgTab[$i]. '\');" id="activLg' .$idCodeLgTab[$i]. '" value="1" title="Activation de la langue" >';
}
else
{echo '<input class="inputLV" type="checkbox" class="checkBoxWbm" onClick="activerLG(\'' .$idCodeLgTab[$i]. '\');" id="activLg' .$idCodeLgTab[$i]. '" value="0" title="Activation de la langue" >';
}
echo '</span>';
// -----------------------------------------------------
// Ico
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:3;" >';
echo '<input class="inputLV" type="hidden" id="icoLg" value="' .$imDrapeauWebTab[$i]. '" title="Icône" >';
echo '&#160;';
echo '<label for="fileToUpload' .$idCodeLgTab[$i]. '" >';
echo '<img style="vertical-align: middle;max-width:50px" src=".' .$imDrapeauWebTab[$i]. '" />';
echo '</span>';
echo '</label>';
echo '<input style="display:none;" type="file" name="fileToUpload' .$idCodeLgTab[$i]. '" id="fileToUpload' .$idCodeLgTab[$i]. '" onChange="upIcoLg(\'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" >';
echo '</span>';
// -----------------------------------------------------
// Alt
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:4;" >';
echo '<input class="inputLV" type="text" style="width:90%;" onChange="upAltLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" id="altLg' .$idCodeLgTab[$i]. '" value="' .$drapeauAltTab[$i]. '" title="Texte de remplacement de l\'image" >';
echo '</span>';
// -----------------------------------------------------
// Title
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:5;" >';
echo '<input class="inputLV" type="text" style="width:90%;" onChange="upTitleLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" id="titleLg' .$idCodeLgTab[$i]. '" value="' .$drapeauTitleTab[$i]. '" title="Infobulle de la langue" >';
echo '</span>';
// -----------------------------------------------------
// Lien
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:6;" >';
echo '<input class="inputLV" type="text" style="width:90%;" onChange="upLienLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" id="lienLg' .$idCodeLgTab[$i]. '" value="' .$drapeauLienTab[$i]. '" title="Lien pour recharger le site dans la langue choisie" >';
echo '</span>';
// -----------------------------------------------------
// Description
// -----------------------------------------------------
echo '<span class="celluleLV" style="grid-column:7;" >';
echo '<input class="inputLV" type="text" style="width:90%;" onChange="upDescLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" id="descLg' .$idCodeLgTab[$i]. '" value="' .$descriptionLgTab[$i]. '" title="Description de la langue" >';
echo '</span>';
// -----------------------------------------------------
// Code --> on ne peut pas le changer sans impacts : garder pour debug
// -----------------------------------------------------
// echo '<span class="celluleLV" style="grid-column:8;" >';
// echo '<input class="inputLV" type="text"style="width:99%;" onChange="upCodeLg(this.value, \'' .$idCodeLgTab[$i]. '\', \'' .$codeLangueTab[$i]. '\');" id="codeLg' .$idCodeLgTab[$i]. '" value="' .$codeLangueTab[$i]. '" title="Code technique de la langue"/>';
// echo '</span>';
// -----------------------------------------------------
// Action
// -----------------------------------------------------
// echo '<span title="Supprimer / désactiver une valeur" class="celluleLV" style="grid-column:9;" >';
// echo '<i class="fad fa-trash-alt" style="color:red;fill:red;cursor:pointer;"> </i>';
// echo '</span>';
}
echo '</div>';
echo '</div>';
echo '</form>';
?>