72 lines
2.5 KiB
PHP
Executable File
72 lines
2.5 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
|
|
// -----------------------------------------------------
|
|
// Requete select volet from nomCSS (mysql=theme)
|
|
// -----------------------------------------------------
|
|
if (!isset($nomCss) && isset($_GET['nomCss'])) $nomCss=$_GET['nomCss'];
|
|
|
|
// -----------------------------------------------------
|
|
// 1° tentative
|
|
// -----------------------------------------------------
|
|
$reqSelect="SELECT theme, nom FROM `" .$nomThemeCss. "` WHERE nom = '" .$nomCss. "';";
|
|
$result='';
|
|
$resConn='';
|
|
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug(2, ['theVoletCss before' => $theVoletCss, 'reqSelect' => $reqSelect],'css.voletFromNomcss.php');
|
|
|
|
$resConn=$idPdo->query($reqSelect) ;
|
|
$i=0;
|
|
$trouve=false;
|
|
if ($resConn) {
|
|
while ($result=$resConn->fetch(PDO::FETCH_BOTH)) {
|
|
if ($nomCss == $result['nom'] || '#' .$nomCss==$result['nom']) {
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug(2, ['cssNomTab[' .$i. '] trouvé' => $result['nom'] ],''); }
|
|
$theVoletCss=$result['theme'];
|
|
$trouve=true;
|
|
}
|
|
$i++;
|
|
} //while
|
|
}
|
|
|
|
// Debug
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2,['trouve' => $trouve,'nomCss' => $nomCss,'theVoletCss' => $theVoletCss ],'');}
|
|
|
|
// -----------------------------------------------------
|
|
// 2° tentative
|
|
// -----------------------------------------------------
|
|
if ($trouve ===false ) {
|
|
$reqSelect="SELECT theme, nom FROM `" .$nomThemeCss. "` WHERE nom = '#" .$nomCss. "';";
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug(2,['reqSelect 2' => $reqSelect],'css.voletFromNomcss.php');}
|
|
$result='';
|
|
$resConn='';
|
|
$resConn=$idPdo->query($reqSelect) ;
|
|
$i=0;
|
|
if ($resConn) {
|
|
while ($result=$resConn->fetch(PDO::FETCH_BOTH)) {
|
|
if ('#' .$nomCss == $result['nom']) {
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug(2,['cssNomTab[' .$i. '] trouvé' => $result['nom']],''); }
|
|
$theVoletCss=$result['theme'];
|
|
$trouve=true;
|
|
}
|
|
$i++;
|
|
} //while
|
|
}
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// 3° tentative
|
|
// -----------------------------------------------------
|
|
if ($trouve === false) {
|
|
if($nomCss == "icones") {
|
|
$theVoletCss='Transverses site';
|
|
$trouve=true;
|
|
}
|
|
}
|
|
// Debug
|
|
if (isset($debug[2]) && $debug[2] == '1') {
|
|
$debugMsg .= monDebug(2,['trouve' => $trouve,
|
|
'nomCss' => $nomCss,
|
|
'theVoletCss' => $theVoletCss
|
|
],'');
|
|
}
|
|
?>
|