assign( 'base_tpl', "".$dir_tpl."" ); $temp_pro->assign( 'pro_id', "".$data['pro_id']."" ); $temp_pro->assign( 'pro_name', "".$data['pro_name']."" ); $temp_pro->assign( 'catid', "".$catid."" ); $temp_pro->assign( 'catparentid', "".$catparentid."" ); $temp_pro->assign( 'pro_images', "thumb.php?image=".$data['pro_images']."&width=125" ); $temp_pro->assign( 'pro_url', "view-".keySort($data["pro_name"])."/".$data["pro_id"].".html" ); $temp_pro->assign( 'pro_url_order', "view-".keySort($data["pro_name"])."/".$data["pro_id"].".html" ); if ($data["pro_promotion_vnd"]!=0) { $price = $data["pro_promotion_vnd"]; $price = number_format($price, 0, '.', '.'); $html_price = "

".$price." VNĐ

"; } else { $price = $data["pro_price"]*$shop_usd; $price = number_format($price, 0, '.', '.'); $html_price = "

".$price." VNĐ

"; if ($data["pro_promotion_usd"]!=0) { $price_promotion = $data["pro_promotion_usd"]*$shop_usd; $price_promotion = number_format($price_promotion, 0, '.', '.'); $html_price = "".$price." VNĐ

".$price_promotion." VNĐ

";; } } $temp_pro->assign( 'pro_price', "".$html_price."" ); $temp_pro->assign( 'pro_warranty', "".$data['pro_warranty']."" ); $temp_pro->assign( 'pro_content_desc', "".$data['pro_content_desc']."" ); $pro_promotion_content = getPackage($data["pro_package_id"]); $temp_pro->assign( 'pro_promotion_content', "".htmlchars($pro_promotion_content)."- ".htmlchars($data["pro_promotion_content"])."" ); $temp_pro->assign( 'pro_promotion_content', "".$data['pro_promotion_content']."" ); $temp_pro->assign( 'pro_store', "".$data['pro_store']."" ); $temp_pro->assign( 'pro_views', "".$data['pro_counter']."" ); $temp_pro->assign( 'list_subcat', "".$html_subcat."" ); if ($data['pro_focus'] == 1) $temp_pro->assign( 'new_images', "" ); if ($_SESSION["mod_login"]!='' OR $_SESSION["admin_login"]!='') { $q = $mysql->query("SELECT cat_title FROM ".$tb_fix."_category WHERE cat_id='".$data['pro_catpid']."' ORDER BY cat_order ASC LIMIT 1"); $r = $mysql->fetch_array($q); $cat_title = $r["cat_title"]; $print_str = base64_encode("".$cat_title."**".$data['pro_name']."**".htmlchars($data['pro_content_desc'])."**".$data['pro_warranty']."**".unbr($pro_promotion_content)."||".unbr($data["pro_promotion_content"]).""); $temp_pro->assign( 'print_str', "".$print_str."" ); } if ($_SESSION["admin_login"]!='') { $temp_pro->assign( 'admin_edit', "admin_edit" ); } else if ($_SESSION["mod_login"]!='') { $temp_pro->assign( 'mod_edit', "mod_edit" ); } //echo $print_str; $html_product = $temp_pro->gethtml( '_info_product.html' ); return $html_product; } function getPackage($package_id) { global $mysql, $tb_fix; $q = $mysql->query("SELECT * FROM ".$tb_fix."_packages WHERE package_id='$package_id' ORDER BY package_id ASC LIMIT 1"); $r = $mysql->fetch_array($q); return $r["package_description"]; } function menucat($cat="0") { global $mysql, $tb_fix, $cat, $dir_tpl; $q = $mysql->query("SELECT * FROM ".$tb_fix."_category WHERE cat_parent='$cat' ORDER BY cat_order ASC"); $t = $mysql->num_rows($q); $_list = ""; $_list2 = ""; if ($t>0) { while ($r = $mysql->fetch_array($q)) { $url_cat = "".keySort($r["cat_title"])."-".$r["cat_id"].".html"; //keySeo( $q_s = $mysql->query("SELECT * FROM ".$tb_fix."_category WHERE cat_parent='".$r["cat_id"]."' ORDER BY cat_order ASC"); $t_s = $mysql->num_rows($q_s); if ($t_s>0) { $_list .= "".$r["cat_title"]."\n"; $c=0; $_list .= "
\n
\n"; } else { $_list .= "".$r["cat_title"]."\n"; } } } $_list = $_list.$_list2; return $_list; } function topProduct($cat="0") { global $mysql, $tb_fix, $shop_usd; if ($cat == 0) $q = $mysql->query("SELECT * FROM ".$tb_fix."_product AS p,".$tb_fix."_category AS c WHERE (p.pro_catid=c.cat_id) ORDER BY pro_counter DESC LIMIT 5"); else $q = $mysql->query("SELECT * FROM ".$tb_fix."_product AS p,".$tb_fix."_category AS c WHERE (p.pro_catid=c.cat_id) AND (p.pro_catid='$cat' OR p.pro_catpid='$cat' OR p.pro_catrid='$cat') ORDER BY pro_counter DESC LIMIT 5"); $hot_product = ""; while ($r = $mysql->fetch_array($q)) { if ($r["pro_images"] != "") { $images = ""; } else $images = ""; if ($r["pro_promotion_vnd"]!=0) { $price = $r["pro_promotion_vnd"]; $price = number_format($price, 0, '.', '.'); $html_price = "
".$price." VNĐ"; } else { $price = $r["pro_price"]*$shop_usd; $price = number_format($price, 0, '.', '.'); $html_price = "
".$price." VNĐ"; if ($r["pro_promotion_usd"]!=0) { $price_promotion = $r["pro_promotion_usd"]*$shop_usd; $price_promotion = number_format($price_promotion, 0, '.', '.'); $html_price = "".$price." VNĐ
".$price_promotion." VNĐ";; } } $bg_status = ""; if ($r["pro_new"] == 1) $bg_status = "
"; if ($r["pro_sale"] == 1) $bg_status = "
"; if ($r["pro_focus"] == 1) $bg_status = "
"; $hot_product .= "
  • ".$bg_status."
    ".$html_price."
    Bao hành: ".$r["pro_warranty"]." tháng
  • "; } return $hot_product; } function _header() { global $dir_tpl, $mysql, $tb_fix, $web_title, $shop_baogia; $temp = new temp( ); $temp->assign( 'title', "".$web_title."" ); /* Category post */ $q = $mysql->query("SELECT * FROM ".$tb_fix."_catalogy_post ORDER BY cat_order ASC"); $category_post = ""; while ($r = $mysql->fetch_array($q)) { $category_post .= "".$r["cat_title"].""; } /* End category post */ $q = $mysql->query("SELECT * FROM ".$tb_fix."_news_post AS p WHERE p.np_focus='1' ORDER BY sid DESC LIMIT 5"); $t = $mysql->num_rows($q); $list_hot = ""; while ($r = $mysql->fetch_array($q)) { $list_hot .= "
  • ".$r["title"]."".$r["title"]."   Chi tiết »
  • "; } $temp->assign( 'list_hot', "".$list_hot."" ); $temp->assign( 'category_post', "".$category_post."" ); $temp->assign( 'shop_baogia', "".$shop_baogia."" ); $temp->assign( 'base_tpl', "".$dir_tpl."" ); $temp->display( '_header.html' ); } function _footer() { global $dir_tpl, $mysql, $tb_fix; global $total_visit,$day_visit,$total_product,$online, $right_search, $right_yahoo, $cart_count; $temp = new temp( ); $menu_cat = menucat(); $temp->assign( 'menu_cat', "".$menu_cat."" ); $temp->assign( 'base_tpl', "".$dir_tpl."" ); $temp->assign( 'total_visit', "".$total_visit."" ); $temp->assign( 'day_visit', "".$day_visit."" ); $temp->assign( 'total_product', "".$total_product."" ); $temp->assign( 'online', "".$online."" ); $temp->assign( 'cart_count', "".$cart_count."" ); $temp->assign( 'right_yahoo', "".$right_yahoo."" ); $temp->assign( 'right_search', "".$right_search."" ); $logos_right = ""; $q = $mysql->query("SELECT * FROM ".$tb_fix."_logos WHERE logo_where='right' ORDER BY logo_order ASC"); while ($r = $mysql->fetch_array($q)) { $logos_right .= "
    "; } $temp->assign( 'logos_right', "".$logos_right."" ); $temp->display( '_footer.html' ); } function _getModules($module) { global $dir_tpl, $mysql, $tb_fix, $right_yahoo, $right_search, $act, $cart_count, $cart_session, $_SESSION; global $total_visit,$day_visit,$total_product,$online; global $shop_baogia, $shop_usd; _header(); $id = isset($_GET["id"]) ? intval(stripslashes(urldecode($_GET["id"]))) : 0; $proid = isset($_GET["proid"]) ? intval(stripslashes(urldecode($_GET["proid"]))) : 0; $order = isset($_GET["order"]) ? stripslashes(urldecode($_GET["order"])) : false; $catid = isset($_GET["catid"]) ? intval(stripslashes(urldecode($_GET["catid"]))) : 0; $categories_id = isset($_GET["categories_id"]) ? intval(stripslashes(urldecode($_GET["categories_id"]))) : 0; $category = isset($_GET["category"]) ? intval(stripslashes(urldecode($_GET["category"]))) : 0; $manufacturer = isset($_GET["manufacturer"]) ? intval(stripslashes(urldecode($_GET["manufacturer"]))) : 0; $from = isset($_GET["from"]) ? intval(stripslashes(urldecode($_GET["from"]))) : 0; $to = isset($_GET["to"]) ? intval(stripslashes(urldecode($_GET["to"]))) : 0; $keyword = isset($_GET["keyword"]) ? m_htmlchars(stripslashes(urldecode($_GET["keyword"]))) : ""; $page = isset($_GET["page"]) ? intval($_GET["page"]) : 1; switch($module){ case "product": $title = "Sản phẩm | "; include("./_modules/_product.php"); break; case "search": $title = "Tìm kiếm | "; include("./_modules/_search.php"); break; case "shopcart": $title = "Giỏ hàng | "; include("./_modules/_shopcart.php"); break; case "about": $title = "Giới thiệu | "; include("./_modules/_aboutus.php"); break; case "buid": $title = "Xây dựng máy tính | "; include("./_modules/_buid.php"); break; case "pricing": $title = "Báo giá | "; include("./_modules/_pricing.php"); break; case "news": $title = "Tin tức | "; include("./_modules/_news.php"); break; case "baohanh": $title = "Bảo Hành | "; include("./_modules/_baohanh.php"); break; case "contact": $title = "Liên hệ | "; include("./_modules/_contact.php"); break; default : include("./_modules/_home.php"); break; } echo $content; _footer(); } ?> Khuyen mai | Cty CP The Gioi So

    SN 6 Tuổi TGS