模版集成
模版集成能够让您创建您自己的网页布局,更加灵活的编辑网页,每一个元素都是独特的模版。它被分作两个主要类别,可以使用标准酒店页面或自定义化酒店页面。
在标准酒店网页使用 PHP, Simple Javascript (Java 脚本) or iframe(內联框架), 酒店列表的每个目的地都能轻松集成在您的现存网页。登录网是R24的标准酒店网页。

搜索箱是一个很轻松的方法去添加一个小而实用的工具去现存的网页,结果显示所有可行选项。

所有模版已经集成在了预设模块里,允许最简单的R24预定引擎集成在新的域名下。
标准酒店页面模版集合
模版集合可以使用 PHP, iframe(内嵌框架) 或者 simple JavaScript(简易Java特效)。R24的预定引擎将会集成在您的现存网页。模版将会显示选定目的地的酒店列表和酒店网页。
The R24.asia 2010 集成版本 :
酒店清单 PHP 集成 - 推荐使用

我们将推荐 PHP 版本按区域显示的酒店清单,默认设置是按位置排序

1. 看此例子 PHP source code with white-label system
2. 另一个例子PHP source code with returning customer option (细节“回头客选项”“白标“可以参见。


<div id="MYLIST1">
<?php # DIV,P or TD container with an "id" is REQUIRED.
$partner = "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required.
$region = "huahin";   # replace "huahin" by whatever region you want to call initially
$defcur = "EUR";        # optional. To set a DEFAULT currency
# $province = NN                  # optional. Use province code instead of region (alternative to 'region' parameter)
# $sorting = "l";       # optional. To set a DEFAULT sorting [n]=name, [l]=location, [r]rates
# $search = "...";      # optional. Search/filter by a name/location substring (overwrites region and province)
# $search = "!...";      # optional. Search/filter by a location substring (within region or province) 
# $promote = "1";       # optional. To filter by recommended and promoted hotels
# $rating = "3";        # optional. To set a star rating range
# $frame = "_self";     # optional. To set a target frame for hotelpages, e.a. same window. Default is _blank
# $target = "http://www.sawadee.com/hotel/"; # set your own destination domain for hotel pages 

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24.php?p=".$partner."&r=".$region."&pv=".$province."&cur=".$defcur."&loc=".urlencode($search);
$thelink .= "&sorts=".$sorting."&promo=".$promote."&stars=".$ratings."&domain=".urlencode($target)."&caller=".$thispage; 
echo file_get_contents ($thelink);

?>
</div>

						

目标属性能够使机构使用默认设置的白标系统(评论通过#)去指定以上 Sawadee 的目标(对回头客的保护), 或者指定机构自己的网页文件/手稿,如果其他酒店模版使用自定义酒店页面)。

附加功能如显示酒店标志,主要图片和酒店特点也是 可用的

酒店清单 PHP 集成
Java描述语言(JavaScript)集成

在 JavaScript 版本中,廉署机构可以设置一个默认区域,地点和汇率。显示清单将会显示标准酒店页面。

请从以下链接看 JavaScript 的来源码例子


<div id="MYDIVID"></div>

<script type="text/javascript" src="http://www.R24db.com/xml/xmlR24.js"></script>
<script type="text/javascript">
 xmlR24.R24modList("MYDIVID", "agency.domain"); 
</script>

						
Java描述语言(JavaScript)集成
内嵌框架 iframe 的集成

在iframe的版本,酒店清单将会显示在一个框里。此版本仅推荐于已有框架结构的网页使用。

请从以下 链接看 iframes 使用例子


<iframe name="R24" src="http://AGENCY.DOMAIN.r24.asia/huahin/" marginwidth="1" 
marginheight="1" width="800" frameborder="0" height="600">
< !-- for non-frame browsers -->
<a target="_blank" href="http://AGENCY.DOMAIN.r24.asia/huahin/">http://www.R24DB.com/AGENCY.DOMAIN/huahin/</a>
</iframe>
内嵌框架 iframe 的集成
前一版本集成 *:

怎样链接集成预定系统PHP版本,例如 : Demo PHP
怎样链接集成预定系统iframe版本,例如 : Demo iframes

(* 限制支持,不要运用新的账户,请将现存账户升级)
酒店地址搜索箱的模版集成
为了提供轻松的用户体验,R24已经开发了自动搜索箱,能够直接集成到您的网页。标准版本和全搜索箱功能是有效的。

本系统为您的客户提供按酒店名字搜索的选项和按目的地搜索的选项,所有相关的信息都会从R24的数据库中得到。 搜索结果会按照简明的两列式表格列出,顾客们可以轻松的浏览和选择相应标准的酒店页面。

此优点是给顾客带来更好的搜索体验,当搜索特定酒店和酒店集团以及边缘化的目的地。
简约版本
PHP 集成

简单版本,顾客只可以进入酒店名称和地点

请按以下链接看使用简洁搜索箱的样子。

					
<head>
<title>Search Hotel by hotel name or location</title>
<meta content="en-us" http-equiv="Content-Language">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style type="text/css">
.r24findhotel {width:192px; margin:auto; padding:4px; font:normal 11px Arial; color:#06C; background: url('http://www.R24DB.com/xml/extrafunction/imgextra/bg-spnsearchbox.gif') no-repeat;}
.r24findhotel .head {color:white; font-size:16px; font-weight:bold; text-align:center;}
.r24findhotel .searchbutton {margin-top:5px; text-align:center;}
</style>

<?php
$partner = "AGENCY.DOMAIN"; //replace it by your R24-registered domain name. Required.
$cur = "THB"; // replace it by currency what you need.
$url = "http://www.R24DB.com/xml/extrafunction/R24findresult.php?p=$partner&cur=$cur";

?>

</head>

<body>
<div class="r24findhotel">
<div class="head">Find Hotel</div><br>

<div style="padding:5px; width:180px">
<form name="findhotelform" id="findhotelform" method="post" style="margin:0" action="<? echo $url ?>">

<strong>Search by hotel name / location :</strong>
<input id="searchname" name="loc" type="text" style="width:175px">
<div class="searchbutton">
<input id="searchhotel" name="checkav" type="image" src="images/button-search1.gif" title="Search for hotel name or location" style="height:30px; width:85px">
</div>

</form>
</div>
</div>
</body>

					
简约版本
搜索箱
PHP 集成

此版本允许更多的目标搜索结合了地点,位置(旅游景点/标志性建筑)或者酒店名字。所住时间,客人的数目已经在预定网页储存了。

请跟以下链接看简洁搜索箱的例子。


<head>
<title>Hotel Search Box</title>
<meta content="en-us" http-equiv="Content-Language">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style type="text/css">
.r24searchbox {width:184px; height:320px; line-height:16px; margin:auto; padding:8px; font-family:Arial; font-size:11px; background: url('images/bg-spsearchbox.jpg') no-repeat;}
.r24searchbox select {border:1px solid #CCC; font-size:11px;}
.r24searchbox .fieldname {color:#0066CC; padding-top:5px; font-weight:bold;}
.r24searchbox .head {color:white; font-size:16px; font-weight:bold; text-align:center;}
.r24searchbox .searchbutton {margin-top:5px; text-align:center;}
</style>


<?php
$partner = "AGENCY.DOMAIN";
$cur = "THB"; // replace it by currency what you need.
$url = "http://www.R24DB.com/xml/extrafunction/R24hotellistfromsearchbox.php?p=$partner";
$today  = getdate();
$monnam = array ("Jan.","Feb.","Mar.","Apr.","May", "Jun.","Jul.","Aug.","Sep.","Oct.","Nov.", "Dec.");
function date2stay ($d,$m,$y) { if (!$y) list($y,$m) = explode(",",$m); return sprintf("%4s-%'02s-%'02s",$y,$m,$d);	}	
$stay = $_REQUEST['date11'] ? date2stay($_REQUEST['date11'],$_REQUEST['date12'],"") ."/". date2stay($_REQUEST['date21'],$_REQUEST['date22'],"") : "";
if ($stay)
{	$stay0 = strtr(trim($stay),"/*","~~"); list($d1, $d2) = explode("~", $stay0);
	$today1 = getdate(strtotime($d1)); $today2 = getdate(strtotime($d2));
$stay = date("Y-m-d",strtotime($d1))."~".date("Y-m-d",strtotime($d2)); } if (!$stay || $today[0] >= $today1[0]) { $today1 = getdate(strtotime("+1 days")); $today2 = getdate(strtotime("+2 days")); $stay = date("Y-m-d",strtotime("+1 days"))."~".date("Y-m-d",strtotime("+2 days")); } function list_provinces () { global $partner; $opt = $o = 0; $col = array('#FFDDFF','#FFFFDD','#DDFFDD','#FFDDDD','#DDFFFF','#FFFFFF'); $url = "http://th.r24.org/xmlR24db.php?p=$partner&db=province&s=group"; $xml = @simplexml_load_file($url) or die("Sorry, can't open this: ".$url); foreach ($xml->province as $province) { $sel = ""; if (trim($province->reggroup) <> $opt && $opt) echo "</optgroup>\n"; if (trim($province->reggroup) <> $opt) { echo "<optgroup label=\"$province->reglabel\" style=\"background-color: $col[$o]\">\n"; $opt = $province->reggroup; $o++; } $selstyle = ($province->hotelcount == 0) ? " style=\"color:#c0c0c0;\" " : ""; echo "<option value=\"$province->province_id\" $sel $selstyle> $province->province_en </option>\n"; } /* foreach */ if ($opt) echo "</optgroup>\n"; } ?> </head> <body> <div class="r24searchbox"> <div class="head">Find Hotel</div><br> <div style="padding:5px; width:180px"> <form name="findhotelform" id="findhotelform" method="post" style="margin:0;" action="<?php echo $url?>" onsubmit="return checkdates(this)"> <span class="fieldname">** Destinations :</span><br> <select id="destination" name="pv" style="width:175px"> <option value="">- select city or region -</option> <optgroup label="Popular regions" style="background-color:#DDFFFF"> <option value="73" style="background-color:#DDFFFF">Phuket</option> <option value="64" style="background-color:#DDFFFF">Krabi</option> <option value="63a" style="background-color:#DDFFFF">Koh Samui</option> <option value="14a" style="background-color:#DDFFFF">Pattaya</option> <option value="59a" style="background-color:#DDFFFF">Hua Hin</option> </optgroup> <?php list_provinces("") ?> </select> <div class="fieldname">Search by hotel / location :</div> <input id="searchname" name="loc" type="text" style="width:175px"> <div class="fieldname">Check-in Date</div> <select name="date11" id="date11" size="1" style="width:40px"> <?php for ($i = 1; $i <= 31; $i++) { $sel = $today1["mday"]==$i ? "selected":""; echo "<option value=\"$i\" $sel>$i</option>\n"; } ?> </select> <select name="date12" id="date12" size="1" style="width:102px"> <?php $mm = $today["mon"]; $yy = $today["year"]; if ($yy < 100) $yy + 2000; for ($i=0; $i<12; $i++,$mm++) { if ($mm > 12) {$mm=1;$yy++; echo "<option value=\"$yy,$mm\" disabled>=========</option>\n";} $sel = ($today1["mon"]==$mm && $today1["year"]==$yy) ? "selected":""; echo "<option value=\"$yy,$mm\" $sel>".$monnam[$mm-1]." $yy</option>\n"; } ?> </select> <div class="fieldname">Check-out Date</div> <select name="date21" id="date21" size="1" style="width:40px"> <?php for ($i = 1; $i <= 31; $i++) { $sel = $today2["mday"]==$i ? "selected":""; echo "<option value=\"$i\" $sel>$i</option>\n"; } ?> </select> <select name="date22" id="date22" size="1" style="width:101px"> <?php $mm = $today["mon"]; $yy = $today["year"]; if ($yy < 100) $yy + 2000; for ($i=0; $i<12; $i++,$mm++) { if ($mm > 12) {$mm=1;$yy++; echo "<option value=\"$yy,$mm\" disabled>=========</option>\n";} $sel = ($today2["mon"]==$mm && $today2["year"]==$yy) ? "selected":""; echo "<option value=\"$yy,$mm\" $sel>".$monnam[$mm-1]." $yy</option>\n"; } ?> </select><br> <div style="float:left;"> <div class="fieldname">Stay : <span id="dayid"></span></div> <input name="days" id="days" type="text" style="width:30px" value="1"> nights </div> <div style="float:right"> <div class="fieldname">adult / child :</div> <input name="person" id="person" type="text" style="width:30px" value="2"> <input name="person2" id="person2" type="text" style="width:30px" value="0"> </div> <div style="clear:both"></div> <div class="searchbutton"> <input id="searchhotel" name="checkav" type="image" src="images/button-search1.gif" title="Search Hotel" style="height:30px; width:85px"> <input id="period" name="stay" type="hidden" value=""> </div> </form> </div> </div> <script type="text/javascript"> // period set to &stay=2011-02-22/2011-02-26 function checkdates(f) { var jsCal = new Object(); jsCal.startDate = [0,0,0,null]; jsCal.endDate = [0,0,0,null]; var d = new Date(); var pp; var d = f.date11.selectedIndex; jsCal.startDate[0] = +f.date11.options[d].value; d = f.date12.selectedIndex; pp = f.date12.options[d].value.split(','); jsCal.startDate[1] = +pp[1]; jsCal.startDate[2] = +pp[0]; d = f.date21.selectedIndex; jsCal.endDate[0] = +f.date21.options[d].value; d = f.date22.selectedIndex; pp = f.date22.options[d].value.split(','); jsCal.endDate[1] = +pp[1]; jsCal.endDate[2] = +pp[0]; var d1= new Date(jsCal.startDate[2], jsCal.startDate[1]-1, jsCal.startDate[0], 23, 00, 00); var d2= new Date(jsCal.endDate[2], jsCal.endDate[1]-1, jsCal.endDate[0], 23, 00, 00); var d0= new Date(); if ((d1.getMonth()+1 != jsCal.startDate[1])||(d1.getDate()!= jsCal.startDate[0])||(d1.getFullYear() != jsCal.startDate[2])) d = -1; else if ((d2.getMonth()+1 != jsCal.endDate[1])||(d2.getDate()!= jsCal.endDate[0])||(d2.getFullYear() != jsCal.endDate[2])) d = -1; else d = (d2 - d1) / 86400000; var sd = 0; if (d1 > d2) sd = 1; if (d1 < d0) d = -1; var p = document.getElementById('dayid'); if (d> 1) p.innerHTML = "<span style=\"color:#F60\">[" + d + " nights]</span>"; if (d==1) p.innerHTML = "<span style=\"color:#F60\">[" + d + " night.]</span>"; if (d< 0 && sd==0) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; if (d1 < d0) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; if (d<1 && sd==1) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; // CHECK var p = document.getElementById('days'); if (d>0 || d==0) { p.value = d; checkDate = true; } else { checkDate = false; } return checkDate; } </script> </body>
搜索箱
模块集成和预设模版

最简单方便的方法去创建您自己的网页。步骤集成非常简单明了,能简易转换到我们的系统。

请点此 链接查看样本模版。


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>R24.org Sample template</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<style type="text/css">
body {font-family:Arial; font-size:12px;}

.template1 {width:970px; margin:0;}
.template1 p {background-color:#26527C; padding:30px; margin:0; text-align:center; color:white; font-size:16px;}

.template1 ul.menutop {background-color:#26527C; color:white; padding:0; margin:0; font-weight:bold; height:25px;}
.template1 ul.menutop li {background-color:#0099FF; list-style:none; float:left; padding:5px; margin-left:1px; width:150px; text-align:center;}
.template1 ul.menutop a {color:white; text-decoration:none;}
.template1 ul.menutop a:hover {color:red;}
.template1 ul.menutop li:hover {background-color:#8CECFD;}

.template1 .r24searchbox {width:200px; height:320px; line-height:16px; margin:auto; padding:8px; font-family:Arial; font-size:11px; background: url('images/bg-spsearchbox.jpg') no-repeat;}
.template1 .r24searchbox select {border:1px solid #CCC; font-size:11px;}
.template1 .r24searchbox .fieldname {color:#0066CC; padding-top:5px; font-weight:bold;}
.template1 .r24searchbox .head {color:white; font-size:16px; font-weight:bold; text-align:center;}
.template1 .r24searchbox .searchbutton {margin-top:5px; text-align:center;}

.template1 .r24hotellist1 {width:760px; margin:0 auto; font-family:Arial, Helvetica, sans-serif;}
.template1 .r24hotellist1 .hotellisting {height:350px; border:1px #C0C0C0 solid; overflow:scroll;} /* change to hidden to remove scrollbars */
.template1 .r24hotellist1 .hotelimg {border:1px #C0C0C0 solid; padding:3px; margin-right:10px; float:left;}
.template1 .r24hotellist1 ul {margin:0; padding:0; }
.template1 .r24hotellist1 li {list-style:none; margin:0 5px; padding:10px 0; width:360px; float:left; border-bottom:1px #C0C0C0 dotted;}
.template1 .r24hotellist1 .hotelname, .template1 .r24hotellist1 .hotelname:visited {color:blue; font-weight:bold; text-decoration:none; font-size:11px;}
.template1 .r24hotellist1 .hotelname:hover {color:red; text-decoration:underline;}
.template1 .r24hotellist1 a.linkdetail, .template1 .r24hotellist1 a.recommend {color:white; font-weight:bold; padding:3px 5px; text-decoration:none; font-size:11px;}
.template1 .r24hotellist1 a.linkdetail {background-color:#0099FF;}
.template1 .r24hotellist1 a.linkdetail:hover {background-color:gray;}
.template1 .r24hotellist1 .recommend {color:red; font-style:italic; font-size:14px;}
</style>
</head>

<!----- Start Search box area ----->
<?php
$today  = getdate();
$monnam = array ("Jan.","Feb.","Mar.","Apr.","May", "Jun.","Jul.","Aug.","Sep.","Oct.","Nov.", "Dec.");
function date2stay ($d,$m,$y) { if (!$y) list($y,$m) = explode(",",$m); return sprintf("%4s-%'02s-%'02s",$y,$m,$d);	}	
$stay = $_REQUEST['date11'] ? date2stay($_REQUEST['date11'],$_REQUEST['date12'],"") ."/". date2stay($_REQUEST['date21'],$_REQUEST['date22'],"") : "";
if ($stay)
{	$stay0 = strtr(trim($stay),"/*","~~"); list($d1, $d2) = explode("~", $stay0);
	$today1 = getdate(strtotime($d1)); $today2 = getdate(strtotime($d2));
$stay = date("Y-m-d",strtotime($d1))."~".date("Y-m-d",strtotime($d2)); } if (!$stay || $today[0] >= $today1[0]) { $today1 = getdate(strtotime("+1 days")); $today2 = getdate(strtotime("+2 days")); $stay = date("Y-m-d",strtotime("+1 days"))."~".date("Y-m-d",strtotime("+2 days")); } function list_provinces () { global $partner; $opt = $o = 0; $col = array('#FFDDFF','#FFFFDD','#DDFFDD','#FFDDDD','#DDFFFF','#FFFFFF'); $url = "http://th.r24.org/xmlR24db.php?p=$partner&db=province&s=group"; $xml = @simplexml_load_file($url) or die("Sorry, can't open this: ".$url); foreach ($xml->province as $province) { $sel = ""; if (trim($province->reggroup) <> $opt && $opt) echo "</optgroup>\n"; if (trim($province->reggroup) <> $opt) { echo "<optgroup label=\"$province->reglabel\" style=\"background-color: $col[$o]\">\n"; $opt = $province->reggroup; $o++; } $selstyle = ($province->hotelcount == 0) ? " style=\"color:#c0c0c0;\" " : ""; echo "<option value=\"$province->province_id\" $sel $selstyle> $province->province_en </option>\n"; } /* foreach */ if ($opt) echo "</optgroup>\n"; } $partner = $_REQUEST['p'] ? $_REQUEST['p'] : "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required. $defcur = $_REQUEST['cur'] ? $_REQUEST['cur'] : "THB"; # optional. To set a DEFAULT currency. $region = $_REQUEST['r'] ? $_REQUEST['r'] : "huahin"; # replace "huahin" by whatever region you want to call initially. $province = $_REQUEST['pv']; # optional. Use province code instead of province (alternative to 'province' parameter). $location = $_REQUEST['loc']; # optional. Use the hotel location description. Example: $location = "silom" $promote = $_REQUEST['promote']; # optional. To filter by recommended and promoted hotels $_REQUEST['promote'] $promote = "1"; $sorting = "name"; # optional. To set a DEFAULT sorting &s=[-]region,name,location,rate,hno. Example: $sorting = "location,-rate" (default) # &s=[-]region,name,location,rate,hno # sort result by one or more of the options above # [-] is descending, otherwise ascending. $lg = "en"; # optional. To set a DEFAULT language. en,th,de $adult = $_REQUEST['person'] ? $_REQUEST['person'] : 2; $child = $_REQUEST['person2'] ? $_REQUEST['person2'] : 0; $url = "http://www.R24DB.com/xml/extrafunction/R24hotellistfromsearchbox.php?p=$partner&cur=$defcur"; $url3 = "http://th.R24.org/xmlR24.php?p=".$partner."&r=".$region."&c=".$defcur."&v=".$province."&kl=".$location."&s=".$sorting."&d=".$stay; $xml3 = @simplexml_load_file($url3) or die("Sorry, can't open this: ".$url3); ?> <body> <div class="template1"> <!----- Start header page area -----> <p style="padding:30px">YOUR HEADER</p> <ul class="menutop"> <li><a href="#">Home</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=bangkok">Bangkok Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=phuket">Phuket Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=samui">Samui Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=pattaya">Pattaya Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=chiangmai">Chiang mai Hotels</a></li> </ul> <!----- End header page area -----> <div style="margin-top:20px"></div> <div style="float:left; width:200px"> <div class="r24searchbox"> <div class="head">Find Hotel</div><br> <div style="padding:5px; width:180px"> <form name="findhotelform" id="findhotelform" method="post" style="margin:0;" action="<?php echo $url?>" onsubmit="return checkdates(this)"> <span class="fieldname">** Destinations :</span><br> <select id="destination" name="pv" style="width:175px"> <option value="">- select city or region -</option> <optgroup label="Popular regions" style="background-color:#DDFFFF"> <option value="73" style="background-color:#DDFFFF">Phuket</option> <option value="64" style="background-color:#DDFFFF">Krabi</option> <option value="63a" style="background-color:#DDFFFF">Koh Samui</option> <option value="14a" style="background-color:#DDFFFF">Pattaya</option> <option value="59a" style="background-color:#DDFFFF">Hua Hin</option> </optgroup> <?php list_provinces("") ?> </select> <div class="fieldname">Search by hotel / location :</div> <input id="searchname" name="loc" type="text" style="width:175px"> <div class="fieldname">Check-in Date</div> <select name="date11" id="date11" size="1" style="width:40px"> <?php for ($i = 1; $i <= 31; $i++) { $sel = $today1["mday"]==$i ? "selected":""; echo "<option value=\"$i\" $sel>$i</option>\n"; } ?> </select> <select name="date12" id="date12" size="1" style="width:102px"> <?php $mm = $today["mon"]; $yy = $today["year"]; if ($yy < 100) $yy + 2000; for ($i=0; $i<12; $i++,$mm++) { if ($mm > 12) {$mm=1;$yy++; echo "<option value=\"$yy,$mm\" disabled>=========</option>\n";} $sel = ($today1["mon"]==$mm && $today1["year"]==$yy) ? "selected":""; echo "<option value=\"$yy,$mm\" $sel>".$monnam[$mm-1]." $yy</option>\n"; } ?> </select> <div class="fieldname">Check-out Date</div> <select name="date21" id="date21" size="1" style="width:40px"> <?php for ($i = 1; $i <= 31; $i++) { $sel = $today2["mday"]==$i ? "selected":""; echo "<option value=\"$i\" $sel>$i</option>\n"; } ?> </select> <select name="date22" id="date22" size="1" style="width:101px"> <?php $mm = $today["mon"]; $yy = $today["year"]; if ($yy < 100) $yy + 2000; for ($i=0; $i<12; $i++,$mm++) { if ($mm > 12) {$mm=1;$yy++; echo "<option value=\"$yy,$mm\" disabled>=========</option>\n";} $sel = ($today2["mon"]==$mm && $today2["year"]==$yy) ? "selected":""; echo "<option value=\"$yy,$mm\" $sel>".$monnam[$mm-1]." $yy</option>\n"; } ?> </select><br> <div style="float:left;"> <div class="fieldname">Stay : <span id="dayid"></span></div> <input name="days" id="days" type="text" style="width:30px" value="1"> nights </div> <div style="float:right"> <div class="fieldname">adult / child :</div> <input name="person" id="person" type="text" style="width:30px" value="2"> <input name="person2" id="person2" type="text" style="width:30px" value="0"> </div> <div style="clear:both"></div> <div class="searchbutton"> <input id="searchhotel" name="checkav" type="image" src="images/button-search1.gif" title="Search Hotel" style="height:30px; width:85px"> <input id="period" name="stay" type="hidden" value=""> </div> </form> </div> </div> <script type="text/javascript"> // period set to &stay=2011-02-22/2011-02-26 function checkdates(f) { var jsCal = new Object(); jsCal.startDate = [0,0,0,null]; jsCal.endDate = [0,0,0,null]; var d = new Date(); var pp; var d = f.date11.selectedIndex; jsCal.startDate[0] = +f.date11.options[d].value; d = f.date12.selectedIndex; pp = f.date12.options[d].value.split(','); jsCal.startDate[1] = +pp[1]; jsCal.startDate[2] = +pp[0]; d = f.date21.selectedIndex; jsCal.endDate[0] = +f.date21.options[d].value; d = f.date22.selectedIndex; pp = f.date22.options[d].value.split(','); jsCal.endDate[1] = +pp[1]; jsCal.endDate[2] = +pp[0]; var d1= new Date(jsCal.startDate[2], jsCal.startDate[1]-1, jsCal.startDate[0], 23, 00, 00); var d2= new Date(jsCal.endDate[2], jsCal.endDate[1]-1, jsCal.endDate[0], 23, 00, 00); var d0= new Date(); if ((d1.getMonth()+1 != jsCal.startDate[1])||(d1.getDate()!= jsCal.startDate[0])||(d1.getFullYear() != jsCal.startDate[2])) d = -1; else if ((d2.getMonth()+1 != jsCal.endDate[1])||(d2.getDate()!= jsCal.endDate[0])||(d2.getFullYear() != jsCal.endDate[2])) d = -1; else d = (d2 - d1) / 86400000; var sd = 0; if (d1 > d2) sd = 1; if (d1 < d0) d = -1; var p = document.getElementById('dayid'); if (d> 1) p.innerHTML = "<span style=\"color:#F60\">[" + d + " nights]</span>"; if (d==1) p.innerHTML = "<span style=\"color:#F60\">[" + d + " night.]</span>"; if (d< 0 && sd==0) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; if (d1 < d0) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; if (d<1 && sd==1) p.innerHTML = "<span style=\"color:#F60\">[error date]</span>"; // CHECK var p = document.getElementById('days'); if (d>0 || d==0) { p.value = d; checkDate = true; } else { checkDate = false; } return checkDate; } </script> <!----- End Search box area -----> <!----- Start Promotion area -----> <img alt="" src="imgpromote/<?= $region; ?>promotion.jpg"> <!----- End Promotion area -----> </div> <div style="margin-left:210px"> <!----- Start Hotel Listing area -----> <div class="r24hotellist1"> <div id="modhotellist1navi" class="hotellisting"> <ul> <?php foreach ($xml3->hotel as $hotel) { # loop for display hotel list if ($promote == "1") { if ($hotel->promote == '') continue; } # check for hotel which have promotion $attr = $hotel['hno']; ?> <li><img alt="" class="hotelimg " height="90" src="http://th.r24.org/R24pic.php?i=icon&x=150&y=100&h=<?php echo $attr;?>" width="120"> <div style="height:78px"> <a href="<?php echo $hotel->hotellink2; ?>&lg=<?php echo $lg; ?>&stay=<?php echo $stay;?>&cur=<?php echo $defcur;?>&adult=<?php echo $adult;?>&child=<?php echo $child;?>" class="hotelname"><?= $hotel->hotelname; ?> </a><br><span style="font-size:10px"><strong>Location : </strong><?= $hotel->location; ?><br> <strong>Destination : </strong><?php echo ucfirst($hotel->region); ?> <br><strong>Rates From : </strong><span style="color:red"><?php echo $hotel->minrate." ".$hotel->minrate['cur']; ?></span><br> <strong>Breakfast : </strong><?php echo ($hotel->breakfast == "incl") ? "YES" : "NO"; ?> </span></div> <a href="<?php echo $hotel->hotellink2; ?>&lg=<?php echo $lg; ?>&stay=<?php echo $stay;?>&cur=<?php echo $defcur;?>&adult=<?php echo $adult;?>&child=<?php echo $child;?>" class="linkdetail">Book Now</a> <a href="http://www.R24DB.com/xml/extrafunction/R24reviews.php?h=<?php echo $attr;?>&p=<?php echo $partner;?>" class="linkdetail">Reviews</a> <?php if ($hotel->promote != '') { ?> <span class="recommend"><?php echo ($hotel->promote == "recommend") ? "Recommended" : ""; ?></span> <?php } ?> </li> <?php } /* foreach */ ?> </ul> </div> <div> <input name="pgfirst" id="pgfirst" type="button" value="first page"> <input name="pgprev" id="pgprev" type="button" value="prev. page"> <input name="pgnext" id="pgnext" type="button" value="next page" style=" font-weight:bold"> <input name="pglast" id="pglast" type="button" value="last page"></div> </div> <br> <script type="text/javascript"> var mod_objid; function onload_R24hotellist1navi(objid) { var p; mod_objid = document.getElementById(objid); if (p = document.getElementById('pgfirst')) p.onclick=function(){ mod_objid.scrollTop = 0; return false } if (p = document.getElementById('pgprev')) p.onclick=function(){ mod_objid.scrollTop -= 500; return false } if (p = document.getElementById('pgnext')) p.onclick=function(){ mod_objid.scrollTop += 500; return false } if (p = document.getElementById('pglast')) p.onclick=function(){ mod_objid.scrollTop = mod_objid.scrollHeight; return false } } onload_R24hotellist1navi('modhotellist1navi'); </script> <!----- End Hotel list area -----> <!----- Start Hotel Advertising Area -----> <iframe id="R24frame" name="R24frame" src="http://www.r24db.com/xml/R24dbroller.php?r=<?php echo $region; ?>&p=<?php echo $partner; ?>" frameborder="0" style="border:0; margin:0; height:145px; width:760px"></iframe> <!----- End Hotel Advertising Area -----> </div> <div style="clear:both"></div> <!----- Start footer page area -----> <ul class="menutop" style="margin-top:20px"> <li><a href="#">Home</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=krabi">Krabi Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=kohphangan">Kohphangan Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=kohtao">Kohtao Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=kohchang">Kohchang Hotels</a></li> <li><a href="sample-template2-1.php?p=<?php echo $partner; ?>&r=kanchanaburi">Kanchanaburi Hotels</a></li> </ul> <p style="padding:20px">YOUR FOOTER</p> <!----- End footer page area -----> </div> </body> </html>
模块集成和预设模版
模版集成和自定义酒店网页
对于高级用户,酒店页面的内容作为单独的模版是可行的。

酒店的图片,信息,预订表格和旅行评价能被分开组合在一个现存的模版里。 此模版信息将重整并且自动化处理。在这里可以查看结合了很多模版的网页样本。
酒店概述模版
此模版显示酒店的主要图片,商标和排名概述。

PHP 模版源代码

请根据此链接查看 PHP 源代码样本


<?php # R24 hotel rate table
$partner = "AGENCY.DOMAIN";    # replace it by your R24-registered domain name. Required.
$hno = 620115;     # set specific hotel number (HNO).

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24modHead.php?p=".$partner."&h=".$hno."&lg=en&cur=".$defcur."&caller=".$thispage; 
echo file_get_contents ($thelink);
?>

					
PHP模版源代码
脚本模版源代码

请根据此 链接查看 Java 脚本的源代码样本


<div id="MYDIVID"></div>


<script type="text/javascript" src="http://www.R24DB.com/xml/xmlR24.js"></script>
<script type="text/javascript">
       xmlR24.R24modHead("MYDIVID", "AGENCY.DOMAIN", 677120);     // 677120 = sample HNO
</script>

					
脚本模版源代码
酒店房间价格表模版
此模版显示特定酒店的客房价格

PHP 模版源代码

请根据此链接查看 PHP 源代码样本


<?php # R24 hotel rate table
$partner = "AGENCY.DOMAIN";    # replace it by your R24-registered domain name. Required.
$hno = 620115;     # set specific hotel number (HNO).
$defcur = "EUR";    # set a default currency (optional)

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24modRate.php?p=".$partner."&h=".$hno."&lg=en&cur=".$defcur."&caller=".$thispage; 
echo file_get_contents ($thelink);
?>

						
PHP 模版源代码
Java脚本模版源代码

请根据此链接查看 Java 脚本的源代码样本


<div id="MYDIVID"></div>


<script type="text/javascript" src="http://www.R24DB.com/xml/xmlR24.js"></script>
<script type="text/javascript">
        xml1 = xmlR24.R24modRate("MYDIVID", "AGENCY.DOMAIN", 677122, 'USD'); // 677122 = sample HNO for US$
</script>

						
Java 脚本模版源代码
酒店图片信息模版
此模版显示酒店信息,设施和地理位置

模版源代码

请根据此链接查看 PHP 源代码样本


<?php # R24 hotel pictures and details 
$partner = "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required.
$hno = 620115; # set specific hotel number (HNO).

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24modDetail.php?p=".$partner."&h=".$hno."&lg=en&caller=".$thispage; echo file_get_contents ($thelink);
?>

					

附加功能如酒店图标显示,主要图片和特点也是可用的

酒店图片信息模版
Java 脚本模版源代码

请根据此链接查看 Java 脚本的源代码样本


<div id="MYDIVID"></div>


<script type="text/javascript" src="http://www.R24DB.com/xml/xmlR24.js"></script>
<script type="text/javascript">
       xmlR24.R24modDetail("MYDIVID", "AGENCY.DOMAIN", 620115);     // 620115 = sample HNO
</script>

					
Java 脚本模版源代码
酒店预定表格模版
此模版显示指定的酒店预定表格

PHP 模版源代码

请根据此 链接查看 PHP 源代码样本


<?php # R24 hotel booking form
$partner = "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required.
$hno = 620115; # set specific hotel number (HNO).

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24modBook.php?p=".$partner."&h=".$hno."&lg=en&caller=".$thispage; 
echo file_get_contents ($thelink);
?>

						
PHP 模版源代码
Java 脚本模版源代码

请根据此 链接查看 Java 脚本的源代码样本


<div id="MYDIVID"></div>


<script type="text/javascript" src="http://www.R24DB.com/xml/xmlR24.js"></script>
<script type="text/javascript">
       xmlR24.R24modBook("MYDIVID", "AGENCY.DOMAIN", 677122);     // 677122 = sample HNO
</script>

						
Java 脚本模版源代码
酒店旅行评价模版
此模版显示选定酒店的顾客评价信息

PHP 模版源代码

请根据此 链接查看 PHP 源代码样本


<?php # R24 hotel travel reviews
$partner = "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required.
$hno = 620115; # set specific hotel number (HNO).

# don't change remaining code below this line
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24'];
$thelink = "http://www.R24DB.com/R24a/R24modReview.php?p=".$partner."&h=".$hno."&lg=en&caller=".$thispage; 
echo file_get_contents ($thelink);
?>

						
PHP 模版源代码
Java 脚本模版源代码

请根据此 链接查看 Java 脚本的源代码样本


<div id="MYDIVID"></div>


<script type="text/javascript" src="http://www.R24DB.com/xml/xmlR24.js"></script>
<script type="text/javascript">
       xmlR24.R24modReview("MYDIVID", "AGENCY.DOMAIN", 677120);     // 677120 = sample HNO
</script>

						
Java 脚本模版源代码
点此 链接样本可以看到很多模版的集合