79 lines
2.7 KiB
PHP
Executable File
79 lines
2.7 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// reqUpdate UPDATE languenav menus
|
|
// -----------------------------------------------------
|
|
$nbLg=$_SESSION['nbLg'];
|
|
$continue=0;
|
|
$reqUpdate="UPDATE `languenav` SET ";
|
|
|
|
if (!empty($theMsg)) {
|
|
$theMsg=rtrim($theMsg);
|
|
$theMsg=ltrim($theMsg);
|
|
$theMsg=addslashes($theMsg);
|
|
$theMsg = htmlspecialchars($theMsg, ENT_QUOTES,"UTF-8",false);
|
|
$reqUpdate .=$_SESSION['lgCouranteCode']. "='" .$theMsg. "', ";
|
|
$continue=1;
|
|
}
|
|
|
|
// $reqUpdate .="afficher=" .$afficher. ", ";
|
|
|
|
if (!empty($theAlt)) {
|
|
$theAlt = addslashes($theAlt);
|
|
$theAlt = htmlspecialchars($theAlt, ENT_QUOTES,"UTF-8",false);
|
|
$reqUpdate .="alt" .$_SESSION['lgCouranteCode']. "='" .$theAlt. "', ";
|
|
$continue=1;
|
|
}
|
|
|
|
if (!empty($thePopup)) {
|
|
$thePopup = addslashes($thePopup);
|
|
$thePopup = htmlspecialchars($thePopup, ENT_QUOTES,"UTF-8",false);
|
|
$reqUpdate .="title" .$_SESSION['lgCouranteCode']. "='" .$thePopup. "', ";
|
|
$continue=1;
|
|
}
|
|
|
|
if (!empty($theLien)) {
|
|
$theLien = htmlspecialchars($theLien, ENT_QUOTES,"UTF-8",false);
|
|
$reqUpdate .="lien = '" .$theLien. "', ";
|
|
$continue=1;
|
|
}
|
|
|
|
// ecrasera the lien
|
|
if (!empty($theLienExterne)) {
|
|
$theLien = htmlspecialchars($theLienExterne, ENT_QUOTES,"UTF-8",false);
|
|
$reqUpdate .="lien = '" .$theLienExterne. "', ";
|
|
$continue=1;
|
|
}
|
|
|
|
|
|
// l'image/icone est gérée dans choixIco
|
|
$reqUpdate = substr($reqUpdate, 0, -2);
|
|
$reqUpdate .=" WHERE id=" .$idLanguenav. ";";
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqUpdate Menus' => $reqUpdate], 'menusReqUpdate.php');}
|
|
|
|
if ($continue==1) {
|
|
$resConn='';
|
|
try{
|
|
$resConn=$idPdo->query($reqUpdate) ;
|
|
|
|
// recup du libelle exact pour le message de reqUpdate
|
|
for ($i=0;$i<($nbLg);$i++) {
|
|
if ($_SESSION['lgCouranteCode']==$tableLangueCode[$i])
|
|
{$lDesc=$tableLangueDesc[$i];}
|
|
}
|
|
if ($resConn) { $admMsg .= 'La base de données a été mise à jour pour la langue : ' .$lDesc. '.';$admMsgClass='ok'; }
|
|
else {
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Erreur lors de la mise à jour de la base de données pour' => $lDesc], '');}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqUpdate' => $reqUpdate], 'menusReqUpdate.php');}
|
|
$admMsgClass='ko';
|
|
}
|
|
}
|
|
catch (PDOException $e) {
|
|
$admMsgClass .= "Erreur sql !";
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Exception PDO' => $e->getMessage(),'reqUpdate Menus' => $reqUpdate], 'menusReqUpdate.php');}
|
|
die();
|
|
}
|
|
}
|
|
else $admMsg .= "Vous n'avez pas fait de modifications.";
|
|
?>
|