alpha_full/_include/req/31-modeLiv.reqSelectList.php
2026-04-06 22:58:51 +02:00

76 lines
3.8 KiB
PHP
Executable File

<?php
// ---------------------------------------------------
// liste des modes de livraison
// ---------------------------------------------------
if (!isset($refresh)) $refresh='N';
if (isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1, ['refresh' => $refresh], '31-modeLiv.reqSelect.php'); }
if (empty($lg)) $lg=$_SESSION['lg'];
if (empty($_SESSION['tabIdMl']) || empty($_SESSION['tabLibelleMl']) || empty($_SESSION['tabTypeML']) || empty($_SESSION['tabTypeML']) || $refresh=="Oui") {
$tabIdMl=array();
$tabTypeML=array();
$tabIdTvaML=array();
$tabAfficherMl=array();
$tabIcoML=array();
$tabLibelleMl=array();
if (isset($filtreActiv) && $filtreActiv==0) {$reqSelect="SELECT * FROM `modeliv` order by idModeLiv;";}
else {$reqSelect="SELECT * FROM `modeliv` WHERE activ=1 order by idModeLiv; ";}
if (isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1, ['reqSelect' => $reqSelect], '');}
$resConn='';
$resConn=$idPdo->query($reqSelect);
if ($resConn) {
if ($resConn->rowCount()>0) {
$i=0;
While ($result=$resConn->fetch(PDO::FETCH_ASSOC)) {
$tabIdMl[$i]=$result['idModeLiv'];
$tabDescMl[$i]=$result['description'];
$tabTypeML[$i]=$result['type'];
$tabIdTvaML[$i]=$result['idTva'];
$tabAfficherMl[$i]=$result['activ'];
$tabIcoML[$i]=$result['icoLiv'];
$tabSiteML[$i]=$result['siteLien'];
if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1,['tabIdMl' .$i => $tabIdMl[$i] ],'31-modeLiv.reqSelect.php');}
// ---------------------------------------------------
// Libelle mode de livraison
// ---------------------------------------------------
$reqSelect2="SELECT libelle FROM `modelivlibelle` WHERE idLg='" .$lg. "' AND idModeLiv=" .$tabIdMl[$i]. " order by idModeLiv;";
if (isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1, ['reqSelect2' => $reqSelect2], '');}
$resConn2='';
$resConn2=$idPdo->query($reqSelect2);
if ($resConn2) {
if ($resConn->rowCount()>0) {
// $i=0;
$result2=$resConn2->fetch(PDO::FETCH_ASSOC);
$tabLibelleMl[$i]=$result2['libelle'];
if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1,['tabLibelleMl' .$i => $tabLibelleMl[$i] ],'');}
}
else {if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) $debugMsg .= monDebug (1,['reqSelect' => $reqSelect],''); $admMsgClass='ko';}
}
else {if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) $debugMsg .= monDebug (1,['reqSelect' => $reqSelect],''); $admMsgClass='ko';}
$i++;
}
$_SESSION['tabIdMl']=$tabIdMl;
$_SESSION['tabIcoML']=$tabIcoML;
$_SESSION['tabLibelleMl']=$tabLibelleMl;
$_SESSION['tabIdTvaML']=$tabIdTvaML;
$_SESSION['tabAfficherMl']=$tabAfficherMl;
$_SESSION['tabDescMl']=$tabDescMl;
$_SESSION['tabSiteML']=$tabSiteML;
if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1,['session re-chargée' => 'Oui'],'');}
}
}
}
else {
if (empty($tabIdMl)) $tabIdMl=$_SESSION['tabIdMl'];
if (empty($tabIcoML)) $tabIcoML=$_SESSION['tabIcoML'];
if (empty($tabLibelleMl)) $tabLibelleMl=$_SESSION['tabLibelleMl'];
if (empty($tabIdTvaML)) $tabIdTvaML=$_SESSION['tabIdTvaML'];
if (empty($tabAfficherMl)) $tabAfficherMl=$_SESSION['tabAfficherMl'];
if (empty($tabDescMl)) $tabDescMl=$_SESSION['tabDescMl'];
if (empty($tabSiteML)) $tabSiteML=$_SESSION['tabSiteML'];
if (isset($debug[10]) && $debug[10] == '1' || isset($debug[9]) && $debug[9] == '1' ) { $debugMsg .= monDebug (1,['>Mode Liv remplit' => ''],'');}
}
?>