0) {//il existe des images //Construction d'un tableau for ($cpt = 0; $cpt < $NbreImages; $cpt++) { $T=mysql_fetch_object($Requete); //recherche d'une éventuelle promotion $TauxPromo=0; if (PROMOTIONS==1) { //lecture d'une éventuelle promotion $SQL="SELECT TauxPromo, TypePromotion, DateFinPromotion "; $SQL.=" FROM Lien_Prod_Promo,Promotions"; $SQL.=" WHERE NumProduit=$T->NumProd"; $SQL.=" AND NumPromotion=NumPromo"; $SQL.=" AND DateFinPromotion>=Now('') AND DateDepPromotion<=NOW('')"; $Requete3=mysql_query($SQL,CONNECTION); if ($Requete3) { $V=mysql_fetch_object($Requete3); $tTauxPromo[$cpt]=$V->TauxPromo; $tTypePromo[$cpt]=$V->TypePromotion; $tDateFin[$cpt]=$V->DateFinPromotion; $DateFin=$V->DateFinPromotion; $DateFinTemp=strtr($DateFin," ","-"); $DateFinTemp=strtr($DateFinTemp,":","-"); $DateFinTemp=substr($DateFinTemp,2,strlen($DateFinTemp)); unset($V); unset($DateFin); mysql_free_result($Requete3); } } else {//le site n'ouvre pas droitaux promotions diverses, RAF } // génère 2 tableaux synchronisés $tImages[$cpt] = $T->FichierImage; $tNumImages[$cpt]=$T->NumImage; $tNomImage[$cpt]=$T->LibelleProd; $tPrixProd[$cpt]=$T->PrixProd; $tNumProd[$cpt]=$T->NumProd; $tCatProd[$cpt]=$T->CategorieProd; } //----------------------------------------------------- // définition du tableau HTML (plaquette de photos) $NbrePhotosParLigne=NbreImagesLigne; echo "\n"; $ligne=0; while (($ligne*$NbrePhotosParLigne)<(sizeof($tImages))) { //ligne du nom de la poupée echo "\n"; for ($pos = 0; $pos < $NbrePhotosParLigne; $pos++) { $ind=$ligne*$NbrePhotosParLigne+$pos; if (isset($tImages[$ind]) && $tImages[$ind]!="") { echo "\n"; } else { echo "\n"; } }//fin for print "\n"; //ligne des prix du produit echo "\n"; for ($pos = 0; $pos < $NbrePhotosParLigne; $pos++) { $ind=$ligne*$NbrePhotosParLigne+$pos; if (isset($tImages[$ind]) && $tImages[$ind]!="") { echo "\n"; } }//fin for print "\n"; // ligne de l' image principale du produit print "\n"; echo "\n"; for ($pos = 0; $pos < $NbrePhotosParLigne; $pos++) { $ind=$ligne*$NbrePhotosParLigne+$pos; if (isset($tImages[$ind]) && $tImages[$ind]!="") { $NomImg=substr($tImages[$ind],0,strlen($tImages[$ind])-4); echo "\n"; } else {//affichage vide si pas de photo sur la fin de ligne echo "\n"; } } print "\n"; //ligne des liens sous les poupées echo "\n"; for ($pos = 0; $pos < $NbrePhotosParLigne; $pos++) { $ind=$ligne*$NbrePhotosParLigne+$pos; if (isset($tImages[$ind]) && $tImages[$ind]!="") { echo "\n"; } else { echo "\n"; } } print "\n"; ?> \n"; //----------------------------------------------------- //Fin construction du tableau } //fin il existe des images else {//aucune image pour ce produit ?>
\n"; echo "

",ucfirst($tNomImage[$ind]),""; echo "

  
\n"; ?>

\n"; } else { echo "

  
\n"; echo ""; if (PROMOTIONS==1) {//on a demandé la gestion des promotions diverses echo "",$Libel_ClicAgrandir," ",ucfirst($tNomImage[$ind]),"
\n"; } else {//on n'a pas droit à la gestion des promotions echo "",$Libel_ClicAgrandir," ",ucfirst($tNomImage[$ind]),"
\n"; } // recherche s'il existe des options payantes pour ce produit $SQL="SELECT Count(0) AS NumLigneOptions, SUM(PrixValeur) As SupPrix FROM ValeurOptions WHERE NumProdOption=".$tNumProd[$ind]; $Requete2=mysql_query($SQL,CONNECTION); if ($Requete2) {//on cherche le nombre de lignes //si aucune ligne, pas d'option! $NbreLignesOptions=mysql_num_rows($Requete2); if ($NbreLignesOptions>0) {$U=mysql_fetch_object($Requete2); $NbreLignesOptions=$U->NumLigneOptions; $TotalOptions=$U->SupPrix; } else {$TotalOptions=0;} mysql_free_result($Requete2); } if ($NbreLignesOptions==0) {//on va directement au panier! ?> " Class="">" border=0 alt=""> "; ?> <? echo $Libel_Clic_Commander,ucfirst($tNomImage[$ind]); ?>
"; }//fin branchement page_prod echo "
  
\n"; echo "",$Libel_Plusdinfo,"
"; echo "
  
background="lignehorizontalebleue.png" height=6>