<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
	session_start();
	if(isset($_SESSION['dem'])){
		$_SESSION['dem']++;
	} else{
		$_SESSION['dem']=1;
	}
	$dem1 = 0;
	//echo "<pre>"; print_r($_SERVER); echo "</pre>"; exit();
	$url = isset($_SESSION['url']) ? $_SESSION['url'] : array();
	foreach ($url as $url1) {
		if($_SERVER['REQUEST_URI'] == $url1) {
			$dem1 = 1;
		}
	}
	if($dem1 != 1 ) {
			array_push($url, $_SERVER['REQUEST_URI']);
			
		}
	//echo "<pre>"; print_r($url); echo "</pre>"; exit();
	$_SESSION['url'] = $url;
	//echo "<pre>"; print_r($_SESSION['url']); echo "</pre>"; exit();
	include("lib_db.php");
	include("checklogin.php");
	$menu_sql = "select * from category where 1";
	//echo "sql=[$menu_sql]"; exit();
	$menu_data = select_list($menu_sql);
	//echo "<pre>"; print_r($menu_data); echo "</pre>"; exit();
	
	//echo "<pre>"; print_r($menu2_data); echo "</pre>"; exit();

	$content_sql = "select * from content where 1";
	//echo "sql = [$content1_sql]"; exit();
	$content_data = select_list($content_sql);
	//echo "<pre>"; print_r($content1_data); echo "</pre>"; exit();
	$view_sql = "select * from content ORDER BY t_view DESC limit 0,8";
	$view_data = select_list($view_sql);
	//echo "<pre>"; print_r($view_data); echo "</pre>"; exit();
	$new_sql = "select * from content ORDER BY t_id DESC limit 0,4";
	$new_data = select_list($new_sql);
	//echo "<pre>"; print_r($new_data); echo "</pre>"; exit();
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Asus</title>
	<META content="IE=5.0000" http-equiv="X-UA-Compatible">
	<meta http-equiv="Content-Type" content="text/shtml; charset=utf-8" />
	<link rel="icon" href="images/asus.png" type="image/png" />
	<link type="text/css" href="css/style.css" rel="stylesheet" media="screen"/>
	<link type="text/css" href="css/style-index.css" rel="stylesheet" media="screen"/>
	<script type="text/javascript" src="js/jquery.min.js.js"></script>
	<script type="text/javascript" src="js/slides.min.jquery.js"> </script>
	<script type="text/javascript" src="js/sliderengine/amazingslider.js"></script>
	<script type="text/javascript" src="js/sliderengine/initslider-1.js"></script>
	<script type="text/javascript">
		function initScrollMenu(){
			log("init->start");
			$(window).scroll(function(){
			var height = $(window).scrollTop();
			log("scrolling->height=" + height);
			if (height > 0){
			log("scrolling->set fix menu");
			$('#Header-top').addClass('fix-menu');
			}else{
			log("scrolling->remove fix menu");
			$('#Header-top').removeClass('fix-menu');
			}
			})
			log("init->end");
			}
			function log(msg){
			if(window.console){
			window.console.log(msg);
			}
			}
			$(document).ready(function() {
			initScrollMenu();
			});
		$(function(){
			// Initialize Slides
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				generatePagination: true,
				play: 5000,
				pause: 2500,
				hoverPause: true,
			});
			
		});
		$(function(){
			$('#Content-center1').slides({
			preload: true,
			generatePagination: false,
			play: 60000
			});
		});
		$(function(){
			$('#Content-center4').slides({
			preload: true,
			generatePagination: false,
			play: 60000
			});
		}); 
	</script>
	
