/var/www/hkosl.com/innoutstorage2019/webadmin/room_index.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<?php
    
require_once('check_login.php');

    if (empty(
$_GET["location_id"])) {
        
header("Location: room_index.php?location_id=1");
        exit;
    } else {
        
$location_id = (int)$_GET["location_id"];
    }

    
update_master_room_total_number();
    
check_and_update_reserved_room();

    if (!isset(
$_GET["filter1"]) && !isset($_GET["filter2"]) && !isset($_GET["all"])) {
        
$room_info = array();
    } else {
        
$filter_sql "";
        
$parameters = array($location_id);
        if (isset(
$_GET["all"]) && (int)$_GET["all"] == 1) {
            
$filter_sql "";
            
//$parameters = NULL;
        
} else {
            if (isset(
$_GET["filter1"]) && isset($_GET["filter2"])) {
                
/*if($_GET["filter1"] == 0){  //typeid
                    $filter_sql = "and room.typeid = ?";
                }*/

                
if ($_GET["filter1"] == 0) {  //master_room code
                    
$filter_sql "and master_room.id = ?";
                }

                if (
$_GET["filter1"] == 1) {  //room status
                    
$filter_sql "and room.status = ?";
                }

                if (
$_GET["filter1"] == 2) {  //room status
                    
$filter_sql "and room.zone = ?";
                }

                
$parameters[] = ($_GET["filter2"]);

                
//for reserved only
                
if (isset($_GET["filter3"])) {
                    if (
is_numeric($_GET["filter3"])) {
                        
$filter_sql .= " and reserve_by_tel = ?";
                        
$parameters[] = $_GET["filter3"];
                    } else {
                        
//do nothing
                    
}
                }
            }
        }

        
$sql "select *, room.id as room_id, room.code as room_code, room.status as room_status,room.master_room_id from room room INNER JOIN master_room master_room ON room.master_room_id = master_room.id where room.deleted = 0 and room.location_id = ? " $filter_sql " order by room.zone ASC, room.code ASC";

        
$room_info bind_pdo($sql$parameters"selectall");
    }

    
//$filter_typeid = "";
    
$filter_master_room "";
    
$filter_status      "";
    
$filter_zone        "";

    
$status_info   get_master_type_code("ROOM_STATUS");
    
$location_info get_location();
    
$locations     $location_info;

    
//$typeid_info = get_master_type_code("ROOM_TYPE");
    
$master_room_info get_master_room(null$location_id);
    
$zone_info        get_master_type_code("ZONE"null$location_id);

    
/*foreach ($typeid_info as $key => $typeid) {
        $filter_typeid[$key][0] = $typeid["code"];
        $filter_typeid[$key][1] = $typeid["name_tc"];
    }*/

    
foreach ($master_room_info as $key => $master_room) {
        
$filter_master_room[$key][0] = $master_room["id"];
        
$filter_master_room[$key][1] = $master_room{'length'} . " X " $master_room{'width'} . " X " $master_room{'height'} . ($master_room{"display_size"} != $master_room{'length'} . "' x " $master_room{'width'} . "' x " $master_room{'height'} . "'" " &nbsp;&nbsp;&nbsp;(" $master_room{"display_size"} . ")" "");
    }

    foreach (
$status_info as $key => $status) {
        
$filter_status[$key][0] = $status["code"];
        
$filter_status[$key][1] = $status["name_tc"];
    }

    foreach (
$zone_info as $key => $zone) {
        
$filter_zone[$key][0] = $zone["code"];
        
$filter_zone[$key][1] = $zone["code"];
    }

    
/*$filter1_info = array("類別", "尺寸編號", "狀態");
    $filter2_info = array(0 => $filter_typeid, 1 => $filter_master_room, 2 => $filter_status);*/

    
$filter1_info = array("尺寸""狀態""區域");
    
$filter2_info = array(=> $filter_master_room=> $filter_status=> $filter_zone);

    
//var_dump($filter2_info);

    //for reserved
    
$sql                "select * from room where status = ? and deleted = ? and location_id = ? order by reserve_by_tel ASC";
    
$parameters         = array("RESERVED"0$location_id);
    
