alpha_full/pages/clients/client.reqInit.php
2026-04-06 22:58:51 +02:00

81 lines
3.4 KiB
PHP
Executable File

<?php
// ---------------------------------------------------
// Civilité
// ---------------------------------------------------
// $refresh="Oui";
// ---------------------------------------------------
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .='refresh dans client.reqInit.php : ' .$refresh. ' ';}
$tabResult=array();
if (empty($_SESSION['tableCivId']) || empty($_SESSION['tableCivLib']) || $refresh=="Oui") {
$reqSelect="SELECT * FROM libellecivilite WHERE idLg='" .$lg. "' order by id;";
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (2, ['reqSelect civilité'=> $reqSelect ],'client.reqInit.php'); }
$resConn='';
$resConn=$idPdo->query($reqSelect);
$i=0;
while ($tabResult=$resConn->fetch(PDO::FETCH_ASSOC)) {
$tableCivId[$i]=$tabResult['id'];
$tableCivLib[$i]=$tabResult['lib'];
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug (2, ['tableCivId[' .$i. ']' => $tableCivId[$i], 'tableCivLib[' .$i. ']' => $tableCivLib[$i] ], 'client.reqInit.php'); }
$i++;
}
$_SESSION['tableCivId']=$tableCivId;
$_SESSION['tableCivLib']=$tableCivLib;
}
else {
if (empty($tableCivId)) $tableCivId=$_SESSION['tableCivId'];
if (empty($tableCivLib)) $tableCivLib=$_SESSION['tableCivLib'];
}
// ---------------------------------------------------
// Oui / Non
// ---------------------------------------------------
if (empty($_SESSION['tableONid']) || empty($_SESSION['tableONLib']) || $refresh=="Oui") {
$reqSelect="SELECT * FROM listeouinon WHERE idLg='" .$lg. "';";
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (2, ['reqSelect' => $reqSelect[$i] ], ''); }
$tableONid=array();
$tableONLib=array();
$tabResult=array();
$resConn='';
$resConn=$idPdo->query($reqSelect);
$i=0;
while ($tabResult=$resConn->fetch(PDO::FETCH_ASSOC)) {
$tableONid[$i]=$tabResult['id'];
$tableONLib[$i]=$tabResult['libelle'];
if (isset($debug[2]) && $debug[2] == '1' ) { $usrSiteMsg .= monDebug (2, ['tableONid[' .$i. ']' => $tableONid[$i], 'tableONLib[' .$i. ']' => $tableONLib[$i] ], ''); }
$i++;
}
$_SESSION['tableONid']=$tableONid;
$_SESSION['tableONLib']=$tableONLib;
}
else {
if (empty($tableONid)) $tableONid=$_SESSION['tableONid'];
if (empty($tableONLib)) $tableONLib=$_SESSION['tableONLib'];
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (2, ['tableONLib remplie' => '' ], ''); }
}
// ---------------------------------------------------
// si on vient de admin, on ne veut pas faire ces requetes
// ---------------------------------------------------
if (isset($nePasfaire) && $nePasfaire==1) {
// ne pas faire
}
else {
// ---------------------------------------------------
// Pays
// ---------------------------------------------------
include ($includePath. "/req/30-initPaysList.php");
// ---------------------------------------------------
// Mode de livraison
// ---------------------------------------------------
// $filtreActiv=1;
// ---------------------------------------------------
include ($includePath. "/req/31-modeLiv.reqSelectList.php");
// ---------------------------------------------------
// Mode de paiement
// ---------------------------------------------------
include ($includePath. "/req/32-modePaie.reqSelectList.php");
}
?>