?
Path : /home/admin/public_html/old/ |
Current File : /home/admin/public_html/old/hotellist.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=utf-8" /> </head> <body onload="MM_preloadImages('images/home_over_01.gif','images/menu_over02.gif','images/menu_over03.gif','images/menu_over04.gif')"> <table width="877" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="981" bgcolor="#FFFFFF"><table width="877" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10" valign="top"> </td> <td width="971" valign="top"><table width="873" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="1011"><strong>Hotel</strong></td> </tr> <tr> <td><p> <? $objConnect = mysql_connect("localhost","admin_happykorea","my;iNgdks]u2011") or die(mysql_error()); $objDB = mysql_select_db("admin_happykorea"); mysql_query("set NAMES utf8"); $strSQL = "SELECT * FROM smeweb_catalog where category NOT IN ('L1','L2','L3','L4','LA') "; $objQuery = mysql_query($strSQL); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 12; // 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 idp desc LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); echo"<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr>"; $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { echo "<td>"; $intRows++; $picstr=$objResult["picture"]; $pic=explode("@",$picstr); ?> </p> <center> <table width="783" height="178" border="1" cellpadding="0" cellspacing="0" bordercolor="1e74a5" background="images/images/bgmenu.jpg"> <tr> <td width="677" height="176"><div align="center"> <table width="755" border="0" cellpadding="0" cellspacing="0" bordercolor="#000099" background="images/bgtabb.jpg"> <tr> <td width="179" rowspan="6" bgcolor="#FFFFFF"><div align="center"><img src="images/<?=$pic[0];?>" width="150" height="160" /></div></td> <td colspan="2" bgcolor="#FFFFFF"><div align="center" class="style3" style="color: #009; font-size: 12pt; font-weight: bold;"> <div align="left"> <?=($objResult["hotelname"]);?> <? if($objResult["star"] == '0'){ echo ""; } ?> <? if($objResult["star"] == '1'){ echo "<img src='images/star1.jpg' />"; } ?> <? if($objResult["star"] =='2'){ echo "<img src='images/star2.jpg' />"; } ?> <? if($objResult["star"] == '3'){ echo "<img src='images/star3.jpg' />"; } ?> <? if($objResult["star"] == '4'){ echo "<img src='images/star4.jpgf' />"; } ?> <? if($objResult["star"] == '5'){ echo "<img src='images/star5.jpg' />"; } ?> </div> </div></td> </tr> <tr> <td height="19" valign="top" bgcolor="#FFFFFF"> </td> <td height="19" valign="top" bgcolor="#FFFFFF"><a href="hotel.php?id=<? echo $objResult["idp"];?>"><img src="images/readmore.jpg" width="114" height="24" border="0" /></a></td> </tr> <tr> <td height="18" valign="top" bgcolor="#FFFFFF"><span class="style2"> <?=$objResult["address"];?> </span></td> <td height="18" valign="top" bgcolor="#FFFFFF"><a href="book.php?id=<? echo $objResult["idp"];?>"><img src="images/book.jpg" width="114" height="24" border="0" /></a></td> </tr> <tr> <td width="462" height="18" valign="top" bgcolor="#FFFFFF"><div align="left"><span class="style2"><span class="style1"><?=$objResult["price"];?> </span>บาท</span></div></td> <td width="114" height="18" valign="top" bgcolor="#FFFFFF"><? if($objResult["recommend"] =='0'){ echo ""; } ?> <? if($objResult["recommend"] == '1'){ echo "<img src='images/recommended.gif' />"; } ?></td> </tr> <tr> <td height="20" valign="top">ย่าน <span class="style1"> <?=$objResult["category"];?> </span></td> <td height="20" valign="top"> </td> </tr> <tr> <td height="20" valign="top"> </td> <td height="20" valign="top"> </td> </tr> </table> </div></td> </tr> </table> </center> <? echo"</td>"; if(($intRows)%1==0) { echo"</tr>"; } } echo"</tr></table>"; ?> <br /> รวม <?= $Num_Rows;?> ข้อมูล : <?=$Num_Pages;?> หน้าที่ : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } ?> <? mysql_close($objConnect); ?></td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> </body> </html>