$reserved_room_info bind_pdo($sql$parameters"selectall");
?>
<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>

    <script type="text/javascript" src="js/chosen_v1.4.1/chosen.jquery.min.js"></script>
    <link rel="stylesheet" href="js/chosen_v1.4.1/chosen.min.css">

    <script type="text/javascript" src="js/jquery.chained.js"></script>

    <script type="text/javascript">

        $(function () {
            var selected_room_num = 0;

            $("#filter2").chained("#filter1");

            $(".room_id").on("click", function () {
                selected_room_num = 0;
                $(".room_id").each(function () {
                    if ($(this).prop("checked")) {
                        selected_room_num++;
                    }
                });

                if (selected_room_num > 0) {
                    $("#update_btn").show();
                } else {
                    $("#update_btn").hide();
                }
            });


        });

        function DeleteRow(room_id) {
            if (confirm("你確定要刪除?")) {
                window.location.href = 'room_delete.php?room_id=' + room_id;
            }
        }

        function filter() {
            var filter1 = $("select[name='filter1']").val();
            var filter2 = $("select[name='filter2']").val();

            if (filter1 != "" && filter2 != "") {
                if (filter2 == "RESERVED") {
                    var filter3 = $("select[name='filter3']").val();
                    if (filter2 != "") {
                        window.location.href = 'room_index.php?filter1=' + filter1 + '&filter2=' + filter2 + '&filter3=' + filter3;
                    } else {
                        alert("請輸入預約人聯絡電話。");
                    }

                } else {
                    window.location.href = 'room_index.php?location_id=<?=$location_id?>&filter1=' + filter1 + '&filter2=' + filter2;
                }

            } else {
                alert("請選擇篩選方式。");
            }
        }

        function check_checkbox(room_tr) {
            $(room_tr).find(".room_id").prop("checked", true);
            $("#update_btn").show();
        }

        function update_room(room_code) {

            var master_room_id = $("#" + room_code + " .master_room_id").val();
            var room_status = $("#" + room_code + " .room_status").val();
            var room_id = $("#" + room_code + " .room_id").val();

            var xmlhttp;

            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    var result = $.trim(xmlhttp.responseText);
                    alert(result);
                }
            }
            xmlhttp.open("POST", "_ajax.php?for=update_room", true);
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            //xmlhttp.send("selected_room_id_list=" + selected_room_id_list + "&prepaid_month=" + prepaid_month);
            xmlhttp.send("room_code=" + room_code + "&room_id=" + room_id + "&master_room_id=" + master_room_id + "&room_status=" + room_status);

        }

        function ajax_floor_plan_rent_room(go_to_warehousing, room_id, master_room_id, room_code) {

            var xmlhttp;

            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    var result = $.trim(xmlhttp.responseText);

                    //console.log(result);

                    if (result == "success" && go_to_warehousing != 1) {
                        //alert("你已將這個倉庫單位加入租用列表,你可前往租倉程序或加入更多的倉庫單位。");
                        $(".go_to_warehousing").show();

                        //modify for room index
                        if ($("#" + room_id).length <= 0) {
                            $(".rent_current_room").after('<span class="cancel_room" id="' + room_id + '" onclick=\"ajax_delete_rent_room(this.id);\">' + "&nbsp;&nbsp;&nbsp;" + room_code + " [刪除]" + '</span>');
                        }


                    }

                    if (go_to_warehousing == 1) {
                        window.top.location.href = 'warehousing_step1.php';
                    }
                }
            }

            xmlhttp.open("POST", "_ajax.php?for=floor_plan_rent_room", true);
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            xmlhttp.send("go_to_warehousing=" + go_to_warehousing + "&room_id=" + room_id + "&master_room_id=" + master_room_id + "&room_code=" + room_code);

        }


        function ajax_delete_rent_room(room_id) {

            var xmlhttp;

            if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp = new XMLHttpRequest();
            }
            else {// code for IE6, IE5
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                    var result = $.trim(xmlhttp.responseText);
                    alert("你已將這個倉庫單位從租用列表中刪除。");
                    $(".cancel_room").each(function () {
                        if ($(this).attr("id") == room_id) {
                            if ($(this).hasClass("rent_current_room")) {
                                $(this).empty();
                            } else {
                                $(this).remove();
                            }
                        }

                    });
                }
            }

            xmlhttp.open("POST", "_ajax.php?for=floor_plan_delete_room", true);
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            xmlhttp.send("room_id=" + room_id);

        }

        $(function () {
            $(".cancel_room").on("click", function () {
                ajax_delete_rent_room(this.id);
            });

            $("#filter3").chosen({width: "160px", search_contains: true});
            $("#filter3_chosen").css("display", "none");

            $("#filter2").on("change", function () {
                if ($(this).val() == "RESERVED") {
                    $("#filter3_chosen").css("display", "inline-block");
                } else {
                    $("#filter3_chosen").css("display", "none");
                }
            });

            <?php
            
if (isset($_GET["filter3"])) {
                echo 
'$("#filter3_chosen").css("display", "inline-block");';
            }
            
?>


        });

    </script>

