|
|
|
โค้ด php ไม่ทำงาน Run แล้ว ตัวแปรออกมาเป็น text หมดเลยคะ |
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<?php
$Hotelid = $_GET['Hotelid'];
$keyMainID;
$link=mysql_connect("localhost","root","root"); // ทำการติดต่อ MySQL ด้วย function mysql_connect();
mysql_select_db("zizzee_dbv11",$link);
$cs1 = "SET character_set_results=utf8";
mysql_query($cs1) or die('Error query: ' . mysql_error());
$cs2 = "SET character_set_client = utf8";
mysql_query($cs2) or die('Error query: ' . mysql_error());
$cs3 = "SET character_set_connection = utf8";
mysql_query($cs3) or die('Error query: ' . mysql_error());
if($Hotelid!=null){
$sql = "SELECT * FROM `hotelinfobase` inner join hoteldetailth on hotelinfobase.hotelBaseID = hoteldetailth.hotelBaseID inner join hoteldetailen on hoteldetailen.hotelBaseID = hoteldetailth.hotelBaseID WHERE hotelinfobase.hotelBaseID = $Hotelid";
$rs = mysql_query($sql);
while ($result = mysql_fetch_object($rs)) {
$hBaseName = $result->hBaseNameEN;
$hBaseNameTH = $result->hBaseNameTH;
$addr = $result->addr;
$mainImg = $result->imgThumbnail;
$rating = $result->rating;
$lat = $result->lat;
$lng = $result->lng;
$descFullTH = $result->descFullTH;
$facFullTH = $result->facFullTH;
// $airportShuttle = $result->airportShuttle;
// $park = $result->park;
// $service = $result->service;
// $laundry = $result->laundry;
// $pet = $result->pet;
// $rest = $result->rest;
// $fitness =$result->fitness;
// $pool = $result->pool;
// $air = $result->air;
// $cable = $result->cable;
// $net = $result->net;
// $wireless = $result->wireless;
if ($rating == 0) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star00.png";
} else if ($rating == 0.5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star00.5.png";
} else if ($rating == 1) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star01.png";
} else if ($rating == 1.5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star01.5.png";
} else if ($rating == 2) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star02.png";
} else if ($rating == 2.5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star02.5.png";
} else if ($rating == 3) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star03.png";
} else if ($rating == 3.5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star03.5.png";
} else if ($rating == 4) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star04.png";
} else if ($rating == 4.5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star04.5.png";
} else if ($rating == 5) {
$StarRating = "http://zizzee.zizzee.com/images/Star/star05.png";
} else {
$StarRating = "http://zizzee.zizzee.com/images/Star/star05.png";
}
}
$keysql = "SELECT kmEn,KmTh,hotelkeymain.keyMainID, countryNameEn FROM hotelkeymain inner join keymain on hotelkeymain.keyMainID = keymain.keyMainID INNER JOIN countrymain ON keymain.countryMainID = countrymain.countryMainID where hotelkeymain.hotelBaseID = '".$Hotelid."'";
$keyrs = mysql_query($keysql);
while ($r= mysql_fetch_array($keyrs)){
$ksTH = $r['KmTh'];
$ksEN = $r['kmEn'];
$country = $r['countryNameEn'];
$keyMainID = $r['keyMainID'];
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>จองโรงแรม<?=$ksTH ?> จองโรงแรม<?php echo $hBaseNameTH;?> ข้อมูลโรงแรม<?php echo $hBaseNameTH;?> จองโรงแรมให้ถูก เปรียบเทียบราคาให้ดี ที่ Zizzee.com. Booking <?php echo $hBaseName;?>, Compare Hotel Prices, Air Tickets & Car Rental Around the World - Zizzee.com</title>
<meta name="keywords" content="จองโรงแรม<?=$ksTH ?>,จองโรงแรม<?php echo $hBaseNameTH;?>, จองโรงแรม, จองที่พัก, ราคาโรงแรม, เปรียบเทียบโรงแรม, เปรียบเทียบราคาโรงแรม,Hotel in <?=$ksEN ?>,compare hotel price, discount hotels, book hotels, find hotels, compare hotel rates">
<meta name="description" content="เว็บไซต์ที่คุณสามารถค้นหาที่พักและบริการท่องเที่ยวได้ในราคาที่ตรงใจ คุณจะสามารถค้นหาเปรียบเทียบราคาโรงแรมที่อัพเดทขณะวินาทีที่คุณค้นหา ไม่ว่าจะเป็นราคาของบริการประเภท ที่พัก ตั๋วเครื่องบิน หรือรถเช่า ในราคาโรงแรมที่ถูกกว่าปกติมากเกือบ 30%-70% และสามารถจองที่พักออนไลน์ได้ทันที,Zizzee.com is smart search engine that travelers can use to find hotel, air ticket and car rental availability and rates, and to compare prices from multiple merchants. We help you to find best price and link you through the supplier website to book directly">
<meta name="robots" content="index, follow">
<link href="http://zizzee.com/images/zizzee_ico/favicon.ico" rel="SHORTCUT ICON">
</head>
<body>
<?php
$sql1 = "SELECT * FROM `hotelimage` INNER JOIN hoteldetailen ON hoteldetailen.hotelBaseID = hotelimage.hotelBaseID WHERE `hotelimage`.`hotelBaseID` = $Hotelid";
$rs1 = mysql_query($sql1);
while ($row = mysql_fetch_object($rs1)) {
$descFull = $row->descFullEN;
$facFull = $row->facFullEN;
$imgFull = $row->imgFull;
}
/* $count=0;
$sqlwsid = "SELECT * FROM `hotelprice` WHERE `hotelBaseID` =".$Hotelid;
$rswsid = mysql_query($sqlwsid);
$bestprice=0;
$wsNamebs=0;
$currencybs=0;
while($result4 = mysql_fetch_object($rswsid)) {
$wsID[$count] = $result4->wsID;
$sqlwsName = "SELECT wsName FROM `ws` WHERE `wsID` =".$wsID[$count];
$rswsName = mysql_query($sqlwsName);
while($result5 = mysql_fetch_array($rswsName)) {
$wsName[$count] = $result5["wsName"];
}
$roomType[$count] = $result4->roomType;
$ratePerNight[$count] = round($result4->ratePerNight,2);
$currency[$count] = $result4->currency;
if($bestprice==0){
$bestprice=$ratePerNight[$count];
$wsNamebs=$wsName[$count];
$currencybs = $currency[$count];
}else if($ratePerNight[$count]<$bestprice)
{
$bestprice=$ratePerNight[$count];
$wsNamebs=$wsName[$count];
$currencybs = $currency[$count];
}
$count++;
}*/
$count1=0;
$sqlreview = "SELECT * FROM `reviewRecord` where `hBaseID` =".$Hotelid;
$rsreview = mysql_query($sqlreview);
while ($result6 = mysql_fetch_object($rsreview)){
$reviewRecordID[$count1] = $result6->reviewRecordID;
$hBaseID[$count1] = $result6->hBaseID;
$rating[$count1] = $result6->rating;
$hotelRating[$count1] = $result6->hotelRating;
$valueRating[$count1] = $result6->valueRating;
$roomRating[$count1] = $result6->roomRating;
$facilityRating[$count1] = $result6->facilityRating;
$serviceRating[$count1] = $result6->serviceRating;
$locationRating[$count1] = $result6->locationRating;
$foodRating[$count1] = $result6->foodRating;
$reviewerName[$count1] = $result6->reviewerName;
$reviewerAge[$count1] = $result6->reviewerAge;
$reviewerEmail[$count1] = $result6->reviewerEmail;
$reviewerOccupation[$count1] = $result6->reviewerOccupation;
$checkin[$count1] = $result6->checkin;
$checkout[$count1] = $result6->checkout;
$title[$count1] = $result6->title;
$description[$count1] = $result6->description;
$image[$count1] = $result6->image;
$count1++;
}
mysql_free_result($keyrs);
mysql_free_result($rsreview);
// mysql_free_result($rswsid);
mysql_free_result($rs1);
mysql_free_result($rs);// ทำลายตัวแปร $rs
mysql_close($link); // ปิดการติดต่อกับ MySQL
?>
<?php
// echo "<h2>Detail ";
// echo $hBaseName.",".$hBaseNameTH."</h2><br>";
// echo "<img src=$mainImg><br>";
// echo "rating ".$rating."<br>";
// echo $addr."<br>";
// echo "Description<br>".$descFull."<br>".$descFullTH."<br>";
// echo "Facility<br>".$facFull."<br>".$facFullTH."<br>";
// for($i=0;$i<$count;$i++){
//
// echo "Agency ".$wsName[$i]." Room type ".$roomType[$i]." Price ".$ratePerNight[$i]." ".$currency[$i];
//
// }
//
//
// for($j=0;$j<$count1;$j++){
// echo $reviewerName[$j]." : ".$title[$j]." : ".$description[$j].":".$checkin[$j]." to ".$checkout[$j].":rating = ".$rating[$j]."<br>";
// }
}else{
echo "Sorry this page error";
}
?>
<?
echo "<center><a href='http://www.zizzee.com/#!h_$ksEN&keySearch_$ksEN&searchType_location&country_$country&keyMainID_$keyMainID&page_1' TARGET='_blank' style='color:blue;'>Hotel in ".$ksEN." ( จองโรงแรม$ksTH ที่พัก$ksTH )</a></center><br><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"850\">
<tr>
<td width=\"19\"><img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_01.gif\"/>
</td> <td background=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\" valign=\"top\">
<img height=\"19\" width=\"1\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\"/></td>
<td width=\"19\"><div align=\"left\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_02.gif\"/>
</div></td>
</tr>
<tr>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_06.gif\"></td>
<td valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"left\" width=\"99%\">
<tr>
<td width=\"145\" valign=\"top\"><div align=\"center\"><strong>Price<br/><br>
<span style=\"font-size: 18px; color: rgb(255, 0, 0);\">".$bestprice." ".$currencybs."</span></strong><br/>
<br/> </div> <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"left\" width=\"136\">
<tr>
<td><div align=\"left\" style=\"font-size: 14px; color: rgb(0, 0, 0); font-family: Arial,Helvetica,sans-serif;\">
<a href=\"http://www.zizzee.com/#!h_$ksEN&keySearch_$ksEN&searchType_location&country_$country&keyMainID_$keyMainID&hotelId_$Hotelid\" target=\"_blank\">
<img height=\"25\" border=\"0\" width=\"135\" src=\"http://zizzee.zizzee.com/images/blog/seereal.gif\"/>
</a></div></td>
</tr>
</table>
<div align=\"center\"><br/>
<br/>
<span style=\"font-size: 14px; font-weight: bold;\">".$wsNamebs."</span></div></td>
<td width=\"130\" valign=\"top\"><div align=\"center\">
<img height=\"95\" width=\"125\" src= ".$mainImg."><br/>
<br/>
<img src=".$StarRating."><br/>
</div></td>
<td valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"98%\">
<tr>
<td valign=\"top\"><div style=\"font-family: Arial,Helvetica,sans-serif; font-size: 16px; font-weight: bold;\">".$hBaseNameTH."<br/><br>
</div></td>
</tr>
</table>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"98%\">
<tr>
<td><p style=\"font-family: Arial,Helvetica,sans-serif; font-size: 14px;\"> ".$addr." <br/>
</p>
<p style=\"font-family: Arial,Helvetica,sans-serif; font-size: 14px;\">
</p><br>
</td>
</tr>
</table></td>
</tr> </table>
<br/><br/>
<br/><br/>
<br/><br/>
<br/><br/>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"100%\">
<tr>
<td width=\"100%\" valign=\"middle\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"background-color: #fb3f99\">
<tr style=\"font-size: 15px; color: black;height: 35px\">
<td align=\"left\" width=\"20%\" style=\"padding-left: 5px\">Agent</td>
<td align=\"center\" width=\"60%\">Roomtype</td>
<td align=\"right\" width=\"20%\">Prices</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width=\"100%\" valign=\"middle\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"font-size: 13px\">";
$color = array("#fbe1f3","#feaef6");
$bgcolor = "";
for($i=0;$i<$count;$i++) {
if($i%2==0) {
$bgcolor = $color[0];
}else if($i%2!=0) {
$bgcolor = $color[1];
}
echo "<tr bgcolor=\"".$bgcolor."\" style=\"height: 35px\">;
<td align=\"left\" width=\"20%\" style=\"padding-left: 5px\">".$wsName[$i]."
</td>
<td align=\"center\" width=\"60%\">".$roomType[$i]."
</td>
<td align=\"right\" width=\"20%\">".$ratePerNight[$i].' '.$currency[$i]."
</td>
</tr>";
}
echo "</table></td></tr></table></td>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_03.gif\"></td>
</tr>
<tr>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_04.gif\" valign=\"top\"></td>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_08.gif\"></td>
<td valign=\"top\"><img width=\"19\" height=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_05.gif\"></td>
</tr></table>";
if($descFull!=null){
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"850\">
<tr> <td width=\"19\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_01.gif\"/>
</td> <td background=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\" valign=\"top\">
<img height=\"19\" width=\"1\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\"/>
</td><td width=\"19\"><div align=\"left\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_02.gif\"/>
</div></td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_06.gif\"></td>
<td> Description รายละเอียด<br><br><div style='font-family: Arial,Helvetica,sans-serif; font-size: 14px; color: #0E95E3;'>
".$descFull."<br><br>".$descFullTH."</div></td>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_03.gif\"> </td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_04.gif\" valign=\"top\"/>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_08.gif\"/>
<td valign=\"top\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_05.gif\"/>
</td></tr></table>";
}
if($facFull!=null){
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"850\">
<tr> <td width=\"19\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_01.gif\"/>
</td> <td background=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\" valign=\"top\">
<img height=\"19\" width=\"1\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\"/>
</td><td width=\"19\"><div align=\"left\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_02.gif\"/>
</div></td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_06.gif\"></td>
<td> Facilities สิ่งอำนวยความสะดวก<br><br><div style='font-family: Arial,Helvetica,sans-serif; font-size: 14px; color: #0E95E3;'>
".$facFull."<br><br>".$facFullTH."</div></td>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_03.gif\"> </td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_04.gif\" valign=\"top\"/>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_08.gif\"/>
<td valign=\"top\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_05.gif\"/>
</td></tr></table>";
}
if($imgFull!=null) {
// for(int i=0;i<=Detailhotel.get(0).getFullImg().length();i++){
//String[] Photo = Detailhotel.get(0).getImgFull().split(";");
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"850\">
<tr> <td width=\"19\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_01.gif\"/>
</td> <td background=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\" valign=\"top\">
<img height=\"19\" width=\"1\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\"/>
</td><td width=\"19\"><div align=\"left\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_02.gif\"/>
</div></td></tr>
<tr><td background=\"images/blog/bgconer_06.gif\"></td>
<td style='font-family: Arial,Helvetica,sans-serif; font-size: 14px; color: blue;'>";
$img = explode(";", $imgFull);
for($i=0;$i<count($img);$i++) {
echo "<a href='$img[$i]' target=\"_blank\"><img height=\"95\" width=\"125\" src=\"". $img[$i]."\"/></a> " ;
}
echo "</td><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_03.gif\"> </td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_04.gif\" valign=\"top\"/>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_08.gif\"/>
<td valign=\"top\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_05.gif\"/>
</td></tr></table>";
}
if($count1>0)
{
echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"850\">
<tr> <td width=\"19\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_01.gif\"/>
</td> <td background=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\" valign=\"top\">
<img height=\"19\" width=\"1\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_07.gif\"/>
</td><td width=\"19\"><div align=\"left\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_02.gif\"/>
</div></td></tr>
<tr><td background=\"images/blog/bgconer_06.gif\"></td>
<td style='font-family: Arial,Helvetica,sans-serif; font-size: 14px; color: blue;'><h1> $hBaseName Review ( รีวิวโรงแรม รีวิวที่พัก รีวิว$hBaseNameTH )</h1><br>";
for($j=0;$j<$count1;$j++){
echo "โดย ".$reviewerName[$j]." : ".$title[$j]."<BR> >>> ".$description[$j]."<hr>";
}
echo "</td><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_03.gif\"> </td></tr>
<tr><td background=\"http://zizzee.zizzee.com/images/blog/bgconer_04.gif\" valign=\"top\"/>
<td background=\"http://zizzee.zizzee.com/images/blog/bgconer_08.gif\"/>
<td valign=\"top\">
<img height=\"19\" width=\"19\" src=\"http://zizzee.zizzee.com/images/blog/bgconer_05.gif\"/>
</td></tr></table>";
}
?>
</body>
</html>
Tag : PHP, MySQL
|
ประวัติการแก้ไข 2013-06-25 10:19:24
|
|
|
|
|
Date :
2013-06-25 10:14:32 |
By :
Ryo |
View :
923 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แก้ได้แล้วคะ
|
|
|
|
|
Date :
2013-06-25 10:19:41 |
By :
Ryo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2013-06-25 10:21:47 |
By :
Manussawin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แก้ยังไงเหรอค่ะ มีปัญหาเหมือนกัน
|
|
|
|
|
Date :
2013-06-25 20:57:07 |
By :
Lovely |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|