Issues (663)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

admin/martin.room.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
include_once __DIR__ . '/admin_header.php';
3
/*
4
 * 处理
5
 **/
6
7
//头部
8
include "martin.header.php";
9
$currentFile   = basename(__FILE__);
10
$myModuleAdmin = new ModuleAdmin();
11
echo $myModuleAdmin->addNavigation($currentFile);
12
13
//parameter 参数
14
$action    = isset($_POST['action']) ? $_POST['action'] : @$_GET['action'];
15
$action    = empty($action) ? 'list' : $action;
16
$action    = trim(strtolower($action));
17
$id        = !empty($_POST['id']) ? $_POST['id'] : @$_GET['id'];
18
$id        = (int)($id);
19
$room_id   = isset($_GET['room_id']) ? (int)($_GET['room_id']) : 0;
20
$room_date = isset($_GET['room_date']) ? trim($_GET['room_date']) : 0;
21
$hotel_id  = isset($_GET['hotel_id']) ? (int)($_GET['hotel_id']) : 0;
22
$typeid    = isset($_GET['typeid']) ? (int)($_GET['typeid']) : 0;
23
$start     = isset($_GET['start']) ? (int)($_GET['start']) : 0;
24
//确认删除
25
26
$confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0;
27
//parameter 参数
28
// martin_adminMenu(6, "订房后台 > 客房管理");
29
30
$room_handler         =& xoops_getmodulehandler('room', MARTIN_DIRNAME, true);
31
$hotelservice_handler =& xoops_getmodulehandler('hotelservice', MARTIN_DIRNAME, true);
32
33
//$HotelServiceObj = $hotelservice_handler->create();
34
$RoomObj = $id > 0 ? $room_handler->get($id) : $room_handler->create();
35
36
switch ($action) {
37
    case "add":
38
        include MARTIN_ROOT_PATH . 'include/form.room.php';
39
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ADD_ROOM, _AM_MARTIN_ADD_ROOM);
40
        CreateButton();
41
        $TypeList  = $room_handler->getRoomTypeList();
42
        $hotelList = $hotelservice_handler->getHotelList($hotel_id);
43
        $form      = new form_room($RoomObj, $hotelList, $TypeList);
44
        $form->display();
45
        martin_close_collapsable('createtable', 'createtableicon');
46
        break;
47
    case "typeadd":
48
        include MARTIN_ROOT_PATH . 'include/form.room.type.php';
49
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ADD_ROOM_CATEGORIES, _AM_MARTIN_ADD_ROOM_CATEGORIES);
50
        CreateButton();
51
        $roomType = array();
52
        if ($typeid > 0) {
53
            $roomType = $room_handler->getRoomTypeList($typeid);
54
            $roomType = array('room_type_id' => $typeid, 'room_type_info' => $roomType[$typeid]);
55
        }
56
        $form = new form_room_type($roomType);
57
        $form->display();
58
        martin_close_collapsable('createtable', 'createtableicon');
59
        break;
60
    case "addprice":
61
        include MARTIN_ROOT_PATH . 'include/form.room.price.php';
62
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ADDING_RATES, _AM_MARTIN_ADDING_RATES);
63
        CreateButton();
64
        $room_date = isset($_GET['room_date']) ? trim($_GET['room_date']) : null;
65
        $RoomPrice = ($room_id > 0 && $room_date) ? $room_handler->getRoomPrice($room_id, $room_date) : array();
0 ignored issues
show
Bug Best Practice introduced by
The expression $room_date of type string|null is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
66
        $RoomPrice = ($room_id > 0 && empty($RoomPrice)) ? $room_handler->getRoomPrice($room_id) : $RoomPrice;
67
        $RoomList  = $room_handler->getRoomList($room_id);
68
        //var_dump($RoomPrice);
69
        $form = new form_room_price($RoomPrice, $RoomList);
70
        $form->display();
71
        martin_close_collapsable('createtable', 'createtableicon');
72
        break;
73
    case "save":
74
        $RoomObj->setVar('room_id', $id);
75
        $RoomObj->setVar('room_type_id', (isset($_POST['room_type_id'])) ? (int)($_POST['room_type_id']) : 0);
76
        $RoomObj->setVar('hotel_id', (isset($_POST['hotel_id'])) ? (int)($_POST['hotel_id']) : 0);
77
        $RoomObj->setVar('room_count', (isset($_POST['room_count'])) ? (int)($_POST['room_count']) : 0);
78
        $RoomObj->setVar('room_bed_type', (isset($_POST['room_bed_type'])) ? (int)($_POST['room_bed_type']) : 0);
