58 lines
2.2 KiB
PHP
Executable File
58 lines
2.2 KiB
PHP
Executable File
<?php
|
|
if (empty($idPrdRech)) {
|
|
if (!empty($idPrd)) {$idPrdRech=$idPrd;}
|
|
else
|
|
if (!empty($tabIdPrd[0])) {$idPrdRech=$tabIdPrd[0];}
|
|
}
|
|
|
|
// ------------------------------------------------------
|
|
// gestion des deplacement depuis la page article
|
|
// on avance de + ou - 1 selon recordset
|
|
// ------------------------------------------------------
|
|
|
|
if (!empty($codeOpeDeplacement && $codeOpeDeplacement!="")) {
|
|
$trouve=false;
|
|
$NB=count($tabIdPrd);
|
|
for($n=0; $n < $NB; $n++) {
|
|
if ($idPrdRech==$tabIdPrd[$n] && $trouve == false) {
|
|
if ($codeOpeDeplacement=="plus" ) {
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['code deplacemnt : plus' => ''], '');}
|
|
if ($n < $NB-1 ) {
|
|
$idPrdRech=$tabIdPrd[$n+1];
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['n (' => $n, ') < NB (' => $NB, ')' => ''], '');}
|
|
}
|
|
else {
|
|
$idPrdRech=$tabIdPrd[0];
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['n = 0' => $n, ' nouvel id' => $tabIdPrd[0]], '');}
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['nouvel idPrdRech =' => $idPrdRech], '');}
|
|
}
|
|
|
|
if ($codeOpeDeplacement=="moins" ) {
|
|
if ($n > 0 ) {
|
|
$idPrdRech=$tabIdPrd[$n-1];
|
|
}
|
|
else {$idPrdRech=$tabIdPrd[$NB-1];}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['idPrdRech =' => $idPrdRech], '');}
|
|
}
|
|
$trouve=true;
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['tabIdPrd + =' => $tabIdPrd[$n]], '');}
|
|
}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['trouve =' => $trouve], '');}
|
|
|
|
}
|
|
|
|
// ------------------------------------------------------
|
|
// Requete
|
|
// ------------------------------------------------------
|
|
if (!empty($idPrdRech)) {
|
|
if ($lg=='')$lg='FRA';
|
|
$reqSelect="SELECT * FROM `produits` WHERE idPrd=" .$idPrdRech. "";
|
|
|
|
$debugMsg .= monDebug(2,['reqSelect' => $reqSelect],'reqSelectPrdfromPrd.php');
|
|
}
|
|
else
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Nous sommes désolés, pas d' => ''], '');}
|
|
?>
|