-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyinfo.php
246 lines (228 loc) · 10 KB
/
myinfo.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
<?
include "./include/inc_base.php";
$tableName = "chan_shop_member";
if($_POST['mode'] == "save")
{
$action=mysql_real_escape_string(htmlentities($_POST['action']));
$user_id = mysql_real_escape_string(htmlentities(trim($_POST['user_id'])));
$passwd = mysql_real_escape_string(htmlentities($_POST['passwd']));
$name_first = mysql_real_escape_string(htmlentities($_POST['name_first']));
$name_last = mysql_real_escape_string(htmlentities($_POST['name_last']));
$tax_id = mysql_real_escape_string(htmlentities($_POST['tax_id']));
$company = mysql_real_escape_string(htmlentities($_POST['company']));
$address1 = mysql_real_escape_string(htmlentities($_POST['address1']));
$address2 = mysql_real_escape_string(htmlentities($_POST['address2']));
$city = mysql_real_escape_string(htmlentities($_POST['city']));
$state = mysql_real_escape_string(htmlentities($_POST['b_state']));
$zipcode = mysql_real_escape_string(htmlentities($_POST['zipcode']));
$country = mysql_real_escape_string(htmlentities($_POST['b_country']));
$phone_flag = mysql_real_escape_string(htmlentities($_POST['phone_flag']));
$cell_phone = mysql_real_escape_string(htmlentities($_POST['cell_phone']));
$home_phone = mysql_real_escape_string(htmlentities($_POST['home_phone']));
$corp_phone = mysql_real_escape_string(htmlentities($_POST['corp_phone']));
$mail_flag = mysql_real_escape_string(htmlentities($_POST['mail_flag']));
$security_passwd = md5($passwd);
if($_POST['passwd'])
{
$qry1 = "update chan_shop_member set member_password = '$passwd',
first_name = '$name_first',
last_name = '$name_last',
company = '$company',
tax_id = '$tax_id',
email = '$email',
corp_phone = '$corp_phone',
address1 = '$address1',
address2 = '$address2',
city = '$city',
state = '$state',
zipcode = '$zipcode',
country = '$country' where member_id = '".$_SESSION['member_id']."'";
}
else
{
$qry1 = "update chan_shop_member set first_name = '$name_first',
last_name = '$name_last',
company = '$company',
tax_id = '$tax_id',
email = '$email',
corp_phone = '$corp_phone',
address1 = '$address1',
address2 = '$address2',
city = '$city',
state = '$state',
zipcode = '$zipcode',
country = '$country' where member_id = '".$_SESSION['member_id']."'";
}
$rst1 = mysql_query($qry1);
echo "<meta http-equiv='refresh' content='0; url=myaccount.php'>";
exit;
}
$mem_info = getinfo_dbMember($_SESSION['member_id']);
include _BASE_DIR ."/include/inc_top.php";
?>
<div id="maincontainer">
<section id="product">
<div class="container">
<!-- breadcrumb -->
<ul class="breadcrumb">
<li>
<a href="#">Home</a>
<span class="divider">/</span>
</li>
<li class="active">Register Account</li>
</ul>
<div class="row">
<!-- Register Account-->
<div class="col-lg-9 col-md-9 col-xs-12 col-sm-12">
<h1 class="heading1"><span class="maintext"> <i class="icon-signin"></i> Modify Account</span></h1>
<script>
function choose_country(flag,country)
{
if(flag == 'bill')
{
if(country == 'US')
{
b_state_area.innerHTML = '<select name="b_state" id="b_state" class="txt" style="width:180px"><?= printState(); ?></select>';
}
else
{
b_state_area.innerHTML = '<input name="b_state" type="text" class="itext" />';
}
}
}
</script>
<form class="form-horizontal form-custom" action=<?= $_SERVER['PHP_SELF'] ?> method=post>
<input type=hidden name=mode value=save>
<h3 class="heading3">Your Personal Details</h3>
<div class="registerbox">
<fieldset>
<div class="control-group">
<label class="control-label"><span class="red">*</span> First Name:</label>
<div class="controls">
<input type="text" name=name_first class="" value="<?= $mem_info['first_name'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Last Name:</label>
<div class="controls">
<input type="text" name=name_last class="" value="<?= $mem_info['last_name'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Email:</label>
<div class="controls">
<input type="text" name=user_id class="" value="<?= $mem_info['email'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> New Password:</label>
<div class="controls">
<input type="password" name=passwd class="" value=""> (※ If you want to change password, please enter new password))
</div>
</div>
</fieldset>
</div>
<h3 class="heading3">Company Information</h3>
<div class="registerbox">
<fieldset>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Company:</label>
<div class="controls">
<input type="text" name=company class="" value="<?= $mem_info['company'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Tax ID:</label>
<div class="controls">
<input type="text" name=tax_id class="" value="<?= $mem_info['tax_id'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Phone:</label>
<div class="controls">
<input type="text" name=corp_phone class="" value="<?= $mem_info['corp_phone'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"><span class="red">*</span> Address 1:</label>
<div class="controls">
<input type="text" name=address1 class="" value="<?= $mem_info['address1'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label"> Address 2:</label>
<div class="controls">
<input type="text" name=address2 class="" value="<?= $mem_info['address2'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label">
<span class="red">*</span>City:</label>
<div class="controls">
<input type="text" name=city class="" value="<?= $mem_info['city'] ?>">
</div>
</div>
<div class="control-group">
<label class="control-label">
<span class="red">*</span>Post Code:</label>
<div class="controls">
<input type="text" name=zipcode class="" value="<?= $mem_info['zipcode'] ?>">
</div>
</div>
<div class="control-group">
<label for="select01" class="control-label">
<span class="red">*</span>Country:</label>
<div class="controls">
<select name=b_country onChange="javascript:choose_country('bill',this.value)"><?= printCountryList($mem_info['country']); ?></select>
</div>
</div>
<div class="control-group">
<label class="control-label">
<span class="red">*</span>Region / State:</label>
<div class="controls">
<span id="b_state_area"><select name="b_state" id="b_state" class="txt" style="width:180px"><?= printState($mem_info['state']); ?></select></span>
</div>
</div>
</fieldset>
</div>
<h3 class="heading3">Newsletter</h3>
<div class="registerbox">
<fieldset>
<div class="control-group">
<label class="control-label">Subscribe:</label>
<div class="controls">
<label class="checkbox inline">
<input type="checkbox" name=mail_flag value="YES" >
Yes </label>
I want to receive newsletter.
</div>
</div>
</fieldset>
</div>
<div class="pull-right">
<input type="Submit" class="btn btn-orange" value="Continue">
</div>
</form>
<div class="clearfix"></div>
<br>
</div>
<!-- Sidebar Start-->
<aside class="col-lg-3 col-md-3 col-xs-12 col-sm-12 span3">
<div class="sidewidt">
<h1 class="heading1"><span class="maintext"> <i class="icon-user"></i> Account</span></h1>
<ul class="nav nav-list categories">
<li><a href="myaccount.php"> My Account</a></li>
<li><a href="myinfo.php">Edit Account</a></li>
<li><a href="orderhistory.php">Order History</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div>
</aside>
<!-- Sidebar End-->
</div>
</div>
</section>
</div>
<?
include _BASE_DIR ."/include/inc_bottom.php";
?>