79
        $RoomObj->setVar('room_name', (isset($_POST['room_name'])) ? addslashes($_POST['room_name']) : '');
80
        $RoomObj->setVar('room_area', (isset($_POST['room_area'])) ? (int)($_POST['room_area']) : 0);
81
        $RoomObj->setVar('room_floor', (isset($_POST['room_floor'])) ? addslashes($_POST['room_floor']) : '');
82
        $RoomObj->setVar('room_initial_price', (isset($_POST['room_initial_price'])) ? round($_POST['room_initial_price'], 2) : 0);
83
        $RoomObj->setVar('room_is_add_bed', (isset($_POST['room_is_add_bed'])) ? (int)($_POST['room_is_add_bed']) : 0);
84
        $RoomObj->setVar('room_add_money', (isset($_POST['room_add_money'])) ? (int)($_POST['room_add_money']) : 0);
85
        $RoomObj->setVar('room_bed_info', (isset($_POST['room_bed_info'])) ? addslashes($_POST['room_bed_info']) : '');
86
        $RoomObj->setVar('room_status', (isset($_POST['room_status'])) ? (int)($_POST['room_status']) : 0);
87
        $RoomObj->setVar('room_sented_coupon', (isset($_POST['room_sented_coupon'])) ? round($_POST['room_sented_coupon'], 2) : 0);
88
        if (!$id) {
89
            $RoomObj->setNew();
90
        }
91
        if ($RoomObj->isNew()) {
92
            $redirect_msg = _AM_MARTIN_ADDED_SUCCESSFULLY;
93
        } else {
94
            $redirect_msg = _AM_MARTIN_MODIFIED_SUCCESSFULLY;
95
        }
96
        $redirect_to = 'martin.room.php?action=list';
97
        if ($room_handler->CheckHotelRoomExist($RoomObj)) {
98
            redirect_header('javascript:history.go(-1);', 2, _AM_MARTIN_HOTEL_ADDED_TO_ROOM);
99
            exit();
100
        }
101
        if (!$room_handler->insert($RoomObj)) {
102
            redirect_header('javascript:history.go(-1);', 2, _AM_MARTIN_OPERATION_FAILED);
103
            exit();
104
        }
105
        redirect_header($redirect_to, 2, $redirect_msg);
106
        break;
107
    case "typesave":
108
        $typeData = array('room_type_id' => $typeid, 'room_type_info' => trim($_POST['room_type_info']));
109
110
        if (!$typeid) {
111
            $redirect_msg = _AM_MARTIN_ADDED_SUCCESSFULLY;
112
        } else {
113
            $redirect_msg = _AM_MARTIN_MODIFIED_SUCCESSFULLY;
114
        }
115
        $redirect_to = 'martin.room.php?action=typelist';
116
        if (!$room_handler->insertType($typeData)) {
117
            redirect_header('javascript:history.go(-1);', 2, _AM_MARTIN_OPERATION_FAILED);
118
            exit();
119
        }
120
        redirect_header($redirect_to, 2, $redirect_msg);
121
        break;
122
    case "pricesave":
123
        $room_prices                = $_POST['room_price'];
124
        $room_is_totay_specials     = $_POST['room_is_today_special'];
125
        $room_advisory_range_smalls = $_POST['room_advisory_range_small'];
126
        $room_advisory_range_maxs   = $_POST['room_advisory_range_max'];
127
        $room_sented_coupons        = $_POST['room_sented_coupon'];
128
        $room_dates                 = $_POST['room_date'];
129
        //var_dump($_POST['room_is_today_special']);exit;
130
131
        $Data = array();
132
        foreach ($room_prices as $key => $room_price) {
133
            $dateTime = strtotime($room_dates[$key]);
134
            $Data[]   = array(
135
                'room_id'                   => (int)($_POST['room_id']),
136
                'room_price'                => $room_prices[$key],
137
                'room_is_today_special'     => isset($room_is_totay_specials[$dateTime]) ? (int)($room_is_totay_specials[$dateTime]) : 0,
138
                'room_advisory_range_small' => round($room_advisory_range_smalls[$key], 2),
139
                'room_advisory_range_max'   => round($room_advisory_range_maxs[$key], 2),
140
                'room_sented_coupon'        => round($room_sented_coupons[$key], 2),
141
                'room_date'                 => strtotime($room_dates[$key]));
142
        }
143
144
        $IsOld        = false;
145
        $redirect_msg = _AM_MARTIN_ADDED_SUCCESSFULLY;
