/var/www/hkosl.com/innoutstorage2019/webadmin/discount_modifyform.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
    
require_once('check_login.php');

    
$id = (int)$_GET["id"];
    
$discount_type = (int)$_GET["discount_type"];

    if(
$discount_type == 1){    //預繳優惠
        
$title "預繳";

        
$sql "select * from master_type_code where typeid = ? and code != ? and deleted = ? order by sort ASC";
        
$parameters = array("PAYMENT_TERM""SPECIFIC_SIZE"0);
        
$discount_option_info bind_pdo($sql$parameters"selectall");
    }

    if(
$discount_type == 2){    //指定單位優惠
        
$title "指定單位";
        
$sql "select * from master_type_code where typeid = ? and code = ? and deleted = ? order by sort ASC";
        
$parameters = array("PAYMENT_TERM""SPECIFIC_SIZE"0);
        
$discount_option_info bind_pdo($sql$parameters"selectall");
    }

    
$master_room_info get_master_room();

    
$sql "SELECT *, discount.lastupdate as discount_lastupdate, discount.lastupby as discount_lastupby FROM master_room_discount discount INNER JOIN master_room master_room ON discount.master_room_id = master_room.id WHERE discount.id=? ";
    
$parameters = array($id);
    
$master_room_discount bind_pdo($sql$parameters"selectone");

    
$check_if_f12_has_this_size false;
    if(
$master_room_discount["location_id"] > 1){
        
$check_if_f12_has_this_size check_if_f12_has_this_size($master_room_discount["master_room_id"]);
    }

    
$sql99 "SELECT * FROM sys_cms_login WHERE cmsloginid=?";
    
$parameters99 = array((int)$master_room_discount{'discount_lastupby'});
    
$row99 bind_pdo($sql99$parameters99"selectone");
?>
<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>
    <script type="text/javascript">
        $(function () {
            $("#effectivedate_from").datepicker({dateFormat: 'yy-mm-dd', minDate : '0'});
            $("#effectivedate_to").datepicker({dateFormat: 'yy-mm-dd', minDate : '0'});

            <?php if($check_if_f12_has_this_size){ ?>
            $("input").attr("disabled", true).attr("readonly", true).css("cursor", "not-allowed");

            $('form').submit(function () {
                $("input").attr("disabled", false);
            });
            <?php ?>
        });
    </script>
    <!--- End Select Calendar Date --->
</head>
<body>

<form action="discount_modify.php" method="post" name="modifyform" enctype="multipart/form-data">
    <input type="hidden" name="discount_type" value="<?= (int)$_GET{'discount_type'}; ?>">
    <input type="hidden" name="discount_id" value="<?= (int)$_GET{'id'}; ?>">
    <input type="hidden" name="location_id" value="<?= (int)$_GET{'location_id'}; ?>">
    <input type="hidden" name="payment_term" value="<?= $master_room_discount["payment_term"]; ?>">
    <input type="hidden" name="master_room_id" value="<?= $master_room_discount["master_room_id"]; ?>">
    <table width="900" 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" style="font-size: 12px;">
                            <?php if(!$check_if_f12_has_this_size){ ?>
                                <input type="image" alt="submit" src="images/iconSave.png" width="32" height="32" border="0"><br>
                                &nbsp;儲存&nbsp;&nbsp;
                            <?php ?>
                            </td>
                        <td width="50" align="center">
                            <a href="discount_index.php?discount_type=<?=(int)$_GET["discount_type"]?>&msg=取消&location_id=<?=(int)$_GET["location_id"]?>"><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>
                <span style="float:left;" class="pagetitletxt">&nbsp;&nbsp;<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/>
                        修改 優惠設定(<?=$title?>)
                    </b></span><span style="float:right;" class="msg">最近更新: <?= $row99{'cmsusername'} . '&nbsp;&nbsp;&nbsp;' $master_room_discount{'discount_lastupdate'}; ?></span>
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle"><!-- Content -->
                <table border="0" cellpadding="0" cellspacing="0">

                    <?php if($check_if_f12_has_this_size) { ?>
                    <tr>
                        <td width="150" align="right" valign="top" class='content'></td>
                        <td width="5" valign="top" class='content'></td>
                        <td class='content'>

                                <span class='msg' style='font-size: 15px;'>請前往12樓修改優惠設定。</span>

                            <br><br>
                        </td>
                    </tr>
                    <?php ?>

                    <tr>
                        <td width="150" align="right" valign="top" class='content'>倉庫尺寸</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <?=$master_room_discount["length"]." X ".$master_room_discount["width"]." X ".$master_room_discount["height"]; ?>
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="150" align="right" valign="top" class='content'>優惠類型</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <?php
                                $master_type_code_info 
get_master_type_code("PAYMENT_TERM"$master_room_discount["payment_term"]);
                                echo 
$master_type_code_info["name_tc"];
                            
?>

                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="150" align="right" valign="top" class='content'>優惠折扣</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <input type="text" name="discount" value="<?=$master_room_discount["discount"]?>" class="content" required="required"/> % (eg: 20% -> 8折)
                            <br><br>
                        </td>
                    </tr>

                    <?php if($_GET["discount_type"] == 1){ ?>
                        <tr>
                            <td width="150" align="right" valign="top" class='content'>最後折扣(不可折上折)</td>
                            <td width="5" valign="top" class='content'>:&nbsp;</td>
                            <td class='content'>
                                <input type="checkbox" class="content" name="is_final_discount" id="is_final_discount" value="1" <?php if($master_room_discount["is_final_discount"] == 1) echo "checked";?>>
                                <br>
                                <span class="msg">折扣順序: 先進行預繳折扣,然後進行指定尺寸折扣。</span>
                                <br><br>
                            </td>
                        </tr>
                    <?php ?>


                    <tr>
                        <td width="150" align="right" valign="top" class='content'>開始日期</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <input type="text" class="content" name="effectivedate_from" value="<?=$master_room_discount["effectivedate_from"]?>" id="effectivedate_from" required="required">
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="150" align="right" valign="top" class='content'>完結日期</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <input type="text" class="content" name="effectivedate_to" value="<?=$master_room_discount["effectivedate_to"]?>" id="effectivedate_to" required="required">
                            <br><br>
                        </td>
                    </tr>

                    <tr>
                        <td width="150" align="right" valign="top" class='content'>前台顯示優惠</td>
                        <td width="5" valign="top" class='content'>:&nbsp;</td>
                        <td class='content'>
                            <input type="radio" class="content" name="show_frontend" id="show_frontend" value="1" <?=$master_room_discount["show_frontend"]==1?"checked":"";?>> 顯示
                            <input type="radio" class="content" name="show_frontend" id="show_frontend" value="0" <?=$master_room_discount["show_frontend"]==0?"checked":"";?>> 不顯示
                            <br>
                            <span class="msg">同尺寸的優惠最多在前台顯示2個,按預付月份較大排序。</span>
                            <br><br>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>