102 lines
3.1 KiB
PHP
Executable File
102 lines
3.1 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
$theParam='';
|
|
$theAPage='';
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['activation pour la page ' => $theNomPage, ' etat' =>$activPage], '');}
|
|
|
|
switch ($theNomPage) {
|
|
case 'Pub1':
|
|
$theAPage='74';
|
|
$theParam=8;
|
|
break;
|
|
|
|
case 'Pub2':
|
|
$theAPage='297';
|
|
$theParam=9;
|
|
break;
|
|
|
|
case 'Pub3':
|
|
$theAPage='337';
|
|
$theParam=10;
|
|
break;
|
|
|
|
case 'modePaie':
|
|
$theAPage=15;
|
|
$theParam='';
|
|
break;
|
|
|
|
case 'modeLiv':
|
|
$theAPage=16;
|
|
$theParam='';
|
|
break;
|
|
|
|
case 'menuKisn':
|
|
$theAPage=18;
|
|
$theParam='';
|
|
break;
|
|
|
|
case 'menuContact':
|
|
$theAPage=19;
|
|
$theParam='';
|
|
break;
|
|
|
|
case 'menuCdv':
|
|
$theAPage=20;
|
|
$theParam='';
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// on mets à jour thmParam, car c'est un espace
|
|
if ($theParam!='') {
|
|
if ($activPage=='') {$activPage=0;}
|
|
$reqUpdate="UPDATE `thmParam` SET val=" .$activPage. " WHERE id=" .$theParam. " AND idTheme=" .$_SESSION['idTheme']. " ;";
|
|
$result='';
|
|
$resConn=$idPdo->query($reqUpdate) ;
|
|
if ($resConn) {
|
|
if (isset($debug[2]) && $debug[2] == '1') $debugMsg .= monDebug(2, ['La page' => $theNomPage, ' a bien été mise à jour avec le statut' => $activPage], '');
|
|
$admMsgClass='ok';
|
|
if (isset($debug[2]) && $debug[2] == '1') $debugMsg .= monDebug(2, ['reqUpdate param=' => $reqUpdate], 'updateActivPage.php');
|
|
}
|
|
else {
|
|
if (isset($debug[2]) && $debug[2] == '1') $debugMsg .= monDebug(2, ['Erreur lors de la mise à jour du status' => $theNomPage, 'Erreur mysql' => $idPdo -> connect_error, 'N°' => $idPdo->errno ],'');
|
|
$admMsgClass='ko';
|
|
}
|
|
}
|
|
else{
|
|
if (isset($debug[2]) && $debug[2] == '1') $debugMsg .= monDebug(2, ['<brPas de param page' => $theParam], '');
|
|
}
|
|
|
|
// on met a jour languenav car c'est un menu
|
|
// pour pub il y a les 2, car anciennement on utilisait menu. Ensuite on a utilisé la table des parametres des themes, mais on ne peut pas enlever menu trop d'impact sur la numérotation
|
|
if ($theAPage != '') {
|
|
try {
|
|
$reqUpdate = "UPDATE `languenav` SET afficher=" . $activPage . " WHERE id=" . $theAPage . ";";
|
|
$result = '';
|
|
$resConn = $idPdo->query($reqUpdate);
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2, ['reqUpdate' => $reqUpdate], '');
|
|
}
|
|
if ($resConn) {
|
|
// Ne pas avoir 2 fois le message
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2, ['La page' => $theNomPage, ' a bien été mise à jour avec le statut affichage ' => $activPage], '');
|
|
}
|
|
} else {
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2, ['Erreur lors de la mise à jour du status' => $theNomPage, 'Erreur mysql' => $idPdo->connect_error, 'N°' => $idPdo->errno], '');
|
|
}
|
|
}
|
|
} catch (Exception $e) {
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2, ['Erreur lors de l\'exécution de la requête SQL' => $e->getMessage()], '');
|
|
}
|
|
}
|
|
} else {
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2, ['<brPas de nom Page' => $theAPage], '');
|
|
}
|
|
}
|
|
?>
|