146
        if ($room_id && $room_date) {
147
            $IsOld        = true;
148
            $redirect_msg = _AM_MARTIN_MODIFIED_SUCCESSFULLY;
149
            $Data         = array(
150
                'room_id'                   => $room_id,
151
                'room_price'                => (int)($_POST['room_price']),
152
                'room_is_today_special'     => (int)($_POST['room_is_today_special']),
153
                'room_advisory_range_small' => round($_POST['room_advisory_range_small'], 2),
154
                'room_advisory_range_max'   => round($_POST['room_advisory_range_max'], 2),
155
                'room_sented_coupon'        => round($_POST['room_sented_coupon'], 2),
156
                'room_date'                 => strtotime($room_date));
157
        }
158
        $redirect_to = 'martin.room.php?action=pricelist';
159
160
        //var_dump($IsOld);
161
        //var_dump($Data);exit;
162
163
        if (!$room_handler->InsertRoomPrice($Data, $IsOld)) {
164
            redirect_header('javascript:history.go(-1);', 2, _AM_MARTIN_OPERATION_FAILED . '<br>' . _AM_MARTIN_ERROR_DUPLICATION);
165
            exit();
166
        }
167
        redirect_header($redirect_to, 2, $redirect_msg);
168
169
        break;
170 View Code Duplication
    case "del":
171
        if (!$confirm) {
172
            xoops_confirm(array('op' => 'del', 'id' => $id, 'confirm' => 1, 'name' => $RoomObj->room_name()), '?action=del', __DELETE . " '" . $RoomObj->room_name() . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_ROOM, _DELETE);
173
        } else {
174
            if ($room_handler->delete($RoomObj)) {
175
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
176
                $redirect_to  = "martin.room.php";
177
            } else {
178
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
179
                $redirect_to  = "javascript:history.go(-1);";
180
            }
181
            redirect_header($redirect_to, 2, $redirect_msg);
182
        }
183
        break;
184
    case "typedel":
185
        $roomType = $room_handler->getRoomTypeList($typeid);
186
        if (!$confirm) {
187
            xoops_confirm(array('op' => 'del', 'typeid' => $typeid, 'confirm' => 1, 'name' => $roomType[$typeid]), '?action=typedel&typeid=' . $typeid, __DELETE . " '" . $roomType[$typeid] . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_ROOM_CATEGORY, _DELETE);
188
        } else {
189
            if ($room_handler->deleteRoomType($typeid)) {
190
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
191
                $redirect_to  = "martin.room.php?action=typelist";
192
            } else {
193
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
194
                $redirect_to  = "javascript:history.go(-1);";
195
            }
196
            redirect_header($redirect_to, 2, $redirect_msg);
197
        }
198
        break;
199
    case "pricedel":
200
        $RoomPrice = ($room_id > 0 && $room_date) ? $room_handler->getRoomPrice($room_id, $room_date) : array();
201
        if (!$confirm) {
202
            xoops_confirm(array(
203
                              'op'       => 'del',
204
                              'hotel_id' => $hotel_id,
205
                              'confirm'  => 1,
206
                              'name'     => $RoomPrice['room_name']), "?action=pricedel&room_id=$room_id&room_date=" . date("Y-m-d", $RoomPrice['room_date']), _DELETE . " '" . $RoomPrice['room_name'] . " : " . date('Y-m-d', $RoomPrice['room_date']) . "'. <br /> <br /> "._AM_MARTIN_OK_TO_DELETE_PRICE, _DELETE);
207
        } else {
208
            if ($room_handler->deleteRoomPrice($room_id, date("Y-m-d", $RoomPrice['room_date']))) {
209
                $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
210
                $redirect_to  = "martin.room.php?action=pricelist";
211
            } else {
212
                $redirect_msg = _AM_MARTIN_DELETE_FAILED;
213
                $redirect_to  = "javascript:history.go(-1);";
214
            }
215
            redirect_header($redirect_to, 2, $redirect_msg);
216
        }
217
        break;
218
    case "deletepassdata":
219
        if (!$confirm) {
220
            xoops_confirm(array('op' => 'del', 'hotel_id' => $hotel_id, 'confirm' => 1), "?action=deletepassdata", _AM_MARTIN_OK_TO_DELETE_DATA_NO_WAY_BACK, _DELETE);
221
        } else {
222
            if ($room_handler->TruncatePassData($date)) {
223
                $redirect_msg = _AM_MARTIN_CLEARING_SUCCESSFUL;
224
                $redirect_to  = "martin.room.php?action=pricelist";
225
            } else {
226
                $redirect_msg = _AM_MARTIN_CLEARING_FAILED;
227
                $redirect_to  = "javascript:history.go(-1);";
228
            }
229
            redirect_header($redirect_to, 2, $redirect_msg);
230
        }
