Skip to main content

Posts

PHP#13MySQL#9 - TabsMenu

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="60" colspan="3">&nbsp;</td> </tr> <tr> <td colspan="3" bgcolor="#FF9933"> <!--Links used to initiate the sub menus. Pass in the desired submenu index numbers (ie: 0, 1) --> <?php include("../connect.php"); $sl1="select idTL, TenTL from theloai"; $kq1=mysqli_query($link,$sl1); $i=0; while($d1=mysqli_fetch_array($kq1)) { if($i>0){echo "...

PHP#13MySQL#9 - GlossyAccordionMenu

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <script type="text/javascript" src="jquery-1.2.2.pack.js"></script> <script type="text/javascript" src="ddaccordion.js"> /*********************************************** * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts * This notice must stay intact for legal use ***********************************************/ </script> <script type="text/javascript"> ddaccordion.init({ headerclass: "submenuheader", //Shared CSS class name of headers group contentclass: "submenu", //Shared CSS class name of contents group revealtype: "click", //Reveal content...

PHP#13MySQL#9 - smoothmenu

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <link rel="stylesheet" type="text/css" href="mrk_smooth/ddsmoothmenu.css" /> <link rel="stylesheet" type="text/css" href="mrk_smooth/ddsmoothmenu-v.css" /> <script type="text/javascript" src="mrk_smooth/jquery.min.js"></script> <script type="text/javascript" src="...

PHP#13MySQL#9 - sdmenu

  <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Slashdot's Menu</title> <link rel="stylesheet" type="text/css" href="sdmenu.css" /> <script type="text/javascript" src="sdmenu.js"> /*********************************************** * Slashdot Menu script- By DimX * Submitted to Dynamic Drive DHTML code library: http://www.dynamicdrive.com * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ </script> <script type="text/javascript"> // <![CDATA[ var myMenu; window.onload = function() { myMenu = new SDMenu("my_menu"); myMenu...

Sản phẩm mới, Sản phẩm xem nhiều, Tất cả sản phẩm, Phân trang-Phân nhóm

<!doctype html> <html> <head> <meta charset="utf-8"> <title>Mới Nhất, Xem Nhiều</title> <style> #ds_sp{ width:620px; margin:auto;} .sanpham{ width:120px; float:left; border:1px #2802E9 solid; margin-right:2px; margin-bottom:2px;} .tieude{ font-size:20px; font-weight:bold; background-color: #230DE0; color:#F5EFEF; margin-top:10px; margin-bottom:10px;} .ht{ font-size:20px; color:#E0070B; font-weight:bold;} </style> </head> <body> <?php $link=@mysqli_connect("localhost","root","") or die("Không tìm thấy Sever"); mysqli_select_db($link,"webtintuc") or die("Không tồn tại DB"); mysqli_query($link,"set names 'utf8'"); $sp=5*4; $sn=5; $sl="select TenSP, UrlHinh, Gia from webtm_sanpham"; $kq=mysqli_query($link,$sl); $tsp=mysqli_num_rows($kq); $tst=ceil($tsp/$sp); $tsn=ceil($tst/$sn); if(isset($_GET['p'])){$p=$_GET...

Sản phẩm mới, Sản phẩm xem nhiều

<!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> #ds_sp{width: 620px; margin: auto;} .sanpham{width: 120px; float: left; height: 250px; border: 1px #4D3BE5 solid; margin-right: 2px; margin-bottom: 2px;} .ht{font-size: 20px; color: #F10C0F; font-weight: bold;} .tieude{ background-color:#0A16F0; font-size:20px; font-weight:bold; margin-bottom:10px; margin-top:10px; width:100%; color:#F5F3F3;} </style> </head> <body> <div id="ds_sp"> <div class="tieude">Sản Phẩm Mới</div> <?php include("connect.php"); //Quy ước 1 trang gồm 20sp: $sp=5*2; //Truy vấn lấy tất cả sản phẩm: $sl="select TenSP, UrlHinh, Gia from webtm_sanpham"; $kq=mysqli_query($link,$sl); //tính tổng sản phẩm: $tsp=mysqli_num_rows($kq); //Tính tổng số trang: $tst=ceil($tsp/$sp); //Tính trang hiện tại: if(isset($_GET[...

PHP#12MySQL#8 - Phân Trang - Phân Nhóm (RẤT QUAN TRỌNG) n=ceil(p/sn) //p=(n-1)sn+1 //Lần đầu chạy lên p=n=1 //$dau=($n-1)*$sn+1; $cuoi=$n*$sn

<!doctype html> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> .ht{font-size: 20px; color: #F10C0F; font-weight: bold;} </style> </head> <body> <?php include("connect.php"); //Quy ước 1 trang gồm 5sp: $sp=5; //Quy ước 1 nhóm gồm 5 trang: $sn=5; //Truy vấn lấy tất cả sản phẩm: $sl="select TenSP, UrlHinh, Gia from webtm_sanpham"; $kq=mysqli_query($link,$sl); //tính tổng sản phẩm: $tsp=mysqli_num_rows($kq); //Tính tổng số trang: $tst=ceil($tsp/$sp); //Tính tổng số nhóm: $tsn=ceil($tst/$sn); //Tính nhóm, trang hiện tại: if(isset($_GET['p'])) {$p=$_GET['p']; $n=ceil($p/$sn);} else if(isset($_GET['n'])){$n=$_GET['n'];$p=($n-1)*$sn+1;} else $p=$n=1; //Tính vị trí cần để lấy sản phẩm: $vt=($p-1)*$sp; $slsp="select TenSP, UrlHinh, Gia from webtm_sanpham limit $vt,$sp"; $kqsp=mys...