\n"); ?> 0){printf(" Are there some items for this node ?
\n");} $requete = "SELECT item_id, position FROM hierarchy_item WHERE hierarchy_id='$hierarchy_id' order by position asc;"; if ($debug>0){printf(" Request : %s
\n",$requete);} $result = mysql_query($requete) or die("Erreur SQL !".$sql.mysql_error()); if ($row=MySQL_Fetch_Array($result)) { if ($debug>0){printf(" => YES, there are...
\n");} $item_counter=0; do { $item_ID[$item_counter] = $row["item_id"]; if ($debug>0){printf(" ... item found counter= [%s] and item_id= [%s]
\n", $item_counter, $row["item_id"]);} $item_counter++; } while ($row = mysql_fetch_array($result)); // each item has a detailed record in [item] table for ($i = 0; $i < $item_counter; $i++) { $requete = "SELECT type_id, content_id, name FROM item WHERE id='$item_ID[$i]';"; $result = mysql_query($requete) or die("Erreur SQL !".$sql.mysql_error()); if ($row=MySQL_Fetch_Array($result)) { if ($debug>0){printf(" ... item found name= [%s] item_id= [%s] content_id= [%s]
\n", $row["name"], $item_ID[$i], $row["content_id"]);} if ($row["type_id"] == 1) { process_text($row["content_id"]); } if ($row["type_id"] == 2) { process_image($row["name"]); } if ($row["type_id"] == 3) { // process_URL($row["name"]); } if ($row["type_id"] == 4) { // process_item($row["content_id"]); } if ($row["type_id"] == 5) { process_delimiter($row["content_id"]); } if ($row["type_id"] == 6) { // process_existing($row["content_id"]); } } // end if query returns something } //end for every item in this subject } // end if query (is there items?) returns something // si nécessaire, affichons la gallerie de photos de ce noeud show_pictures($debug, $hierarchy_id, $image_path); if ($debug>0){printf(" Are there some products for this node ?
\n");} //récupérons les produits pour ce noeud $requete = "SELECT ID,description, image_URL, era, sncb_code FROM product WHERE (active='Y' and hierarchy_id='$hierarchy_id') order by ID asc;"; $result = mysql_query($requete) or die("Erreur SQL !".$sql.mysql_error()); if ($row=MySQL_Fetch_Array($result)) { if ($debug>0){printf(" => YES, there are...
\n");} do { if ($debug>0){printf(" ... product found. id= [%s] and sncb_code= [%s]
\n", $row["ID"], stripslashes($row["sncb_code"]));} printf(" \n"); printf(" \n",$row["ID"]); printf(" \n"); // SNCB number printf(" \n"); printf(" \n"); printf(" \n"); // image of the model if ($row["image_URL"]!="") { printf(" \n"); } printf(" \n"); // era printf(" \n"); printf(" \n"); printf(" \n",$row["era"]); printf(" \n"); // description printf(" \n"); printf(" \n", stripslashes($row["description"])); printf(" \n"); if ($debug>0){printf(" Are there some product_alternatives for this product ?
\n");} //récupérons les versions de ce produit $requete3 = "SELECT available, min_new_price, max_new_price, manufacturer_code, min_second_hand_price, max_second_hand_price, manufacturer_id, alim, introduction, withdrawal, description FROM product_alternative WHERE (active='Y' and product_id=".$row["ID"].") order by ID asc;"; $result3 = mysql_query($requete3) or die("Erreur SQL !".$sql.mysql_error()); if ($row3=MySQL_Fetch_Array($result3)) { if ($debug>0){printf(" => YES, there are...
\n");} do { printf(" \n"); printf(" \n"); printf(" \n"); // manufacturer printf(" \n"); printf(" \n"); printf(" \n"); // alimentation type printf(" \n"); printf(" \n", $row3["alim"]); printf(" \n"); // manufacturer reference (catalog number) printf(" \n"); printf(" \n"); printf(" \n", $row3["manufacturer_code"]); // product still available in shops printf(" \n"); printf(" \n"); printf(" \n"); // retail & second hand prices (min-max) printf(" \n"); printf(" \n"); printf(" \n", $row3["min_new_price"], $row3["max_new_price"]); printf(" \n"); printf(" \n", $row3["min_second_hand_price"], $row3["max_second_hand_price"]); printf(" \n"); // description if ($row3["description"]!="") { printf(" \n"); printf(" \n", stripslashes($row3["description"])); printf(" \n"); } } while ($row3 = mysql_fetch_array($result3)); } // end if query (versions of product) returns something } while ($row = mysql_fetch_array($result)); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf("
numéro SNCB
%s ",stripslashes($row["sncb_code"])); if ($userStatus == "admin") { printf("   "); } printf("
\n",$image_path, $row["image_URL"], $image_path, $row["image_URL"]); } else { printf("
Pas de photo disponible
époque
%s
%s
marque
"); if ($debug>0){printf(" looking for a manufecturer with id=[%s]
\n", $row3["manufacturer_id"]);} // recherche du nom / website du fabricant (on a que son ID) $requete2 = "SELECT name, website FROM manufacturer WHERE ID= '".$row3["manufacturer_id"]."';"; $result2 = mysql_query($requete2) or die("Erreur SQL !".$sql.mysql_error()); if ($row2=MySQL_Fetch_Array($result2)) { if ($debug>0){printf(" ... manufacturer found. id= [%s] and name= [%s]
\n", $row3["manufacturer_id"], stripslashes($row2["name"]));} if ($row2["website"]!="") { printf("%s", $row2["website"], stripslashes($row2["name"])); } else { printf("%s", stripslashes($row2["name"])); } } else { printf("-"); } printf("
alimentation
%s
référence
%s
disponibilité en magasin
"); if ($row3["available"]=="Y") { printf("oui"); } if ($row3["available"]=="N") { printf("non"); } if ($row3["available"]=="?") { printf(" ? "); } if ($row3["available"]=="-") { printf("Projet"); } if ($row3["available"]=="+") { printf("* NEW *"); } if ($row3["available"]=="L") { printf("Faible"); } printf("
prix neuf * (min - max)
%s - %s
cote occasion*
%s - %s
%s
* Les fourchettes de prix sont fournies a titre purement indicatifs
\n"); printf("




\n"); printf(" \n"); } // end if query (products of node) returns something else //no products for this node { // one may add something here. This is displayed if no products are found... } printf(" \n"); printf(" \n"); printf("\n"); include("footer.php"); ?>