</head>	
<!-------------------------------------body---------------------------------------->
<body>
	<div id="Header-top">
		<div class="header-top-warpper">
			<div class="Header-top1">
				<ul>
					<li>
						<a href="nhungtrangdaxem.php">Những trang đã xem
							<span class="info-number"><?php echo $_SESSION['dem'] ?></span>
						</a>
					</li>
					<li class="divider-vertical"></li>
					<li>
					<?php
					if(isset($_SESSION['account'])){ ?>
						<a href="logout.php">Đăng xuất
						</a>
					<?php } else{?>
						<a href="login.php">Đăng nhập
						</a>
						<?php }?>
					</li>
					<li class="divider-vertical"></li>
					<li>
						<a href="#">Đăng ký
						</a>
					</li>
				</ul>
			</div><!--EndHeader-top1-->
		</div>
		<div class="clear-both"></div>
	</div><!--EndHedertop-->
	<div class="clear-both"></div>
	<div id="Warpper">
		<!-------------------------------------Header------------------------------>
		<div id="Warpper-one">
			<div id="Header">
				<div class="Header-top2">
					<div id="asus-logo" class="span2">
						<a title="ASUS" href="index.php"></a>
					</div><!--EndLogo-->
					<div id="Header-top2-menu">
						<ul id="nav" class="nav">
							<li id="products_memu">
								<a class="menu1" href="list.php?id=0&page=1">Sản phẩm</a>
								<div  class="product-sub-nav">
									<ul class="row-fluid">
										<?php 
											if($menu_data) foreach ($menu_data as $key) { ?>
												<li class="span-5col">
													<?php echo $key['c_name'] ?>
													<ul>
														<?php $menu_sql = 'select DISTINCT  t_type,t_cid from content where t_cid = '.$key["c_id"];
														$menu2_data = select_list($menu_sql); ?>
														<?php if($menu2_data) foreach ($menu2_data as $key1) { ?>
															<li>
															<a href="list.php?id=<?php echo $key1['t_cid']  ?>&type=<?php echo $key1['t_type'] ?>&page=1" ><?php echo $key1['t_type']?></a>
															</li>
														<?php } ?>
													</ul>
												</li>
											<?php
											}
										 ?>
									</ul>
								</div>
							</li>
							<li id="commercial_memu">
								<a class="menu1" href="">Doanh nghiệp</a>
							</li>
							<li id="support_memu">
								<a title="" href="http://www.asus.com/vn/support/">Hỗ trợ</a>
							</li>
						</ul>	
					</div><!--EndMenu1-->
					<div class="Header-top2-menu2">
						<li class="icon">
							<a rel="YouTube" title="YouTube" target="_blank" href="http://www.youtube.com/user/asus">
								<img src="images/icon_youtube.png">
							</a>
						</li>
						<li class="icon" >
							<a rel="Facebook" title="Facebook" target="_blank" href="http://www.facebook.com/asus.vn">
									<img src="images/icon_facebook.png">
							</a>
						</li>
						<li class="icon">
							<a rel="FacebookORG" title="ORG Facebook" target="_blank" href="https://www.facebook.com/vn.asus.rog">
								<img src="images/icon_facebookasus.png">
							</a>
						</li>
						<div class="search">
							<div class="form-search">
								<form action="search.php?q=$q" method='get'>
								<input type="text" class="inputtext" value="Tìm kiếm" onFocus="if (this.value=='Tìm kiếm') this.value='';" onBlur="if (this.value=='') this.value='Tìm kiếm';" name="q">
								<button id="search-btn" value="Tim kiếm"><span></span></button>
								</form>
							</div>	
						</div>
					</div><!--EndMenu2-->
				</div><!--EndHeader-top2-->
			</div><!--EndHeader-->			
		</div><!--EndWarpper-one-->
		<!-------------------------------Content--Fooder------------------------------>
		<div id="Warpper-tow">
			<div id="Content">
				<div id="Content-baner">
					<div id="slides">
						<div class="slides_container">
							<div class="slide">
								<div class="baner-left">
									<a href="#">
										<img src="images/bn1_1.jpg" />
									</a>
								</div><!--EndBaner-left-->
								<div class="baner-right">
									<div class="baner-right-top">
										<a href="#"><img src="images/bn1_2.jpg" /></a>
									</div>
									<div class="clear-both"></div>
									<div class="baner-right-bottom">
										<a href="#"><img src="images/bn1_3.jpg" /></a>
									</div>
								</div><!--EndBaner-right-->
							</div><!--End-CL-Slide-->
							<div class="slide">
								<div class="baner-left">
									<a href="#">
										<img src="images/bn2_1.jpg" />
									</a>
								</div><!--EndBaner-left-->
								<div class="baner-right">
									<div class="baner-right-top">
										<a href="#"><img src="images/bn2_2.jpg" /></a>
									</div>
									<div class="clear-both"></div>
									<div class="baner-right-bottom">
										<a href="#"><img src="images/bn2_3.jpg" /></a>
									</div>
								</div><!--EndBaner-right-->
							</div><!--End-CL-Slide-->
							<div class="slide">
								<div class="baner-left">
									<a href="#">
										<img src="images/bn3_1.jpg" />
									</a>
								</div><!--EndBaner-left-->
								<div class="baner-right">
									<div class="baner-right-top">
										<a href="#"><img src="images/bn3_2.jpg" /></a>
									</div>
									<div class="clear-both"></div>
									<div class="baner-right-bottom">
										<a href="#"><img src="images/bn3_3.jpg" /></a>
									</div>
								</div><!--EndBaner-right-->
							</div><!--End-CL-Slide-->
							<div class="slide">
								<div class="baner-left">
									<a href="#">
										<img src="images/bn4_1.jpg" />
									</a>
								</div><!--EndBaner-left-->
								<div class="baner-right">
									<div class="baner-right-top">
										<a href="#"><img src="images/bn4_2.jpg" /></a>
									</div>
									<div class="clear-both"></div>
									<div class="baner-right-bottom">
										<a href="#"><img src="images/bn4_3.jpg" /></a>
									</div>
								</div><!--EndBaner-right-->
							</div><!--End-CL-Slide-->
						</div><!--EndSlides-container-->
						<a href="#" class="prev"><img src="images/previous-icon.png" width="24" height="43" alt="Arrow Prev"></a>
						<a href="#" class="next"><img src="images/next-icon.png" width="24" height="43" alt="Arrow Next"></a>
					</div><!--End-ID-Slides-->
				</div><!--EndContent-baner-->
				<div class="Content-center">
					<div id="Content-center1">
						<h2> Sản phẩm nổi bật</h2>
						<!-- <div class="slides_container">
							<?php //foreach ($conten1_data as $key2) { ?>
								<?php //for ($i=0; $i <2 ; $i++) { ?>
										<div class="slide">
											<?php //for ($i=0; $i <2 ; $i++) { ?>
												<div class="item">
													<li>
														<a href="#">
														<img src="images/P_500.jpg" style="width:100px; height:100px">
															<div class="side-content">
																<h3><?php //echo $key2['t_type'] ?></h3>
																<p></p>
															</div>
														</a>
														<div class="clear-both"></div>
													</li>
													
													<li>
														<a href="#">
															<img class="hot-product-pic" src="images/P_101.jpg">
															<div class="side-content">
																<h3>X450CA</h3>
																<p>Vẻ đẹp và Hiệu năng Toàn mỹ</p>
															</div>
														</a>
													</li>
												<div class="clear-both"></div>
												</div>
											<?php //} ?>
										</div>
									<?php //} ?>
							<?php //} ?>
						</div> -->
						<div class="slides_container">
							<div class="slide">
								<div class="item">
									<li>
										<a href="detail.php?id=<?php echo $view_data[0]['t_id'] ?>">
										<img src="<?php echo $view_data[0]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[0]['t_type'] ?></h3>
												<p><?php echo $view_data[0]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
									
									<li>
										<a href="detail.php?id=<?php echo $view_data[1]['t_id'] ?>">
										<img src="<?php echo $view_data[1]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[1]['t_type'] ?></h3>
												<p><?php echo $view_data[1]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
								<div class="clear-both"></div>
								</div>
								<div class="item">
									<li>
										<a href="detail.php?id=<?php echo $view_data[2]['t_id'] ?>">
										<img src="<?php echo $view_data[2]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[2]['t_type'] ?></h3>
												<p><?php echo $view_data[2]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
									<li>
										<a href="detail.php?id=<?php echo $view_data[3]['t_id'] ?>">
										<img src="<?php echo $view_data[3]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[3]['t_type'] ?></h3>
												<p><?php echo $view_data[3]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
								</div>
							</div>
				
							<div class="slide">
								<div class="item">
									<li>
										<a href="detail.php?id=<?php echo $view_data[4]['t_id'] ?>">
										<img src="<?php echo $view_data[4]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[4]['t_type'] ?></h3>
												<p><?php echo $view_data[4]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
									
									<li>
										<a href="detail.php?id=<?php echo $view_data[5]['t_id'] ?>">
										<img src="<?php echo $view_data[5]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[5]['t_type'] ?></h3>
												<p><?php echo $view_data[5]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
								</div>
								<div class="item">
									<li>
										<a href="detail.php?id=<?php echo $view_data[6]['t_id'] ?>">
										<img src="<?php echo $view_data[6]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[6]['t_type'] ?></h3>
												<p><?php echo $view_data[6]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
									<li>
										<a href="detail.php?id=<?php echo $view_data[7]['t_id'] ?>">
										<img src="<?php echo $view_data[7]['t_img'] ?>" style="width:100px; height:100px">
											<div class="side-content">
												<h3><?php echo $view_data[7]['t_type'] ?></h3>
												<p><?php echo $view_data[7]['t_info'] ?></p>
											</div>
										</a>
										<div class="clear-both"></div>
									</li>
								</div>
							</div>
						</div>
						<a href="#" class="prev"><img src="images/icon_prev.png" width="20" height="20" alt="Arrow Prev"></a>
						<a href="#" class="next"><img src="images/icon_next.png" width="20" height="20" alt="Arrow Next"></a>
						<div class="clear-both"></div>
					</div>
					<div id="Content-center2">
							<h2>ASUS Transformer AiO</h2>
							<div id="center2">
								<a title="ASUS Transformer AiO - Một sự kết hợp tuyệt vời" href="http://www.tinhte.vn/threads/asus-transformer-aio-mot-su-ket-hop-tuyet-voi.1977055/">
									<h3>ASUS Transformer AiO - Một sự kết hợp tuyệt vời</h3>
									<img src="images/C2_01.jpg">
									<p>2.	Vào ngày 7/3, ASUS đã trình làng sản phẩm mới mang tính đột phá có tên Transformer AiO. Đây là model đầu tiên trên thế giới kết hợp giữa máy tính All in one chạy hệ điều hành Windows 8 và tablet hệ điều hành Android 4.1. Người dùng có thể sử dụng luân phiên hai hệ điều hành rất nhanh chóng và đơn giản. Khi tablet được gắn trên thân máy tính all in one, nó sẽ đóng vai trò là màn hình hiển thị có kích cỡ là 18.4 inch và chỉ cần một nút bấm, nó sẽ trở thành tablet và có thể điều khiển máy tính all in one từ xa.</p>
								</a>
							</div>
					<div class="clear-both"></div>
					</div>
					<div id="Content-center3">
						<h2>Bình chọn</h2>
						<h3> 3 tính năng quan trọng nhất mà bạn mong muốn ở một chiếc máy tính bảng 7 inch là gì? </h3>
						<div class="checkbox">
							<li><input type="checkbox"><label>Khe cắm thẻ nhớ SD</label>
							</li>
							<li><input type="checkbox" /><label>Digitizer (Màn hình hỗ trợ nhiều mức lực cảm ứng)</label>
							</li>
							<li><input type="checkbox"><label>Chức năng điện thoại</label>
							</li>
							<li><input type="checkbox"><label >Camera phía sau</label>
							</li>
							<li><input type="checkbox"><label>Loa gắn phía trước</label>
							</li>
							<li><input type="checkbox"><label>Màn hình IPS với góc nhìn rộng</label>
							</li>
						</div>
					<div class="clear-both"></div>
					</div>
					<div id="Content-center4">
						<h2> Tin tức</h2>
						<div class="slides_container">
							<?php foreach ($new_data as $key3 ) { ?>
								<div class="slide">
									<div class="item">
										<a title="<?php echo $key3['t_title'] ?>" href="detail.php?id=<?php echo $key3['t_id'] ?>">
											<img src="<?php echo $key3['t_img'] ?>" style="width:280px; height:250px">
											<h3><?php echo $key3['t_title'] ?></h3>
											<p><?php echo $key3['t_info'] ?> </p>
										</a>
									</div>
								</div>
							<?php } ?>
						</div>
							<a href="#" class="prev"><img src="images/icon_prev.png" width="20" height="20" alt="Arrow Prev"></a>
							<a href="#" class="next"><img src="images/icon_next.png" width="20" height="20" alt="Arrow Next"></a>
					<div class="clear-both"></div>
					</div>
					<div id="Content-center5">
						<h2>Video</h2>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
										<li>
											<a class="html5lightbox" title="Dòng bo mạch chủ Z87" href="http://www.youtube.com/embed/4dPT99nlWRA">
												<img src="images/C5_1.jpg">
											</a>
										</li>
									</ul>
								</div>
								<div class="text">
									<h3>Dòng bo mạch chủ Z87</h3>
									<p>Bộ xử lý thông minh kép thế hệ thứ 4</p>
								</div>
							<div class="clear-both"></div>
							</div>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
										<li>
											<a class="html5lightbox" title="Tính năng NFC express " href="https://www.youtube.com/watch?v=p74PUd0whg0">
												<img src="images/C5_2.jpg" />
											</a>
										</li>
									</ul>
								</div>
								<div class="text">
									<h3>Tính năng NFC express </h3>
									<p>Có trên dòng bo mạch chủ Z87</p>
								</div>
							<div class="clear-both"></div>
							</div>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
										<li>
										<a class="html5lightbox" title="Experiencing MeMO Pad HD ME173 " href="http://www.youtube.com/embed/R8bW878JYE8">
											<img alt="1*pL1j2SA1bSU" src="images/C5_2.jpg" />
										</a>
										</li>
									</ul>
								</div>
								<div class="text">
									<h3>Experiencing MeMO Pad HD ME173 </h3>
									<p>Experiencing MeMO Pad HD ME173</p>
								</div>
							<div class="clear-both"></div>
							</div>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
									<li>
										<a class="html5lightbox" title="Dòng bo mạch chủ Z87" href="http://www.youtube.com/embed/4dPT99nlWRA">
											<img src="images/C5_1.jpg">
										</a>
									<div class="clear-both"></div>
									</li>
									</ul>
								</div>
								<div class="text">
									<h3>Dòng bo mạch chủ Z87</h3>
									<p>Bộ xử lý thông minh kép thế hệ thứ 4</p>
								</div>
							<div class="clear-both"></div>
							</div>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
									<li>
										<a class="html5lightbox" title="Tính năng NFC express " href="https://www.youtube.com/watch?v=2wc20mXtyRY">
											<img src="images/C5_2.jpg" />
										</a>
									</li>
									</ul>
								</div>
								<div class="text">
									<h3>Tính năng NFC express </h3>
									<p>Có trên dòng bo mạch chủ Z87</p>
								</div>
							<div class="clear-both"></div>
							</div>
							<div class="video-0">
								<div class="video">
									<ul class="amazingslider-slides">
									<li>
										<a class="html5lightbox" title="Experiencing MeMO Pad HD ME173 " href="http://www.youtube.com/embed/R8bW878JYE8">
											<img alt="1*pL1j2SA1bSU" src="images/C5_2.jpg" />
										</a>
									</li>
									</ul>
								</div>
								<div class="text">
									<h3>Experiencing MeMO Pad HD ME173 </h3>
									<p>Experiencing MeMO Pad HD ME173</p>
								</div>
							<div class="clear-both"></div>
							</div>
					</div>
				</div><!--EnContent-center-->
			</div><!--EndContent-->
			<div class="clear-both"></div>
		</div><!--EndWarpper-tow-->
		<!---------------------------------Fooder------------------------------>
		<div id="Warpper-three">
			<div id="foodter">
				<div id="foodter-one">
					<div class="foodter-container">
						<a href="http://www.asus.com/entry.htm" >
						Vietnam /<span style="color:#fff"> Việt Nam</span></a>
					</div>
					<div class="clear-both"></div>
				</div><!--EndFoodterOne-->
				<div id="foodter-tow">
					<div class="container">
						<div class="container1">
							<div class="row">
								<h4>Cần thêm?</h4>
								<li>
									<a href="#">Text In Style</a>
								</li>
								<li>
									<a href="#">ROG</a>
								</li>
								<li>
									<a href="#">SonicMaster</a>
								</li>
								<li>
									<a href="#">Eee is Me</a>
								</li>
								<li>
									<a href="#">ZENBOOK</a>
								</li>
							</div>
							<div class="row">
								<h4>Về chúng tôi</h4>
								<li>
									<a href="#">Các quan hệ đầu tư</a>
								</li>
								<li>
									<a href="#">Nhân sự</a>
								</li>
								<li>
									<a href="#">GreenASUS & SERASUS</a>
								</li>
								<li>
									<a href="#">Press Room</a>
								</li>
							</div>
							<div class="row">
								<h4>Cần trợ giúp?</h4>
								<li>
									<a href="#">Liên hệ</a>
								</li>
								<li>
									<a href="#">Đăng ký sản phẩm</a>
								</li>
								<li>
									<a href="#">Tải driver</a>
								</li>
								<li>
									<a href="#">Tiến độ sửa chữa</a>
								</li>
							</div>
							<div class="row"  id="last">
								<li>
									<a href="#">Giải thưởng</a>
								</li>
								<li>
									<a href="#">Tin tức</a>
								</li>
								<li>
									<a href="#">Về ASUS</a>
								</li>
							</div>
						<div class="clear-both"></div>
						</div><!--EndContainer1-->
						<div class="container2">
							<div id="bottom-menu">
								<a href="#">Thông tin hợp pháp</a>
								<a href="#">Qui chế pháp lý</a>
								<div id="copyright">©ASUSTeK Computer Inc. All rights reserved. </div>
							</div>
						</div><!--EndContainer2-->
					</div>
				</div><!--EndFoodterTow-->
			</div><!--EndFooder-->
			<div class="clear-both"></div>
		</div><!--EndWarpperThree-->
	</div><!--EndWarpper-->
</body>

</html>