/** * 递归所有分类 * Enter description here ... * @param unknown_type $db * @param unknown_type $typeList * @param unknown_type $parent_id * @param unknown_type $level */ function get_product_type(&$typeList, $parent_id, $level) { $result = $GLOBALS['db']->query("SELECT id,name FROM sx1_product_type WHERE parent_id=" . $parent_id . " ORDER BY sort,id ASC"); while ($row = $GLOBALS['db']->fetch($result)) { $typeList[] = array('id' => $row['id'], 'name' => $row['name'], 'level' => str_repeat(' ', $level)); get_product_type($typeList, $row['id'], $level + 1); } }
# ---------------------------------------------------------------------- # CALL FUNCTION # ---------------------------------------------------------------------- */ $product = get_product($product_alias, $type_alias); $default_image = get_default_image($product['type_id']); /* -- PRODUCT THUMBNAILS ON MD LG --- */ $images = get_product_images($product['type_id']); /* --- PRODUCT THUMBNAILS ON XS SM --- */ $images_xs = get_product_images($product['type_id']); $types = get_product_type($product['id']); $stock = get_product_stock($product['type_id']); $sold_out = get_product_sold_out($product['type_id']); /* --- DISCOUNT --- */ $price = discount_price($product['promo_id'], $product['promo_value'], $product['type_price'], $product['promo_start_datetime'], $product['promo_end_datetime']); /* # ---------------------------------------------------------------------- # DEFINED VALUE # ---------------------------------------------------------------------- */
" class="bg-red font-white"><img src="/Public/Home/images/cate_1.png" height="66" width="101"><?php echo get_product_type(3); ?> 专区</a> <a href="<?php echo U('Index/lists', array('type' => 1)); ?> " class="bg-yellow font-white"><img src="/Public/Home/images/cate_2.png" height="66" width="101"><?php echo get_product_type(1); ?> 专区</a> <a href="<?php echo U('Index/lists', array('type' => 2)); ?> " class="bg-green font-white"><img src="/Public/Home/images/cate_3.png" height="66" width="101"><?php echo get_product_type(2); ?> 专区</a> <?php $_result = C('PRODUCT_CATE'); if (is_array($_result)) { $i = 0; $__LIST__ = $_result; if (count($__LIST__) == 0) { echo ""; } else { foreach ($__LIST__ as $key => $val) { $mod = $i % 2; ++$i; ?> <a href="<?php
<!--start summary_detail--> <div class="summary_detail"> <div id="shoppingbag"> <h5>my wishlist</h5> <ul id="wishlist"> <?php $rswishlist = get_wishlist($idmember, $rowspage, $p); if ($rswishlist["result"]) { foreach ($rswishlist["result"] as $row) { $idwishlist = $row->id; $product_name = $row->product_name; $product_price = $row->product_price; $product_id = $row->id_product; $product_img = order_history_thumbimg($row->id_product); $product_type = get_product_type($product_id); $varlink = "/products/detail/?type=" . $product_type . "&id_product=" . $product_id . ""; echo "\n\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t<a href=\"" . $varlink . "\" class=\"linkwishlist\">\n\t\t\t\t\t\t\t\t\t\t\t<img src=\"" . $product_img . "\" width=\"186\" height=\"258\"/>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"wishlist_item\">" . $product_name . "</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"wishlist_price\">IDR " . number_format($product_price, 0, "", ".") . "</span> \n\t\t\t\t\t\t\t\t\t\t</a> \n\t\t\t\t\t\t\t\t\t\t<a href=\"#mfp_message\" class=\"wishlist_cancel\" data-deletewl=\"?job=delete&wlid=" . $idwishlist . "&p=" . $p . "\"><span>cancel</span></a>\n\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t"; } } else { echo "\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t<center>You don't have any wishlist at the moment</center>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t</p>"; } $maxpage = 1; if (isset($rswishlist["maxpage"])) { $maxpage = $rswishlist["maxpage"]; } ?> </ul>
$row = array(); while ($result = mysql_fetch_array($query)) { array_push($row, $result); } return $row; } /* # ---------------------------------------------------------------------- # DEFINED VARIABLE # ---------------------------------------------------------------------- */ $id = $_POST['product_id']; /* # ---------------------------------------------------------------------- # CALL FUNCTIONS # ---------------------------------------------------------------------- */ $count_product = count_product($id); $data_type = get_product_type($id); /* # ---------------------------------------------------------------------- # CONTROL # ---------------------------------------------------------------------- */ if ($count_product['rows'] > 0) { foreach ($data_type as $data_type) { echo '<option value="' . $data_type['type_id'] . '">' . $data_type['type_name'] . '</option>'; } } else { echo 'Error'; }