231
        break;
232
    case "list":
233
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ROOMS_LIST, _AM_MARTIN_ROOMS_LIST);
234
        CreateButton();
235
        $RoomObjs = $room_handler->getRooms($xoopsModuleConfig['perpage'], $start, 0);
236
        $Cout     = $room_handler->getCount();
237
        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
238
        $pagenav = new XoopsPageNav($Cout, $xoopsModuleConfig['perpage'], $start, 'action=' . $action . '&start');
239
        $pavStr  = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
240
241
        echo $pavStr . "<table width='100%' cellspacing=1 cellpadding=2 border=0 class = outer>";
242
        echo "<tr>";
243
        echo "<td class='bg3' align='left'><b>ID</b></td>";
244
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_CATEGORY_NAME . "</b></td>";
245
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_HOTEL_NAME . "</b></td>";
246
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_COUNT . "</b></td>";
247
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_AREA . "</b></td>";
248
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_FLOOR . "</b></td>";
249
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_BUY_PRICE . "</b></td>";
250
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_CASH . "</b></td>";
251
        echo "<td width='100' class='bg3' align='center'><b>" . _AM_MARTIN_ACTIONS . "</b></td>";
252
        echo "</tr>";
253
        $Status = array('<div style="background-color:#FF0000">' . _AM_MARTIN_DRAFT . '</div>', '<div style="background-color:#00FF00">' . _AM_MARTIN_PUBLISHED . '</div>');
254
        if (count($RoomObjs) > 0) {
255
            foreach ($RoomObjs as $key => $thiscat) {
256
                $modify   = "<a href='?action=add&id=" . $thiscat->room_id() . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif'/></a>";
257
                $addPrice = "<a href='?action=addprice&room_id=" . $thiscat->room_id() . "' title='"._AM_MARTIN_ADD_PRICES."'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/add.jpg'/></a>";
258
                $delete   = "<a href='?action=del&id=" . $thiscat->room_id() . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif'/></a>";
259
                echo "<tr><td class='even' align='left'>" . $thiscat->room_id() . "</td>";
260
                echo "<td class='even' align='left'>" . $thiscat->room_type_info() . "</td>";
261
                echo "<td class='even' align='left'>" . $thiscat->hotel_name() . "</td>";
262
                echo "<td class='even' align='left'>" . $thiscat->room_name() . "</td>";
263
                echo "<td class='even' align='left'>" . $thiscat->room_area() . "</td>";
264
                echo "<td class='even' align='left'>" . $thiscat->room_floor() . "</td>";
265
                echo "<td class='even' align='left'>" . $thiscat->room_sented_coupon() . "</td>";
266
                echo "<td class='even' align='left'>" . $Status[$thiscat->room_status()] . "</td>";
267
                echo "<td class='even' align='center'> $addPrice $modify $delete </td></tr>";
268
            }
269
        } else {
270
            echo "<tr>";
271
            echo "<td class='head' align='center' colspan= '9'>" . MARTIN_IS_NUll . "</td>";
272
            echo "</tr>";
273
        }
274
        echo "</table>\n";
275
        echo '<div style="text-align:right;">' . $pavStr . '</div>';
276
        echo "<br />";
277
        martin_close_collapsable('createtable', 'createtableicon');
278
        echo "<br>";
279
        break;
280
    case "typelist":
281
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_ROOM_CATEGORY_LIST, _AM_MARTIN_ROOM_CATEGORY_LIST);
282
        CreateButton();
283
        $roomTypeList = $room_handler->getRoomTypeList();
284
285
        echo "<table width='100%' cellspacing=1 cellpadding=2 border=0 class = outer>";
286
        echo "<tr>";
287
        echo "<td class='bg3' align='left'><b>ID</b></td>";
288
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_CATEGORY_NAME . "</b></td>";
289
        echo "<td width='60' class='bg3' align='center'><b>" . _AM_MARTIN_ACTIONS . "</b></td>";
290
        echo "</tr>";
291
        if (count($roomTypeList) > 0) {
292
            foreach ($roomTypeList as $key => $thiscat) {
293
                $modify = "<a href='?action=typeadd&typeid=" . $key . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif'/></a>";
294
                $delete = "<a href='?action=typedel&typeid=" . $key . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif'/></a>";
295
                echo "<tr><td class='even' align='lefet'>" . $key . "</td>";
296
                echo "<td class='even' align='lefet'>" . $thiscat . "</td>";
297
                echo "<td class='even' align='center'> $modify $delete </td></tr>";
298
            }
299
        } else {
300
            echo "<tr>";
301
            echo "<td class='head' align='center' colspan= '3'>" . MARTIN_IS_NUll . "</td>";
302
            echo "</tr>";
303
        }