</head>

<body>
<table height="600" border="0" cellpadding="0" cellspacing="0" style="margin-left: 15px;">
    <tr>

        <td align="left" valign="top">
            <table width="1000" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="70" align="right" valign="middle" class="icontxt">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="50" align="center">
                                    <a href="index.php"><img src="images/iconCancel.png" alt="Cancel" width="32" height="32" border="0"><br>
                                        &nbsp;取消&nbsp;&nbsp;</a></td>
                                <td>&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>

                <tr>
                    <td class="pagetitletxt">
                        &nbsp;&nbsp;<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/>
                            倉庫管理設定(單位) </b></td>
                </tr>

                <tr>
                    <td height="25" align="left" valign="middle" class="msg"><?php if (!empty($_GET["msg"])) echo $_GET['msg']; ?></td>
                </tr>

                <tr>
                    <td align="left" valign="middle">

                        <div class="floor_plan" style="display: none;">
                            <div id="loading" style="text-align: center;">
                                <img src="images/loading_icon.gif" style="width: 100px;"></div>
                            <iframe id="floor_plan_iframe" src="" style="width: 1360px; height: 660px; margin-bottom: 30px;" onload="$('#loading').hide();"></iframe>
                        </div>

                    </td>
                </tr>

                <tr>

                    <td align="left" valign="middle" style="padding-bottom: 50px;">

                        <div>篩選:

                            <select name="location_id" style="margin-bottom: 10px;" onchange="location.href='room_index.php?location_id='+this.value;">
                                <?php
                                    
foreach ($locations as $location) {
                                        echo 
"<option value='" $location["location_id"] . "' " . ($location_id == $location["location_id"] ? "selected" "") . ">" $location["location_code"] . " " $location["location_name_tc"] . "</option>";
                                    }
                                
?>
                            </select>

                            <select name="filter1" id="filter1">
                                <option value="">---請選擇---</option>
                                <?php
                                    
foreach ($filter1_info as $key => $filter1) {
                                        if (isset(
$_GET["filter1"]))
                                            
$selected matched_option($key$_GET["filter1"], "select");
                                        else
                                            
$selected "";
                                        echo 
'<option value="' $key '" ' $selected '>' $filter1 '</option>';
                                    }
                                
?>
                            </select>

                            <select name="filter2" id="filter2">
                                <option value="">---請選擇---</option>
                                <?php
                                    
foreach ($filter2_info as $key => $filter2) {
                                        foreach (
$filter2 as $data) {
                                            if (isset(
$_GET["filter2"]))
                                                
$selected matched_option($data[0], $_GET["filter2"], "select");
                                            else
                                                
$selected "";

                                            echo 
'<option value="' $data[0] . '" ' $selected ' class="' $key '">' $data[1] . '</option>';
                                        }

                                    }
                                
?>
                            </select>

                            <select name="filter3" id="filter3" style="display: none;">
                                <option value="">---請選擇聯絡電話---</option>
                                <option value="ALL" <?php if (isset($_GET["filter3"]) && $_GET["filter3"] == "ALL") echo "selected"?>>
                                    所有
                                </option>
                                <?php
                                    
if (!empty($reserved_room_info)) {
                                        foreach (
$reserved_room_info as $key => $reserved_room) {
                                            if (isset(
$_GET["filter3"]))
                                                
$selected matched_option($reserved_room["reserve_by_tel"], $_GET["filter3"], "select");
                                            else
                                                
$selected "";

                                            echo 
'<option value="' $reserved_room["reserve_by_tel"] . '" ' $selected ' >' $reserved_room["reserve_by_tel"] . '</option>';

                                        }
                                    }

                                
