alpha_full/admin/pages/page/reqPage/pageReqSelect.php
2026-04-06 22:58:51 +02:00

56 lines
2.0 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
if ($theIdPage !='') {
if (!isset($forceLg) ) $forceLg=0;
if ($forceLg != 1 ) {
$theLgF = $_SESSION['lgCouranteCode']; }
else {
for ($l=0; $l<$_SESSION['nbLg']; $l++) {
if ($lg==$tableLangueCode[$l]) $theLgF= $tableLangueCode[$l]; ;
}
}
$reqSelect="SELECT * from `pages` WHERE id=" .$theIdPage. " and codeLangue='" .$theLgF. "' ;";
if (isset($debug[2]) && $debug[2] == '1') $debugMsg .= monDebug(2,['reqSelect' => $reqSelect],'pageReqSelect.php');
try {
$resConn2=$idPdo->query($reqSelect);
if ($resConn2) {
// si la requête a fonctionnée
if ($resConn2->rowCount()>0) {
// si la requête a retourné au moins un enregistrement
$tabResult = $resConn2->fetch(PDO::FETCH_ASSOC);
$theDescPage=$tabResult['description'];
$theNomPage=$tabResult['nom'];
$theFicPage=$tabResult['fichier'];
$theEmplacement=$tabResult['emplacement'];
$tabCodeLanguePage=$tabResult['codeLangue'];
$absolu=$tabResult['absolu'];
$_SESSION['theNomPage']=$theNomPage;
$_SESSION['absolu']=$absolu;
if (isset($debug[2]) && $debug[2] == '1') {
$debugMsg .= monDebug(2, [
'<br>descPage=' => $theDescPage,
'theNomPage=' => $theNomPage,
'theFicPage=' => $theFicPage,
'theEmplacement=' => $theEmplacement,
'tabCodeLanguePage' => $tabCodeLanguePage
], '');
}
}
else {
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de resultats pour cette page :' => $theIdPage], '');}
$admMsgClass='ko';
}
}
}
catch(PDOException $e) {
$admMsg .= "<br>Nous sommes désolés, les données ne peuvent pas être affichées.";
$admMsgClass='ko';
}
}
else {
$admMsg .= "<br>Nous sommes désolés, les données ne peuvent pas être affichées.";
if (isset($debug[2]) && $debug[2] == '1' ) "theIdPage est vide";
$admMsgClass='ko';
}
?>