42 lines
1.7 KiB
PHP
Executable File
42 lines
1.7 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// ---------------------------------------------------
|
|
// ce code pourrait passser en generique avec une fonction qui prendrait en param : le type (livraison ou panier), le critere (idPrd ou idCde) et son libellé
|
|
// ---------------------------------------------------
|
|
|
|
// ---------------------------------------------------
|
|
// Verif match règles
|
|
// -> Prendre toutes les conditions de chaque regle
|
|
// -> il n'est pas possible que toutes les conditions soient à vide soit "-" ( fait dans interface admin )
|
|
// ---------------------------------------------------
|
|
|
|
$conditionsRemplies=1;
|
|
include ($includePath. "/_fonctions/getIdprdFromRef.php");
|
|
|
|
// pour toutes les règles
|
|
for ( $r=0; $r<count($tabNum); $r++ ) {
|
|
if ($conditionsRemplies==1) {
|
|
testCond($tabC1[$r]);
|
|
testCond($tabC2[$r]);
|
|
testCond($tabC3[$r]);
|
|
if ($conditionsRemplies == 1) {
|
|
$theAvantage = $tabAvantR[$r];
|
|
// flag edt faire une table de jointure pour les libellés avantages idealement sur la table regles
|
|
try{
|
|
$reqSelect="SELECT avantage FROM `rAvantages` WHERE codeA='" .$theAvantage. "' ;";
|
|
$resConn=$idPdo->query($reqSelect);
|
|
if ($resConn) {
|
|
$tabResult= $resConn->fetch(PDO::FETCH_ASSOC);
|
|
$theAvantageDesc = $tabResult['avantage'];
|
|
$theAvantageDesc =str_replace(":", "", $theAvantageDesc);
|
|
}
|
|
}
|
|
catch (PDOException $e) {
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .=' PDOException = ' .$e->getMessage(). ' reqSelect = ' .$reqSelect ; }
|
|
}
|
|
|
|
}
|
|
} //conditions remplies
|
|
} //for
|
|
$_SESSION['conditionsRemplies']=$conditionsRemplies;
|
|
?>
|