<? if(!empty($_GET['url'])){ include_once $_GET['url']; }else{ echo "หน้าที่แสดงหน้าแรก"; } ?>
include($action);
<? if($_GET['url']=="register"){ $action="register.php"; }else{ $action="home.php"; } ?>
<!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=windows-874" /> <title>Untitled Document</title> </head> <body> <table width="945" height="1475" border="1"> <tr> <td height="186" colspan="3"><? include "headder.php"; @include "admin_menu.php"; ?></td> </tr> <tr> <td width="133" height="1171" align="center" valign="top"> </td> <td width="657" align="center" valign="top"><? include($action); if($_GET['url']=="register"){ $action="register.php"; }else{ $action="index.php"; } ?> ?></td> <td width="133" align="center" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </body> </html>
<!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=windows-874" /> <title>Untitled Document</title> </head> <body> <table width="945" height="1475" border="1"> <tr> <td height="186" colspan="3"><? include "headder.php"; @include "admin_menu.php"; ?></td> </tr> <tr> <td width="133" height="1171" align="center" valign="top"> </td> <td width="657" align="center" valign="top"><? if($_GET['url']=="register"){ include("register.php"); }else{ include("index.php"); } ?> </td> <td width="133" align="center" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </body> </html>
<!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=windows-874" /> <title>Untitled Document</title> </head> <body> <table width="945" height="1475" border="1"> <tr> <td height="186" colspan="3"><? include "headder.php"; @include "admin_menu.php"; ?></td> </tr> <tr> <td width="133" height="1171" align="center" valign="top"> </td> <td width="657" align="center" valign="top"><? if($_GET['url']=="register"){ include("register.php"); }else{ include("Search.php"); } ?> </td> <td width="133" align="center" valign="top"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </body> </html>
<html> <head> <title>ค้นหา</title> <style type="text/css"> th {font-family:sans-serif; font-size:12px; } </style> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); </script> <script type="text/javascript"> function get_search (p, t){ var p = $("#price").val(); var t = $("#txtKeyword").val(); if(p.length==0 && t.length==0){ alert('โปรดเลือกราคาหรือชื่อหอพักที่ต้องการค้นหา'); } } </script> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head> <body> <form name="frmSearch" method="post" action="<?=$_SERVER['PHP_SELF']?>" onSubmit="get_search (price, txtKeyword)"> <table width="698" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <th width="631" bgcolor="#33CCFF"><div align="center">ราคาห้องพัก <select name="price" id="price"> <option value="">- เลือกราคา -</option> <option value="1" <? if($price==1){?>selected<? }?>>น้อยกว่า1000</option> <option value="2" <? if($price==2){?>selected<? }?>>1001-1500</option> <option value="3" <? if($price==3){?>selected<? }?>>1501-2000</option> <option value="4" <? if($price==4){?>selected<? }?>>2001-2500</option> <option value="5" <? if($price==5){?>selected<? }?>>2501-3000</option> <option value="6" <? if($price==6){?>selected<? }?>>มากกว่า 3000</option> </select> ชื่อหอพัก <input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_POST["txtKeyword"];?>"> <input type="submit" value="Search"> </div></th> </tr> </table> </form> <? @include("connect.php"); ?> <? if($_REQUEST['price']!=''){ $price = $_REQUEST['price']; switch($price){ case 1: $where = " WHERE price_prd < 1000 "; break; case 2: $where = " WHERE price_prd BETWEEN 1001 AND 1500 "; break; case 3: $where = " WHERE price_prd BETWEEN 1501 AND 2000 "; break; case 4: $where = " WHERE price_prd BETWEEN 2001 AND 2500 "; break; case 5: $where = " WHERE price_prd BETWEEN 2501 AND 3000 "; break; case 6: $where = " WHERE price_prd > 3000 "; break; } } if($_REQUEST["txtKeyword"] != ""){ $detail = $_REQUEST["txtKeyword"]; $where = " WHERE (name_prd LIKE '%".$detail."%') "; } if($_REQUEST['price']!='' && $_REQUEST["txtKeyword"] != ""){ $price = $_REQUEST['price']; $name_prd = $_REQUEST["txtKeyword"]; switch($price){ case 1: $where = " WHERE price_prd < 1000 OR name_prd LIKE '%".$name_prd."%' "; break; case 2: $where = " WHERE price_prd BETWEEN 1001 AND 1500 OR name_prd LIKE '%".$name_prd."%'"; break; case 3: $where = " WHERE price_prd BETWEEN 1501 AND 2000 OR name_prd LIKE '%".$name_prd."%'"; break; case 4: $where = " WHERE price_prd BETWEEN 2001 AND 2500 OR name_prd LIKE '%".$name_prd."%'"; break; case 5: $where = " WHERE price_prd BETWEEN 2501 AND 3000 OR name_prd LIKE '%".$name_prd."%'"; break; case 6: $where = " WHERE price_prd > 3000 OR name_prd LIKE '%".$name_prd."%'"; break; } } ?> <table border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <th width="92" bgcolor="#FFFFCC"> <div align="center">รหัสหอพัก</div></th> <th width="97" bgcolor="#FFFFCC"> <div align="center">ชื่อหอพัก </div></th> <th width="140" bgcolor="#FFFFCC"> <div align="center">ประเภทหอพัก </div></th> <th width="83" bgcolor="#FFFFCC"> <div align="center">ราคา</div></th> <th width="110" bgcolor="#FFFFCC"> <div align="center">รูปภาพ </div></th> <th width="170" bgcolor="#FFFFCC"> <div align="center">รายละเอียด</div></th> </tr> <? if($price!='' || $txtKeyword!=''){ $strSQL = "SELECT * FROM tb_product "; $strSQL .= " LEFT JOIN tb_type ON tb_product .ref_id_type = tb_type.id_type"; $strSQL .= " $where"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page =10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by id_prd ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); $bg = 1; while($objResult = mysql_fetch_array($objQuery)) {$bg++; if($bg%2==0){ $bgr = '#CCFF99'; }else{ $bgr = '#EBEBEB'; } ?> <tr bgcolor="<?=$bgr?>"> <td height="50"><div align="center"><?=$objResult["id_prd"];?></div></td> <td><div align="center"><?=$objResult["name_prd"];?></div></td> <td><div align="center"><?=$objResult["name_type"];?></div></td> <td><div align="center"><?=$objResult["price_prd"];?></div></td> <td align="right"><div align="center"><img src='photo/<?=$objResult["photo_prd"];?>' width='80' height='60' /></div></td> <td><div align="center">[ <A HREF='search_view.php?id_prd=<?=$objResult["id_prd"];?>'>แสดงรายละเอียด </A>] </div> </div></td> </tr> <? }}?> </table> <div align="center"><br> จำนวนหอพักทั้งหมด <?= $Num_Rows;?> หอพัก:หน้า : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&price=$_REQUEST[price]&txtKeyword=$_REQUEST[txtKeyword]'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&price=$_REQUEST[price]&txtKeyword=$_REQUEST[txtKeyword]'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&price=$_REQUEST[price]&txtKeyword=$_REQUEST[txtKeyword]'>Next>></a> "; } //mysql_close($objConnect); ?> </div> </body> </html>
<? $id_prd=$_GET['id_prd']; ?> <HTML> <HEAD> <TITLE>online</TITLE><meta http-equiv=Content-Type content="text/html; charset=tis-620"> <style type="text/css"> <!-- .style1 { color: #990000; font-weight: bold; } .style2 {color: #990000} --> </style> </HEAD> <BODY> <? @include "connect.php"; $sql="select * from tb_product where id_prd='$id_prd' "; $result=mysql_db_query($db_Name,$sql); $rs=mysql_fetch_array($result); $id_prd=$rs[id_prd]; $code=sprintf("%05d",$id_prd); $name_prd=$rs[name_prd]; $detail_prd=$rs[detail_prd]; $ref_id_type=$rs[ref_id_type]; $price_prd=$rs[price_prd]; $photo_prd=$rs[photo_prd]; ?> <table width="551" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CC0066"> <tr> <td width="37%" rowspan="10"><img src="photo/<?=$photo_prd?>" width="200" height="200"></td> <td width="20%" bgcolor="#66FFFF"><div align="center" class="style1">รหัสหอพัก </div></td> <td width="43%" align="left" bgcolor="#00FFFF"><div align="left" class="style2"><?=$code?></div></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="center" class="style1">ชื่อหอพัก</div></td> <td align="left" bgcolor="#FFFFFF"><div align="left" class="style2"><?=$name_prd?></div></td> </tr> <tr> <td bgcolor="#66FFFF"><div align="center" class="style1">ราคา </div></td> <td align="left" bgcolor="#00FFFF"><div align="left" class="style2"><?=$price_prd?></div></td> </tr> <tr> <td align="right" valign="top" bgcolor="#FFFFFF"><div align="center" class="style1">รายละเอียด </div></td> <td align="left" valign="top" bgcolor="#FFFFFF"><div align="left" class="style2"><?=$detail_prd?></div></td> </tr> </table> </BODY> </HTML>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง