-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.php
93 lines (84 loc) · 2.05 KB
/
demo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
include("LIB/lib.php");
#201201160211 #1631:sougata
if (isset($_POST['from']))
{
$arg = array(
'checkindate' => $_POST['from']
, 'checkoutdate' => $_POST['to']
, 'adult' => $_POST['adult']
, 'child' => $_POST['child']
, 'infant' => 0
, 'rooms' => 1
, 'limit' => 200
, 'offset' => 0
, 'hasResult' => 0
);
$_SESSION['searchPost'] = $_POST;
}else if(isset($_SESSION['searchPost']) && $_SESSION['searchPost']!='')
{
$arg = array(
'checkindate' => $_SESSION['searchPost']['from']
, 'checkoutdate' => $_SESSION['searchPost']['to']
, 'adult' => $_SESSION['searchPost']['adult']
, 'child' => $_SESSION['searchPost']['child']
, 'infant' => 0
, 'rooms' => 1
, 'limit' => 200
, 'offset' => 0
, 'hasResult' => 1
);
}else
{
//header('location:session-expire.php');
}
//$hapiObj = new HAPI();
$hapiObj = new HAPI(CH_KEY, CH_SEC);
$xmlDom = $hapiObj->getSearchResult($arg);
$hotels = $xmlDom->getElementsByTagName('hotel');
foreach ($hotels as $hotel)
{
$curCode = $hotel->getAttribute('currencycode');
?>
<div class="price-table">
<div class="search-tittle">
<span>
<?php
echo 'Search value:';
echo displayDate($arg['checkindate']).' to ';
echo displayDate($arg['checkoutdate']). ' With Adult:'.$arg['adult'].' Child:'.$arg['child'];
?>
</span>
<?php
echo '<strong>'
. $hotel->getAttribute('title')
. '</strong> [Min Rate: '
. displayPrice($hotel->getAttribute('minRate'),$curCode)
. ']';
?>
</div>
<div class="table-responsive">
<table>
<tr>
<td>
<?php
$rsS = getResponseStatus($hotel);
if($rsS['code'] == 1400)
{
include('sr-roomtype-display.php');
}else
{
echo $rsS['message'];
}
?>
</td>
</tr>
</table>
</div>
</div>
<?php
}
?>
<style>#ssb-container {
display: none !important;
}</style>