We recommend the PHP version which displays hotel per region, sorted by location, as default.
1. See this example with PHP source code with white-label
system.
2. Another example with PHP source code
with returning customer option.
(for details regarding 'return customer option' vs 'white label' see the
link integration page)
<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) # $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>
The $target attribute enables the agent to either use
the default white label system (comment out by #),
to specify the above Sawadee target (for return-customer
protection), or to specify the agent's own
website folder/script if other hotels modules are used customized hotel pages).
Additional functions for displaying hotel logo, main picture and featured hotels are available.
In the JavaScript version, affiliates can define default region, location, currency.
The displayed list will refer to the standard hotel pages.
Please follow the link
to see an example with JavaScript source code.
<div id="MYDIVID"></div>
<script type="text/javascript" src="http://www.R24db.com/xml/xmlR24.js"></script>
<script type="text/javascript">
// supported parameters: &r=region &pv=province &cur=currency
// &loc=searchterm &sorts=[n|l|r] &promo=[0|1] &stars=rating &lg=[en | de | ru | cn | th]
xmlR24.query = '&r=kohchang&cur=EUR&lg=de';
xmlR24.R24modList("MYDIVID", "agency.domain");
</script>
In the iframe version, the hotel list will display in a frame. It is only recommended for websites
which already have a frame structure in place.
Please follow the link
to see an example using 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>
Integration previous versions *:
Link how to integrate booking system of PHP version : e.a.
Demo PHP
Link how to integrate booking system of iframe version, e.a.
Demo iframes
Both options allow your customers to search by hotel name or destination name and the system will return all matches in the R24.org Database. The result listing is provided in a comprehensive 2 column overview from where your customer can easily browse to the chosen property’s standard hotel pages.
The advantage is a much more user friendly experience when looking for specific hotels or hotel chains as well as lesser known destinations. Compact Version
Simple version, where the customer only enters either a hotel name or a location.
Please follow the link
to see an example using the compact search box.
<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"> <link media="all" rel="stylesheet" type="text/css" href="r24extrafunction.css"> <?php $partner = "AGENCY.DOMAIN"; //replace it by your R24-registered domain name. Required. $cur = "THB"; // replace it by currency what you need. $url = "R24findresult.php?partner=$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="imgextra/button-search1.gif" title="Search for hotel name or location" style="height:30px; width:85px"> </div> </form> </div> </div> </body>
Full Search BoxThis version allows a much more targeted search combining destination,
location (attractions / landmarks) or hotel name. Optional dates of stay and numbers
of guests are already saved and passed on to the booking page.
Please follow the link
to see an example using the compact search box.
<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('http://www.R24DB.com/html/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 = "agent.domain";
$cur = "THB"; // replace it by currency what you need.
$url = "http://www.R24DB.com/xml/extrafunction/R24hotellistfromsearchbox.php?p=$partner";
$today = getdate();
$today1 = getdate(strtotime("+1 days"));
$today2 = getdate(strtotime("+2 days"));
$monnam = array ("Jan.","Feb.","Mar.","Apr.","May", "Jun.","Jul.","Aug.","Sep.","Oct.","Nov.", "Dec.");
if ($stay) {
list($d1, $d2) = explode("/", $stay);
if (strlen($d1)>=8) $today1 = getdate(strtotime($d1));
if (strlen($d2)>=8) $today2 = getdate(strtotime($d2));
if (strlen($d2) <4) $today2 = getdate(strtotime("+".$d2."days",$d1));
}
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 $yy = $today["year"]; if ($yy < 100) $yy + 2000;
for ($y = $yy; $y <= $yy+2; $y++)
for ($i = 1; $i <= 12; $i++) { if ($yy==$y && $i < $today["mon"]) continue;
$sel = ($today1["mon"]==$i && $yy==$y) ? "selected":"";
echo "<option value=\"$y,$i\" $sel>".$monnam[$i-1]." $y</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 $yy = $today["year"]; if ($yy < 100) $yy + 2000;
for ($y = $yy; $y <= $yy+2; $y++)
for ($i = 1; $i <= 12; $i++) { if ($yy==$y && $i < $today["mon"]) continue;
$sel = ($today2["mon"]==$i && $yy==$y) ? "selected":"";
echo "<option value=\"$y,$i\" $sel>".$monnam[$i-1]." $y</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="imgextra/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>
The most user-friendly and easy to implement option to create your own webpage.
The integration process is very straightforward and allows a very handy transition
to our system.
Please follow the link to see a sample template.
<!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('http://www.R24DB.com/html/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
$partner = $_REQUEST['p']? $_REQUEST['p'] : "agent.domain" ;
$url = "http://www.R24DB.com/xml/extrafunction/R24hotellistfromsearchbox.php?partner=$partner";
$today = getdate();
$today1 = getdate(strtotime("+1 days"));
$today2 = getdate(strtotime("+2 days"));
$monnam = array ("Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec.");
if ($stay) {
list($d1, $d2) = explode("/", $stay);
if (strlen($d1)>=8) $today1 = getdate(strtotime($d1));
if (strlen($d2)>=8) $today2 = getdate(strtotime($d2));
if (strlen($d2) <4) $today2 = getdate(strtotime("+".$d2."days",$d1));
}
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";
}
?>
<?php
$partner = $_REQUEST['p']?$_REQUEST['p'] : "agent.domain" ; # replace it by your R24-registered domain name. Required.
$region = $_REQUEST['r'] ? $_REQUEST['r'] :"huahin"; # replace "huahin" by whatever region you want to call initially.
$cur = $_REQUEST['cur'] ? $_REQUEST['cur'] :"THB"; # optional. To set a DEFAULT currency.
$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.
$url3 = "http://th.R24.org/xmlR24.php?p=".$partner."&r=".$region."&c=".$cur."&v=".$province."&kl=".$location."&s=".$sorting;
$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=<?= $partner; ?>&r=bangkok">Bangkok Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=phuket">Phuket Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=samui">Samui Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=pattaya">Pattaya Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $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 $yy = $today["year"]; if ($yy < 100) $yy + 2000;
for ($y = $yy; $y <= $yy+2; $y++)
for ($i = 1; $i <= 12; $i++) { if ($yy==$y && $i < $today["mon"]) continue;
$sel = ($today1["mon"]==$i && $yy==$y) ? "selected":"";
echo "<option value=\"$y,$i\" $sel>".$monnam[$i-1]." $y</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 $yy = $today["year"]; if ($yy < 100) $yy + 2000;
for ($y = $yy; $y <= $yy+2; $y++)
for ($i = 1; $i <= 12; $i++) { if ($yy==$y && $i < $today["mon"]) continue;
$sel = ($today2["mon"]==$i && $yy==$y) ? "selected":"";
echo "<option value=\"$y,$i\" $sel>".$monnam[$i-1]." $y</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="http://www.R24DB.com/html/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="http://www.r24db.com/html/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; ?>" class="hotelname"><?= $hotel->hotelname; ?>
</a><br><span style="font-size:10px"><strong>Location : </strong><?= $hotel->location; ?><br>
<strong>Destination : </strong><?= ucfirst($hotel->region); ?>
<br><strong>Rates From : </strong><span style="color:red"><?= $hotel->minrate." ".$hotel->minrate['cur']; ?></span> Tax incl.<br>
<strong>Breakfast : </strong><?= $hotel->breakfast; ?>
</span></div>
<a href="<?= $hotel->hotellink2; ?>" class="linkdetail">Book</a>
<a href="http://www.R24DB.com/xml/extrafunction/R24reviews.php?h=<?php echo $attr;?>&p=<?= $partner;?>" class="linkdetail">Reviews</a>
<?php if ($hotel->promote != '') { ?>
<span class="recommend"><?php echo $hotel->promote; ?></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=<?= $partner; ?>&r=krabi">Krabi Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=kohphangan">Kohphangan Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=kohtao">Kohtao Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=kohchang">Kohchang Hotels</a></li>
<li><a href="sample-template2-1.php?p=<?= $partner; ?>&r=kanchanaburi">Kanchanaburi Hotels</a></li>
</ul>
<p style="padding:20px">YOUR FOOTER</p>
<!----- End footer page area ----->
</div>
</body>
</html>
The hotel pictures and information, booking forms and travel reviews can be separately integrate into an existing template, which reforming full functionality and staying dynamic. A sample page of combining several modules together can be found here. Module for Hotel summary module
This module displays the hotel main picture, logo and rating summary.
Please follow the link to see an example with PHP source code.
<?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); ?>
Please follow the link to see an example with JavaScript source code.
<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>
Module for Hotel rate tableThis module displays the hotel rate table for a specific hotel.
Please follow the link to see an example with PHP source code.
<?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); ?>
Please follow the link to see an example with JavaScript source code.
<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>
Module for Hotel pictures and detailsThis module displays the hotel information, facilities and location map.
Please follow the link to see an example with PHP source code.
<?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); ?>
Additional functions for displaying hotel logo, main picture and featured hotels are available.
Please follow the link to see an example with JavaScript source code.
<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>
Module for Hotel booking formThis module displays the dynamic hotel booking form for a specific hotel.
Please follow the link to see an example with PHP source code.
<?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); ?>
Please follow the link to see an example with JavaScript source code.
<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>
Module for Hotel travel reviewsThis module displays the hotel specific customer reviews.
Please follow the link to see an example with PHP source code.
<?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); ?>
Please follow the link to see an example with JavaScript source code.
<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>