| [ PHPXref.com ] | [ Generated: Sun Jul 20 19:28:27 2008 ] | [ PgMarket 2.2.3 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 // (C) 2000-2002 Marco Pratesi <marco@pgmarket.net> 3 4 if ($CFG["color_used"]) { 5 $qid_col = new PGM_Sql(); 6 } 7 8 $t = new Template(); 9 $t->set_file("page", "templates/search_results.ihtml"); 10 include ($CFG["localelangdir"] . "global-common.inc.php"); 11 include ($CFG["localelangdir"] . "global-shopping.inc.php"); 12 include ($CFG["localelangdir"] . "global-admin.inc.php"); 13 $t->set_var(array( 14 "wwwroot" => $CFG["wwwroot"], 15 "productswww" => $CFG["productswww"], 16 "ME" => $ME 17 )); 18 19 $summary_report = $t->get_var("Search_Results") . ": " . $result["num_items"]; 20 $t->set_var("summary_report", $summary_report); 21 $t->set_block("page", "products", "products_blck"); 22 $t->set_var("products_blck", ""); 23 if ($qid->num_rows() > 0) { 24 // Let us define blocks nested inside a product_row... 25 // We indent the code to highlight the blocks' hierarchical nesting... 26 $t->set_block("products", "product_row", "product_rows"); 27 $t->set_block("products", "pages_links_top", "pages_links_top_blck"); 28 $t->set_var("pages_links_top_blck", ""); 29 $t->set_block("products", "pages_links_bottom", "pages_links_bottom_blck"); 30 $t->set_var("pages_links_bottom_blck", ""); 31 if ($result["num_pages"] > 1) { 32 $summary_report .= " " . $t->get_var("on") . " " . $result["num_pages"] . " " . $t->get_var("pages"); 33 $t->set_var("pages_links", $result["html"]); 34 $t->parse("pages_links_top_blck", "pages_links_top", true); 35 $t->parse("pages_links_bottom_blck", "pages_links_bottom", true); 36 } 37 $t->set_block("product_row", "brand_used", "brand_used_blck"); 38 $t->set_block("product_row", "adminprod", "adminprod_blck"); 39 $t->set_block("adminprod", "special_flag", "special_flag_blck"); 40 $t->set_block("product_row", "prodthumb", "prodthumb_blck"); 41 $t->set_block("product_row", "nothumb", "nothumb_blck"); 42 $t->set_block("product_row", "user_discount_used", "user_discount_used_blck"); 43 $t->set_block("product_row", "iva_used", "iva_used_blck"); 44 $t->set_block("product_row", "discount_block", "discount_block_blck"); 45 $t->set_block("discount_block", "discqty_block", "discqty_block_blck"); 46 $t->set_block("product_row", "weight_used", "weight_used_blck"); 47 $t->set_block("product_row", "color_used", "color_used_blck"); 48 // ... end of the blocks :) 49 $t->set_var("product_rows", ""); // Now let us reset the product rows container... 50 while ($qid->next_record()) { 51 // Now let us reset the blocks contents... 52 // We indent the code to highlight the blocks' hierarchical nesting... 53 $t->set_var("brand_used_blck", ""); 54 $t->set_var("adminprod_blck", ""); 55 $t->set_var("special_flag_blck", ""); 56 $t->set_var("prodthumb_blck", ""); 57 $t->set_var("nothumb_blck", ""); 58 $t->set_var("user_discount_used_blck", ""); 59 $t->set_var("iva_used_blck", ""); 60 $t->set_var("discount_block_blck", ""); 61 $t->set_var("discqty_block_blck", ""); 62 $t->set_var("weight_used_blck", ""); 63 $t->set_var("color_used_blck", ""); 64 // ... now we have reset all nested blocks :) 65 $t->set_var(array( 66 "product_id" => $qid->f("id"), 67 "product_code" => $qid->f("code"), 68 "pname" => ($qid->f("lname") != "") ? ov($qid->f("lname")) : ov($qid->f("name")), 69 "fprice" => formatted_price($qid->f("price")), 70 "description" => ($qid->f("ldescription") != "") ? ovwbr($qid->f("ldescription")) : ovwbr($qid->f("description")), 71 "productitemcount" => $PGM_SESSION["CART"]->get_product_qty($qid->f("id")) 72 )); 73 if ($CFG["brand_used"] && $qid->f("bname") != "") { 74 $t->set_var("bname", ov($qid->f("bname"))); 75 $t->parse("brand_used_blck", "brand_used", true); 76 } 77 if (has_priv("admin")) { 78 $t->set_var("p_special_level", $qid->f("special_level")); 79 if ($qid->f("special_flag")) { 80 $t->parse("special_flag_blck", "special_flag", true); 81 } 82 $t->parse("adminprod_blck", "adminprod", true); 83 } 84 if ($CFG["images_on_file_system"] && file_exists($CFG["productsdir"] . $qid->f("id") . ".thumb." . $qid->f("thumbtype"))) { 85 $t->set_var(array( 86 "thumbwidth" => $qid->f("thumbwidth"), 87 "thumbheight" => $qid->f("thumbheight") 88 )); 89 if (has_priv("admin")) { 90 $t->set_var("thumbsrc", $CFG["wwwroot"] . "admin/getimage.php?image=" . $qid->f("id") . ".thumb." . $qid->f("thumbtype") . "&type=" . $qid->f("thumbtype")); 91 } else { 92 $t->set_var("thumbsrc", $CFG["productswww"] . $qid->f("id") . ".thumb." . $qid->f("thumbtype")); 93 } 94 $t->parse("prodthumb_blck", "prodthumb", true); 95 } else if (!$CFG["images_on_file_system"] && $qid->f("thumbtype") != "") { 96 $t->set_var(array( 97 "thumbwidth" => $qid->f("thumbwidth"), 98 "thumbheight" => $qid->f("thumbheight") 99 )); 100 if (has_priv("admin")) { 101 $t->set_var("thumbsrc", $CFG["wwwroot"] . "admin/dbgetthumb.php?id=" . $qid->f("id")); 102 } else { 103 $t->set_var("thumbsrc", $CFG["wwwroot"] . "dbgetthumb.php?id=" . $qid->f("id")); 104 } 105 $t->parse("prodthumb_blck", "prodthumb", true); 106 } else { 107 $t->parse("nothumb_blck", "nothumb", true); 108 } 109 if ($CFG["user_discount_used"] && is_logged_in() && $PGM_SESSION["user"]["user_discount"] > 0) { 110 $t->set_var(array( 111 "user_discount" => $PGM_SESSION["user"]["user_discount"], 112 "discounted_price" => formatted_price((1.0-$PGM_SESSION["user"]["user_discount"]/100.0)*$qid->f("price")) 113 )); 114 $t->parse("user_discount_used_blck", "user_discount_used", true); 115 } 116 if ($CFG["iva_used"]) { 117 $t->set_var("iva", $qid->f("iva")); 118 $t->parse("iva_used_blck", "iva_used", true); 119 } 120 if ($qid->f("discount") > 0) { 121 $t->set_var("discount", $qid->f("discount")); 122 if ($qid->f("discqty") > 1) { 123 $t->set_var("discqty", $qid->f("discqty")); 124 $t->parse("discqty_block_blck", "discqty_block", true); 125 } 126 $t->parse("discount_block_blck", "discount_block", true); 127 } 128 if ($CFG["weight_used"]) { 129 $t->set_var("fweight", formatted_weight($qid->f("weight"))); 130 $t->parse("weight_used_blck", "weight_used", true); 131 } 132 if ($CFG["color_used"]) { 133 $foobar = get_product_color_options($qid->f("id"), $color_options, 1); 134 if ($foobar > 0) { 135 $t->set_var("color_options", $color_options); 136 $t->parse("color_used_blck", "color_used", true); 137 } 138 } 139 $t->parse("product_rows", "product_row", true); 140 } 141 $t->parse("products_blck", "products", true); 142 } 143 144 $t->pparse("out", "page"); 145 146 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |