alpha_full/admin/agencement/musique/musiqueReqUpdate.php
2026-04-06 22:58:51 +02:00

65 lines
2.9 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// -----------------------------------------------------
// reqUpdate
// -----------------------------------------------------
$idParm=335;
$trouve=false;
$resConn='';
if (!empty($thePopup)) $thePopup = addslashes($thePopup);
$thePopup=htmlspecialchars($thePopup, ENT_QUOTES,"UTF-8",false);
if (!empty($theAlt)) $theAlt = addslashes($theAlt);
$theAlt=htmlspecialchars($theAlt, ENT_QUOTES,"UTF-8",false);
$theMsg="-";
$reqUpdate="UPDATE `languenav` SET ";
$reqUpdate .= $_SESSION['lgCouranteCode']. "='" .$theMsg. "', ";
if ($theAlt!='') {$reqUpdate .= "alt" .$_SESSION['lgCouranteCode']. "='" .$theAlt. "', ";$trouve=true;}
if ($theSon!='') {$reqUpdate .= "imgPt" .$_SESSION['lgCouranteCode']. "='" .$theSon. "', ";$trouve=true;}
if ($thePopup!='') {$reqUpdate .= "title" .$_SESSION['lgCouranteCode']. "='" .$thePopup. "', ";$trouve=true;}
if ($theClasse!='') {$reqUpdate .= "class='" .$theClasse. "' "; $trouve=true;}
// la derniere sequence à tjrs une virgule et espace, on l'enleve
$rest = strlen($reqUpdate)-2;
$reqUpdate=substr($reqUpdate,0,$rest);
$reqUpdate .= " WHERE id=" .$idParm. ";";
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (2,['reqUpdate' => $reqUpdate ], 'musiqueReqUpdate.php');}
if ($trouve==true) {
$resConn='';
$resConn=$idPdo->query($reqUpdate) ;
// -----------------------------------------------------
// recup du libelle exact pour le message de reqUpdateuete//
// -----------------------------------------------------
for ($i=0;$i<($_SESSION['nbLgActives']);$i++) {
if ($_SESSION['lgCouranteCode']==$tableLangueCode[$i]) {$lDesc=$_SESSION['tableLangueMsg'][$i];}
}
// -----------------------------------------------------
// Fichier audio : sera includé dans player depuis headerContainer
// -----------------------------------------------------
$retour='';
$audioFic = "<?php \n";
$audioFic .= 'echo \'<audio id="bgAudio" class="bgAudio" controlsList="nodownload" preload="auto" src="' .$theSon. '" type="audio/mp3" style="width:100px;height:30px;color:powderblue;" autoplay > </audio>\';';
$audioFic .= "\n?>";
$retour=file_put_contents($includePathPublication. '/musique/musique' .$_SESSION['lgCouranteCode']. '.php',$audioFic);
// -----------------------------------------------------
// Usr msg
// -----------------------------------------------------
if ($resConn) {
$admMsg .= 'Le fichier audio a été mise à jour pour la langue : ' .$lDesc; $admMsgClass='ok';
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['retour' => $retour ], '');}
}
else {
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Erreur lors de la mise à jour du fichier audio pour' => $lDesc, 'Erreur mysql' => $idPdo->errno ], '');}
$admMsgClass='ko';
}
} //trouve
else {
$admMsg .= 'Pas de modification. ';
}
?>