?>
                            </select>

                            <button type="button" onclick="filter();">送出</button>

                            <button type="button" onclick="window.location.href='room_index.php?location_id=<?= $location_id ?>&all=1';" style="margin-left: 15px;">
                                全部單位
                            </button>

                            <button type="button" onclick="$('.floor_plan').slideToggle(); $('#loading').show(); $('iframe').attr('src', 'floor_plan.php?location_id=<?= $location_id ?>')" style="margin-left: 15px;">
                                顯示倉庫平面圖
                            </button>

                        </div>

                        <br>

                        <form action="room_modify.php" method="post" enctype="multipart/form-data" id="room_modify">
                            <input type="hidden" name="last_url_parameter" value="<?= $_SERVER['QUERY_STRING']; ?>"/>
                            <table id="room_index" width="1000" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="10" class="listtitletxt"></td>
                                    <td width="20" class="listtitletxt"></td>
                                    <td width="20" class="listtitletxt"></td>
                                    <td width="80" class="listtitletxt">單位編號</td>
                                    <!--<td width="150" class="listtitletxt">類別</td>-->
                                    <td width="120" class="listtitletxt">尺寸</td>
                                    <td width="100" class="listtitletxt">狀態</td>
                                    <td width="50" class="listtitletxt">區域</td>
                                    <td width="200" class="listtitletxt">其他資料</td>
                                    <td width="80" class="listtitletxt"></td>
                                </tr>

                                <?php
                                    $i 
