Module Integration
The module integration enables you to create your own page layout, giving more flexibility to the hotel page, as every element is a distinct module. It is divided into two major categories. Using either the Standard hotel page or the Customized hotel page.
In the standard hotel pages using PHP, Simple Javascript or iframe, the hotel listing per destination can easily be integrated in your existing webpage. The landing page is R24’s standard hotel page.

The search boxes are a very convenient way to add a small, but efficient tool to any existing website and the result displays all options available.

A combination of all modules has been integrated in a Preset template, allowing the easiest integration of R24’s booking engine into a new domain, for instance.
Module Integration with Standard Hotel Pages
The module integration can use PHP, iframe or simple JavaScript, the R24.org booking engine can easily be integrated to your existing webpage. The module will display a list of hotels in a given destination as well as standard hotel pages.
Integration of the R24.asia 2010 version:
Integration with PHP hotel listing recommended

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.

Integration in PHP module
Integration with JavaScript

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>



					
Integration in JavaScript module
Integration with iframe

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 in iframe module
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

(*limited support. Do not use for new accounts. Please upgrade existing account)
Module Integration with Hotel or Location Search Boxes
In order to provide an easier user experience R24.org has developed a choice of dynamic search boxes to be integrated directly into your page. A Standard and a Full Search box options are available.

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
Integration with PHP

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">
<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>
					
Location Search Box
Full Search Box
Integration with PHP

This 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('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>
Location Search Box
Module Integration with Preset Templates

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('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:13px;}
</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><?php echo $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="<?= $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>
Module integration for Hotel travel reviews with JavaScript
Module Integration with Customized Hotel pages
For advanced users, the content of the hotel pages is available as individual modules.

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.

Module with PHP source code

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);
?>

					
Module integration for Hotel summary with PHP
Module with JavaScript source code

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 integration for Hotel summary with PHP
Module for Hotel rate table
This module displays the hotel rate table for a specific hotel.

Module with PHP source code

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);
?>

					
Module integration for Hotel rate table with PHP
Module with JavaScript source code

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 integration for Hotel rate table with JavaScript
Module for Hotel pictures and details
This module displays the hotel information, facilities and location map.

Module with PHP source code

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.

Module integration for Hotel pictures & details with PHP
Module with JavaScript source code

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 integration for Hotel pictures & details with JavaScript
Module for Hotel booking form
This module displays the dynamic hotel booking form for a specific hotel.

Module with PHP source code

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);
?>

					
Module integration for Hotel booking form with PHP
Module with JavaScript source code

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 integration for Hotel booking form with JavaScript
Module for Hotel travel reviews
This module displays the hotel specific customer reviews.

Module with PHP source code

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);
?>


					
Module integration for Hotel travel reviews with PHP
Module with JavaScript source code

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>

					
Module integration for Hotel travel reviews with JavaScript
And here is an example of putting several modules together.