304
        echo "</table>\n";
305
        /*nclude_once XOOPS_ROOT_PATH . '/class/pagenav.php';
306
        $pagenav = new XoopsPageNav($Cout, $xoopsModuleConfig['perpage'], 0, 'start');
307
        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
308
        echo "<br />";*/
309
        martin_close_collapsable('createtable', 'createtableicon');
310
        echo "<br>";
311
        break;
312
    case "pricelist":
313
        martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_RESERVATION_LIST, _AM_MARTIN_RESERVATION_LIST);
314
        CreateButton();
315
        $Prices = $room_handler->GetRoomPriceList($xoopsModuleConfig['perpage'], $start);
316
317
        echo "<table width='100%' cellspacing=1 cellpadding=2 border=0 class = outer>";
318
        echo "<tr>";
319
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_ROOM_COUNT . "</b></td>";
320
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_PRICE . "</b></td>";
321
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_HOTEL_CONSULT_PRICE . "</b></td>";
322
        echo "<td class='bg3' align='left'><b>" . _AM_MARTIN_HOTEL_PRICE_TIME . "</b></td>";
323
        echo "<td width='60' class='bg3' align='center'><b>" . _AM_MARTIN_ACTIONS . "</b></td>";
324
        echo "</tr>";
325
        $Cout = $room_handler->GetRoomPriceCount();
326
        if ($Cout > 0) {
327
            foreach ($Prices as $key => $price) {
328
                $modify = "<a href='?action=addprice&room_id={$price['room_id']}&room_date={$price['room_date']}'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif'/></a>";
329
                $delete = "<a href='?action=pricedel&room_id={$price['room_id']}&room_date={$price['room_date']}'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif'/></a>";
330
                echo "<td class='even' align='left'>" . $price['room_name'] . "</td>";
331
                echo "<td class='even' align='left'>" . $price['room_price'] . "</td>";
332
                echo "<td class='even' align='left'>" . $price['room_advisory_range_small'] . '-' . $price['room_advisory_range_max'] . "  </td>";
333
                echo "<td class='even' align='left'>" . $price['room_date'] . "  </td>";
334
                echo "<td class='even' align='center'> $modify $delete </td></tr>";
335
            }
336
        } else {
337
            echo "<tr>";
338
            echo "<td class='head' align='center' colspan= '5'>" . MARTIN_IS_NUll . "</td>";
339
            echo "</tr>";
340
        }
341
        echo "</table>\n";
342
        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
343
        $pagenav = new XoopsPageNav($Cout, $xoopsModuleConfig['perpage'], $start, 'action=' . $action . '&start');
344
        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
345
        echo "<br />";
346
347
        martin_close_collapsable('createtable', 'createtableicon');
348
        break;
349
    default:
350
        redirect_header(XOOPS_URL, 2, _AM_MARTIN_UNAUTHORIZED_ACCESS);
351
        break;
352
}
353
354
function CreateButton()
355
{
356
    global $action;
357
    $arr = array(
358
        'addservicetype'  => array('url' => 'martin.room.php?action=typeadd', 'value' => _AM_MARTIN_ADD_ROOM_CATEGORIES),
359
        'servicetypelist' => array('url' => 'martin.room.php?action=typelist', 'value' => _AM_MARTIN_ROOM_CATEGORY_LIST),
360
        'addservice'      => array('url' => 'martin.room.php?action=add', 'value' => _AM_MARTIN_ADD_ROOM),
361
        'servicetype'     => array('url' => 'martin.room.php?action=list', 'value' => _AM_MARTIN_ROOMS_LIST),
362
        'addprice'        => array('url' => 'martin.room.php?action=addprice', 'value' => _AM_MARTIN_ADDING_RATES),
363
        'price'           => array('url' => 'martin.room.php?action=pricelist', 'value' => _AM_MARTIN_RESERVATION_LIST),);
364
    $arr = $action === "pricelist" ? array_merge($arr, array('delte_pass_data' => array('url' => 'martin.room.php?action=deletepassdata', 'value' => _AM_MARTIN_DELETE_EXPIRED_DATA))) : $arr;
365
    Create_button($arr);
366
}
367
368
//底部
369
include_once __DIR__ . '/admin_footer.php';
370
371