80 lines
3.8 KiB
PHP
Executable File
80 lines
3.8 KiB
PHP
Executable File
<?php
|
|
// $nomFicAppelant = basename(__FILE__);
|
|
|
|
// -----------------------------------------------------
|
|
// Req UPDATE affichage
|
|
// -----------------------------------------------------
|
|
$idParm=$navID[25]; //315
|
|
|
|
if (isset($idParm)) {
|
|
|
|
$nb = dynRequete_update("UPDATE", "languenav", [ 'afficher' => $afficher ], ["id" => $idParm], 'constrReqUpdate.php', 0, $debug[2]);
|
|
if ($nb !== false && $nb > 0) {
|
|
$admMsg .= "<br>Affichage passé à $afficher";
|
|
$admMsgClass = 'ok';
|
|
} else {
|
|
$debugMsg .= "La requête a été exécutée mais aucun changement n'a été éffectué";
|
|
$admMsgClass = 'ko';
|
|
}
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Req UPDATE valeurs
|
|
// -----------------------------------------------------
|
|
if (!empty($theMsg)) $theMsg = addslashes($theMsg);
|
|
$theMsg=htmlspecialchars($theMsg, ENT_QUOTES,"UTF-8",false);
|
|
|
|
if (!empty($theAlt)) $theAlt = addslashes($theAlt);
|
|
$theAlt=htmlspecialchars($theAlt, ENT_QUOTES,"UTF-8",false);
|
|
|
|
if (!empty($thePopup)) $thePopup = addslashes($thePopup);
|
|
if (!empty($theMsg)) $thePopup=htmlspecialchars($thePopup, ENT_QUOTES,"UTF-8",false);
|
|
|
|
$refresh='Oui'; include($includePath. "/req/03-init.langueActives.php");$refresh='N';
|
|
|
|
if($propager==1) {
|
|
|
|
for ($i=0; $i<($_SESSION['nbLgActives']); $i++) {
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['$tableLangueCode[' => $i, ']' => $tableLangueCode[$i],'$_SESSION[lgCouranteCode]' => $_SESSION['lgCouranteCode'], '$code langue pour google =' => ''], '');}
|
|
|
|
if ($tableLangueCode[$i] != $_SESSION['lgCouranteCode'] && $theMsg!='-') {
|
|
$theMsg= gTranslate($theMsg, strtolower( substr ($tableLangueCode[$i], 0, -1) ) );
|
|
$theAlt= gTranslate($theAlt, strtolower( substr ($tableLangueCode[$i], 0, -1) ) );
|
|
$thePopup= gTranslate($thePopup, strtolower( substr ($tableLangueCode[$i], 0, -1) ) );
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (1,['theMsg translated' => $theMsg, 'theAlt translated' => $theAlt, 'thePopup translated' => $thePopup],''); }
|
|
}
|
|
$lDesc=$tableLangueDesc[$i];
|
|
|
|
if (!empty($idParm)) {
|
|
// $nb === 0 → aucune ligne modifiée (idCat inexistant ou déjà à 1)
|
|
$nb = dynRequete_update("UPDATE", "languenav", [ $tableLangueCode[$i] => $theMsg, 'alt' .$tableLangueCode[$i] => $theAlt, 'imgPt'.$tableLangueCode[$i] => $theImage, 'title'.$tableLangueCode[$i] => $thePopup ], ["id" => $idParm], 'constrReqUpdate.php', 0, $debug[2]);
|
|
if ($nb !== false && $nb > 0) {
|
|
$admMsg .= "<br>La base de données a été mise à jour pour la langue : $lDesc. <b>Message traduit</b> :<br> $theMsg";
|
|
$admMsgClass = 'ok';
|
|
} else {
|
|
$debugMsg .= "<br>La requête a été exécutée mais aucun changement n'a été éffectué pour $lDesc";
|
|
$admMsgClass = 'ko';
|
|
}
|
|
}
|
|
else {if (isset($debug[2]) && $debug[2] == '1' ) {$admMsg .= 'idParm vide dans constrReqUpdate.php';} }
|
|
}
|
|
}
|
|
else {
|
|
if (!empty($idParm)) {
|
|
// $nb === 0 → aucune ligne modifiée (idCat inexistant ou déjà à 1)
|
|
$nb = dynRequete_update("UPDATE", "languenav", [ $_SESSION['lgCouranteCode'] => $theMsg, 'alt' .$_SESSION['lgCouranteCode'] => $theAlt, 'imgPt'.$_SESSION['lgCouranteCode'] => $theImage, 'title'.$_SESSION['lgCouranteCode'] => $thePopup ], ["id" => $idParm], 'constrReqUpdate.ph', 0, $debug[2]);
|
|
if ($nb !== false && $nb > 0) {
|
|
$admMsg .= "La base de données a été mise à jour pour la langue";
|
|
$admMsgClass = 'ok';
|
|
} else {
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= "Erreur lors de la mise à jour de la base de données";
|
|
$admMsgClass = 'ko';
|
|
}
|
|
}
|
|
}
|
|
else {if (isset($debug[2]) && $debug[2] == '1' ) {$admMsg .= 'idParm vide dans constrReqUpdate.php';} }
|
|
}
|
|
?>
|