0;
                                    foreach (
$room_info as $key => $room) {
                                        
$i++;

                                        print 
"<tr id='" $room["room_code"] . "'>";
                                        print 
"<td class='listtxt' style='padding-left:5px;'>&nbsp;</td>";
                                        print 
"<td class='listtxt' style='padding-left:5px;'>" $i ".</td>";
                                        print 
"<td class='listtxt' style='padding-left:5px;'><input type='checkbox' name='room_id[" $key "]' value='" $room["room_id"] . "' class='room_id'></td>";

                                        
//2019-04-24 如租的倉是 "服裝倉",於所有合約/單上顯示倉的編號後加上 "(服裝倉)"
                                        
$master_room get_master_room($room['master_room_id']);
                                        if(
$master_room['type'] == 'CLOTH'){
                                            
$room{'room_code'} .= "(服裝倉)";
                                        }

                                        print 
"<td class='listtxt' style='padding-left:5px;'>" $room{'room_code'} . "<input type='hidden' name='code[" $key "]' value='" $room["room_code"] . "' /></td>";
                                        
//print "<td class='listtxt' style='padding-left:5px;'><input type='text' name='code[".$key."]' value='" . $room["room_code"] . "' onchange='check_checkbox($(this).closest(\"tr\"))'/></td>";


                                        /*print "<td class='listtxt' style='padding-left:5px;'><select name='typeid[".$key."]' >";
                                        foreach ($typeid_info as $typeid) {
                                            print "<option value='" . $typeid["code"] . "' " . matched_option($typeid["code"], $room["typeid"], "select") . ">" . $typeid["name_tc"] . "</option>";
                                        }
                                        print "</select></td>";*/


                                        
print "<td class='listtxt' style='padding-left:5px;'><select class='master_room_id' name='master_room_id[" $key "]'  onchange='check_checkbox($(this).closest(\"tr\"))'>";
                                        foreach (
$master_room_info as $master_room) {
                                            print 
"<option value='" $master_room["id"] . "' " matched_option($master_room["id"], $room["master_room_id"], "select") . "> " $master_room{'length'} . " X " $master_room{'width'} . " X " $master_room{'height'} . ($master_room{"display_size"} != $master_room{'length'} . "' x " $master_room{'width'} . "' x " $master_room{'height'} . "'" " &nbsp;&nbsp;&nbsp;(" $master_room{"display_size"} . ")" "") . "</option>";
                                            
//print "<option value='" . $master_room["id"] . "' " . matched_option($master_room["id"], $room["master_room_id"], "select") . "> " .$master_room{"display_size"}."</option>";
                                            //print "<option value='" . $master_room["id"] . "' " . matched_option($master_room["id"], $room["master_room_id"], "select") . "> " .$master_room{'length'} . " X " . $master_room{'width'} . " X " . $master_room{'height'}."</option>";
                                        
}
                                        print 
"</select></td>";

                                        print 
"<td class='listtxt' style='padding-left:5px;'><select class='room_status' name='room_status[" $key "]' onchange='check_checkbox($(this).closest(\"tr\"))'>";

                                        foreach (
$status_info as $status) {
                                            print 
"<option value='" $status["code"] . "' " matched_option($status["code"], $room["room_status"], "select") . " " . ($status["code"] == "OPEN_FOR_INTERNAL" "disabled" "") . ">" $status["name_tc"] . "</option>";
                                        }

                                        print 
"</select></td>";


                                        
/*print "<td class='listtxt' style='padding-left:5px;'><select name='zone[".$key."]' onchange='check_checkbox($(this).closest(\"tr\"))'>";

                                        $zone_array = array("A", "B", "C", "D", "E", "F", "G");
                                        foreach ($zone_array as $zone) {
                                            print "<option value='" . $zone . "' " . matched_option($zone, $room["zone"], "select") . ">" . $zone . "</option>";
                                        }

                                        print "</select></td>";*/


                                        // Delete
                                        //print "<td class='listtxt' align='center'><a href='#' onClick=\"DeleteRow(" . $master_room{'master_room_id'} . ")\"><img src='images/btnDelete.png' title='Delete' alt='Delete' hspace='2' border='0'></a></td>";

                                        
print "<td class='listtxt' style='padding-left:5px;'>" $room["zone"] . "<input type='hidden' name='zone[" $key "]' value='" $room["zone"] . "'></td>";

                                        print 
"<td class='listtxt' style='padding-left:5px;'>";

                                        if (
$room["room_status"] == "RESERVED") {
                                            echo 
"預約人 : " $room["reserve_by_name"] . "<br>";
                                            echo 
"聯絡電話 : " $room["reserve_by_tel"] . "<br>";
                                            echo 
"聯絡電郵 : " $room["reserve_by_email"] . "<br>";
                                            echo 
"預約期 : " $room["reservedate_from"] . " 到 " $room["reservedate_to"] . "<br><br>";
                                            echo 
'<button type="button" onclick="ajax_floor_plan_rent_room(0, ' $room["room_id"] . ',' $room["master_room_id"] . ',\'' $room["room_code"] . '\');" style="font-size:12px;">立即租用</button>';


                                            if (isset(
$_SESSION["floor_plan_rent_room"])) {
                                                
$display "block";
                                            } else {
                                                
$display "none";
                                            }

                                            echo 
'<div class="go_to_warehousing" style="display: ' $display '"><br>
            <div>已選擇單位: '
;

                                            
$room_list "";
                                            if (!empty(
$_SESSION["floor_plan_rent_room"])) {
                                                foreach (
$_SESSION["floor_plan_rent_room"] as $rent_room) {
                                                    
$room_list .= "<span class='cancel_room " $rent_room["room_id"] . "' id='" $rent_room["room_id"] . "'>" $rent_room["room_code"] . " [刪除], </span>";
                                                }

                                                
$room_list substr_replace($room_list"", -91);

                                                echo 
$room_list;
                                            }

                                            echo 
'<span class="cancel_room rent_current_room" ></span></div>
            <br>
            <div onclick="ajax_floor_plan_rent_room(1, ' 
$room["room_id"] . ',' $room["master_room_id"] . ',\'' $room["room_code"] . '\');" style="text-decoration: underline; cursor: pointer;">前往租倉程序
            </div>'
;


                                        }

                                        print 
"</td>";

                                        print 
"<td class='listtxt' style='padding-left:5px;'><button type='button' onclick='update_room($(this).closest(\"tr\").attr(\"id\"));'>更新</button></td>";
                                        print 
"</tr>";
                                    }

                                    print 
"<tr id='update_btn' style='display: none;'><td></td><td class='listtxt' style='padding-left:5px;' colspan='5'><button type='button' id='room_modify_submit_btn' >更新</button></td></tr>";

                                    
$dbh null;
                                
?>
                            </table>
                        </form>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

<script type="text/javascript">
    $(function () {
        $("#room_modify_submit_btn").on("click", function () {
            $(".room_id").each(function (index, element) {

                if (!$(element).prop("checked")) {
                    //disable it
                    $(element).parent().parent().find("input").attr("disabled", true);
                    $(element).parent().parent().find("select").attr("disabled", true);
                }
            });

            $("#room_modify").submit();
        });
    });

</script>
</body>
</html>