-
Notifications
You must be signed in to change notification settings - Fork 4
/
bookings_list.php
190 lines (176 loc) · 7.21 KB
/
bookings_list.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
session_start();
/**
* @package OTA Hotel Management
* @copyright e-Novate Pte Ltd 2012-2015
* @file bookings_list.php
* @brief bookings list webpage called by OTA Hotel Management
* see readme.txt for credits and references
* @addtogroup CODE_MANAGEMENT
* @{
* @addtogroup BOOKING_MANAGEMENT
* @{
*
*/
//error_reporting(E_ALL & ~E_NOTICE);
include_once(dirname(__FILE__)."/login_check.inc.php");
include_once(dirname(__FILE__)."/queryfunctions.php");
include_once(dirname(__FILE__)."/functions.php");
include_once(dirname(__FILE__)."/dailyfunc.php");
include_once(dirname(__FILE__)."/lang/lang_en.php");
$lang = get_language();
load_language($lang);
$logofile=Get_LogoFile();
access("booking"); //check if user is allowed to access this page
$lang = get_language();
$status = 2;
//$roomtype = '';
$roomid = '';
$name = '';
if (!empty($_POST['statusInd'])) {
$_POST['Submit']=$_POST['statusInd'];
}
if (!empty($_POST['Submit']) || !empty($_GET['action'])){
if(isset($_POST['Submit']))
$action=$_POST['Submit'];
else if(isset($_GET['action']))
$action = $_GET['action'];
switch ($action) {
case $_L['BTN_search']:
if($_POST['optFind'] == $_L['RGL_room']) {
$roomno = $_POST['search'];
$roomid = get_roomid($roomno);
//$status = '';
}
if($_POST['optFind'] == $_L['RGL_guest']) {
$name = $_POST['search'];
//$status = '';
}
if (isset($_POST['active'])) {
$status =$_POST['active'];
}
break;
}
}
$bookings = array();
get_bookinglist($bookings, $status, $name, $roomid);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/new.css" rel="stylesheet" type="text/css" />
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="js/dhtmlgoodies_calendar.css" media="screen"></link>
<script type="text/javascript" src="js/dhtmlgoodies_calendar.js"></script>
<script type="text/javascript" src="js/datefuncs.js"></script>
<title><?php echo $_L['MAIN_Title'];?></title>
<script language="JavaScript" src="js/highlight.js" type="text/javascript"></script>
<style>
.plainDropDown{
width:130px;
font-size:11px;
}
.plainDropDown2{
width:75px;
font-size:11px;
}
.plainSelectList{
width:250px;
font-size:11px;
}
.plainButton {
font-size:11px;
}
</style>
</head>
<body>
<form action="index.php?menu=listbooking" method="post" enctype="multipart/form-data">
<table class="listing-table" width="100%" border="0" cellpadding="1" align="center">
<tr valign="top" style="padding:5;">
<?php
if ($_GET['menu'] == "listbooking") {
print_rightMenu_home();
}?>
<td style="padding:10;" height="430">
<table width="100%" border="0" class="tdbgcl">
<tr><td align="center"> </td></tr>
<tr><td><h2><?php echo $_L['RGL_title']; ?></h2></td></tr>
<tr><td> </td></tr>
<tr><td>
<table width="100%" border="0" cellpadding="1">
<tr align="center"><td><?php echo $_L['PR_actions']; ?>
<input type='hidden' name='statusInd' id='statusInd' value=""/>
<select name="active" id="active" onchange="document.getElementById('statusInd').value='<?php echo $_L['BTN_search'];?>';document.forms[0].submit();">
<option value="0"><?php echo $_L['REG_lists'];?></option>
<option value="0"><?php echo $_L['BTN_listall'];?></option>
<option value="1" <?php if ($_POST['active']==1) {echo "selected";} ?>><?php echo $_L['REG_registered'];?></option>
<option value="2" <?php if ($_POST['active']==2) {echo "selected";} ?>><?php echo $_L['REG_checkedin'];?></option>
<option value="3" <?php if ($_POST['active']==3) {echo "selected";} ?>><?php echo $_L['REG_checkedout'];?></option>
<option value="4" <?php if ($_POST['active']==4) {echo "selected";} ?>><?php echo $_L['REG_billed'];?></option>
<option value="5" <?php if ($_POST['active']==5) {echo "selected";} ?>><?php echo $_L['REG_close'];?></option>
</select> <input type="submit" name="Submit" id="Submit" class="button" value="<?php echo $_L['BTN_search']; ?>"/><br/>
<label> <?php echo $_L['PR_criteria']; ?>:
<input type="radio" name="optFind" value="<?php echo $_L['RGL_guest']; ?>" <?php if ($_POST['optFind']==$_L['RGL_guest']) {echo "checked";} ?> /><?php echo $_L['RGL_guest']; ?></label>
<label><input type="radio" name="optFind" value="<?php echo $_L['RGL_room']; ?>" <?php if ($_POST['optFind']==$_L['RGL_room']) {echo "checked";}?> /> <?php echo $_L['RGL_room']; ?> </label>
<input type="text" name="search" id="search" width="100" <?php if (isset($_POST['search'])) { echo "value='".$_POST['search']."'";} ?>/><br>
</td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
</table>
</td></tr>
<tr>
<td>
<div class="scroll" id="Requests">
<table align="center">
<tr bgcolor="#3593de">
<th style='padding:3'colspan="2"><?php echo $_L['PR_actions']; ?></th>
<th><?php echo $_L['STS_title']; ?></th>
<th><?php echo $_L['RGL_room']; ?></th>
<th><?php echo $_L['RGL_guest']; ?></th>
<th><?php echo $_L['REG_checkin']; ?></th>
<th><?php echo $_L['REG_checkout']; ?></th>
<th><?php echo $_L['RGL_nights']; ?></th>
<th><?php echo $_L['RGL_adults']; ?></th>
<th><?php echo $_L['RGL_child']; ?></th>
</tr>
<?php
foreach ($bookings as $idx=>$val) {
//alternate row colour
$j++;
if($j%2==1){
echo "<tr id=\"row$j\" onmouseover=\"javascript:setColor('$j')\" onmouseout=\"javascript:origColor('$j')\" bgcolor=\"#CCCCCC\">";
}else{
echo "<tr id=\"row$j\" onmouseover=\"javascript:setColor('$j')\" onmouseout=\"javascript:origColor('$j')\" bgcolor=\"#E7E7E7\">";
}
echo "<td style='padding:3'><a href=\"index.php?menu=booking&id=".$bookings[$idx]['book_id']."\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" border=\"0\" title=\"". $_L['RGL_book']."\"/></a></td>";
echo "<td><a href=\"index.php?menu=invoice&id=".$bookings[$idx]['bill_id']."\" ><img src=\"images/button_signout.png\" width=\"16\" height=\"16\" border=\"0\" title=\"". $_L['RGL_bill']."\"/></a></td>";
echo "<td>" . get_book_status_text($bookings[$idx]['book_status']) . "</td>";
echo "<td>" . $bookings[$idx]['roomno'] . "</td>";
echo "<td>" . trim($bookings[$idx]['guestname']) . "</td>";
echo "<td>" . $bookings[$idx]['checkindate'] . "</td>";
echo "<td>" . $bookings[$idx]['checkoutdate'] . "</td>";
echo "<td>" . $bookings[$idx]['no_nights'] . "</td>";
echo "<td>" . $bookings[$idx]['no_adults'] . "</td>";
echo "<td>" . $bookings[$idx]['no_child'] . "</td>";
echo "</tr>"; //end of - data rows
} //end of while row
?>
</table>
</div>
</td>
</tr>
<tr bgcolor="#66CCCC" ><td align="left"><div id="RequestDetails"></div></td></tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
/**
* @}
* @}
*/
?>