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

    
$customer_info get_customer((int)$_GET["id"]);

    
$customer_type_info get_master_type_code("CUSTOMER_TYPE");

    
$sql99 "SELECT * FROM sys_cms_login WHERE cmsloginid=?";
    
$parameters99 = array((int)$customer_info{'lastupby'});
    
$row99 bind_pdo($sql99$parameters99"selectone");

?>
<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>
    <script type="text/javascript">
        function _customer_type(customer_type){
            if(customer_type == "PERSONAL"){
                $("#companyname").hide();
            }else{
                $("#companyname").show();
            }
        }

        $(function () {
            _customer_type('<?=$customer_info["typeid"]?>');

            if($("select[name='customer_type']").val() == "BUSINESS"){
                _customer_type('BUSINESS');
            }
        })
    </script>

    <style>
        table input[type='text'], table textarea {
            width: 95%;
        }

        .need_delivery_service {
            display: none;
        }
    </style>


</head>
<body>

<form action="customer_modify.php" method="post" name="customer_modify" enctype="multipart/form-data">
    <input type="hidden" name="customer_id" value="<?=(int)$_GET["id"]?>" />
    <input type="hidden" name="customer_type" value="<?=$customer_info["typeid"];?>" />

    <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;">
                            <input type="image" alt="submit" src="images/iconSave.png" width="32" height="32" border="0"><br>
                            &nbsp;儲存&nbsp;&nbsp;</td>
                        <td width="50" align="center">
                            <a href="customer_index.php?<?php if (isset($_SESSION["index_url_parameter"])) echo $_SESSION["index_url_parameter"]; ?>&msg=取消"><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"/>
                        修改 客戶
                    </b></span><span style="float:right;" class="msg">最近更新: <?= $row99{'cmsusername'} . '&nbsp;&nbsp;&nbsp;' $customer_info{'lastupdate'}; ?></span>
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle"><!-- Content -->
                <table style="width: 100%; margin-left: 10px;">

                    <tr>
                        <td>
                            <p>客戶編號: </p>
                        </td>

                        <td>
                            <?= ($customer_info["code"]); ?>
                        </td>
                    </tr>

                    <tr>
                        <td style="width: 150px;">
                            <p class="required">客戶類型: </p>
                        </td>

                        <td style="min-width: 400px;">
                            <select name="customer_type" onchange="_customer_type($(this).val());">
                                <?php
                                    
foreach($customer_type_info as $customer_type){
                                        if(
$customer_info["typeid"] == $customer_type["code"])
                                            
$selected "selected";
                                        else
                                            
$selected "";

                                        echo 
"<option value='".$customer_type["code"]."' $selected>".$customer_type["name_tc"]."</option>";
                                    }
                                
?>
                            </select>
                            <br>
                            <span class="msg">個人: 以身分證作認證 &nbsp;&nbsp;&nbsp; 商業: 以商業登記證作認證 </span>

                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p class="required">證明文件號碼: </p>
                        </td>

                        <td>
                            <?php
                                
if ($customer_info["typeid"] == "BUSINESS")
                                    echo 
'<input type="text" name="identity_id" value="'.rsa_crypt($customer_info["hkbr"], 2).'" '.(is_admin()?"":"readonly").' style="width: 150px; '.(is_admin()?"":"cursor: not-allowed; background: #cccccc;").'"/>';

                                if (
$customer_info["typeid"] == "PERSONAL")
                                    echo 
'<input type="text" name="identity_id" value="'.rsa_crypt($customer_info["hkid"], 2).'" '.(is_admin()?"":"readonly").' style="width: 150px; '.(is_admin()?"":"cursor: not-allowed; background: #cccccc;").'"/>';
                            
?>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p class="required">頭銜: </p>
                        </td>

                        <td>
                            <select name="title">
                                <option value="Mr" <?php if($customer_info["title"] == "Mr") echo "selected"?>>先生</option>
                                <option value="Mrs" <?php if($customer_info["title"] == "Mrs") echo "selected"?>>女士</option>
                                <option value="Ms" <?php if($customer_info["title"] == "Ms") echo "selected"?>>小姐</option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p class="required">姓氏: </p>
                        </td>

                        <td>
                            <input type="text" name="lastname" value="<?= rsa_crypt($customer_info["lastname"], 2); ?>" style="width: 300px;"/>
                        </td>
                    </tr>


                    <tr>
                        <td>
                            <p class="required">名字: </p>
                        </td>

                        <td>
                            <input type="text" name="firstname" value="<?= rsa_crypt($customer_info["firstname"], 2); ?>" style="width: 300px;"/>
                        </td>
                    </tr>

                    <tr id="companyname" style="display: none;">
                        <td>
                            <p class="required">公司名稱: </p>
                        </td>

                        <td>
                            <input type="text" name="companyname" value="<?= $customer_info["companyname"]; ?><?=is_admin()?"":"readonly"?> style="width: 600px; <?=is_admin()?"":"cursor: not-allowed; background: #cccccc;"?>"/>
                        </td>
                    </tr>
                    

                    <tr>
                        <td>
                            <p class="">聯絡電郵: </p>
                        </td>

                        <td>
                            <input type="text" name="email" value="<?= rsa_crypt($customer_info["email"], 2); ?>" style="width: 300px;"/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p class="required">聯絡電話: </p>
                        </td>

                        <td>
                            <input type="text" name="tel" value="<?= rsa_crypt($customer_info["tel"], 2); ?>" style="width: 300px;"/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p class="required">聯絡地址: </p>
                        </td>

                        <td>
                            <input type="text" name="address" value="<?= rsa_crypt($customer_info["address"], 2); ?>" style="width: 600px;"/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <p>註冊日期: </p>
                        </td>

                        <td>
                            <?= $customer_info["createdate"]; ?>
                        </td>
                    </tr>

                    <tr>
                        <td></td>
                        <td>
                            <p class="red">* 必須填寫</p>
                        </td>

                    </tr>

                </table>

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