-
Notifications
You must be signed in to change notification settings - Fork 0
/
accSetting.php
282 lines (274 loc) · 9.88 KB
/
accSetting.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
<?php
session_start();
include('admin/connection.php');
if (isset($_POST['submitchange'])) {
global $connection;
$user_id = $_POST['uid'];
$f_name = $_POST['fname'];
$s_name = $_POST['sname'];
$email = $_POST['email'];
$password = $_POST['password'];
$phone = $_POST['phoneNo'];
$profilep = $_FILES['ppphoto']['name'];
$query = "UPDATE users set FirstName='$f_name', SurName='$s_name', Upassword='$password',Uemail='$email', UPhoneNo='$phone', Uphoto='$profilep' WHERE UserID='$user_id'";
$go_query = mysqli_query($connection,$query);
if (!$go_query) {
die("QUERY FAILED" . mysqli_error($connection));
}else{
move_uploaded_file($_FILES['ppphoto']['tmp_name'],'photo/'.$profilep);
// echo "<script>window.alert('successfully Update')</script>";
header("location:index.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Account Setting</title>
<link rel="stylesheet" href="./css/style.css" />
<link rel="stylesheet" href="./fontawesome/css/all.min.css" />
</head>
<body class="feature-body userbody">
<div class="overall-overlay"></div>
<!--
NAVBAR
-->
<?php
if(empty($_SESSION['user'])):
include('header.php');
?>
<?php else: ?>
<?php
include('loginheader.php');
?>
<?php
endif;
?>
<!--
ACCOUNT SETTING
-->
<?php
$uid = $_GET['uid'];
$query = "SELECT * FROM users WHERE UserID='$uid'";
$go_query = mysqli_query($connection, $query);
while($out = mysqli_fetch_array($go_query)){
$user_id = $_GET['uid'];
$db_fName = $out['FirstName'];
$db_sName = $out['SurName'];
$db_email = $out['UEmail'];
$db_pass = $out['UPassword'];
$db_phone = $out['UPhoneNo'];
$profile = $out['UPhoto'];
?>
<section class="account-setting" id="account-setting">
<div class="account-setting-container">
<div class="contact-box account-setting-form">
<form method="POST" class="contact-us-form" enctype="multipart/form-data">
<div class="form-group text-center" style="position: relative;" >
<span class="img-div">
<div class="text-center img-placeholder" onClick="triggerClick()">
<h4><i class="fa-solid fa-camera"></i></h4>
</div>
<?php
echo "<img src='photo/$profile' name='ppphoto' onClick='triggerClick()' id='profileDisplay'>";
?>
<div>
</div>
</span>
<input type="file" name="ppphoto" onChange="displayImage(this)" id="profileImage" class="form-control" style="display: none;">
</div>
<h1 class="login-title">Account Setting</h1>
<label for="username">First Name</label>
<input
type="text"
name="fname"
id="username"
value="<?php echo $db_fName ?>"
/>
<label for="username">SurName</label>
<input
type="text"
name="sname"
id="username"
value="<?php echo $db_sName ?>" />
<label for="email">Email</label>
<input
type="email"
name="email"
id="email"
value="<?php echo $db_email ?>"
/>
<label for="password">Password</label>
<input
type="text"
name="password"
id="password"
value="<?php echo $db_pass ?>"
/>
<label for="phone">Phone No</label>
<input
type="text"
name="phoneNo"
id="phone"
value="<?php echo $db_phone ?>" />
<input type="text" hidden name="uid" value="<?php echo $user_id ?>">
<button class="submit-btn" name="submitchange">Submit Changes</button>
<!-- <a href="" class="submit-btn logout-btn">Logout</a> -->
</form>
<?php
}
?>
<img src="./assets/accSetting.svg" alt="" class="contact-img" />
</div>
</div>
</section>
<!-- Add Payment Method -->
<!-- <section class="account-setting">
<div class="account-setting-container">
<div class="choose-payment-method">
<p class="choose-payment-method-title">
<i class="fa-solid fa-wallet payment-wallet-icon"></i>
<span>Please Choose Your Payment Method</span>
</p>
<button
class="choose-payment-method-btn submit-btn"
id="paymentMethodBtn"
>
Add New Payment Method
</button>
<p class="payment-exclame-note">
<i class="fa-solid fa-circle-exclamation payment-exclamation"></i>
<span>You current do not have added any payment methods</span>
</p>
</div>
</div>
</section> -->
<!-- <div class="popup-form-overlay" id="popupOverlay">
<form class="payment-popup-form" id="popup-form">
<div class="popup-form-header">
<p>Adding New Payment</p>
<a id="popup-form-cancel">
<i class="fa-regular fa-circle-xmark" id="close-popup-form"></i>
</a>
</div>
<div class="popup-form-inputs">
<label for="payment-username">Name</label>
<input
type="text"
name="payment-username"
id="payment-username"
placeholder="Enter Full Name"
/>
<label for="payment-card-number"> Card Number </label>
<div class="input-box">
<input
type="number"
name="payment-card-number"
id="payment-card-number"
placeholder="XXXX XXXX XXXX"
/>
<i class="fa-regular fa-credit-card"></i>
</div>
<div class="cvv-and-expiry-date">
<div class="cvv">
<label for="payment-cvv">CVV</label>
<input
type="number"
name="payment-cvv"
id="payment-cvv"
placeholder="XXX"
/>
</div>
<div class="expiry-date">
<label for="payment-expiry-date">Expiry Date</label>
<input
type="date"
name="payment-expiry-date"
id="payment-expiry-date"
placeholder=" "
/>
</div>
</div>
</div>
<div class="popup-form-footer">
<button class="popup-form-submit submit-btn">Submit</button>
</div>
</form>
</div> -->
<!--
FOOTER
-->
<footer>
<div class="footer-container">
<div class="you-are-here">
<h3 class="footer-logo">You are here</h3>
<i class="fa-solid fa-chevron-right arr-right"></i>
<a href="" class="footer-nav-item">Account Setting</a>
</div>
<div class="footer-info-container">
<p class="copy-right">
© 2023 Global Wild Swimming & Camping All rights reserved
</p>
<div class="footer-info-box">
<a href="" class="footer-icon-box">
<img src="./assets/icons/facebook.svg" class="footer-icon" alt="" />
Facebook
</a>
<a href="" class="footer-icon-box">
<img src="./assets/icons/twitter.svg" class="footer-icon" alt="" />
Twitter
</a>
<a href="" class="footer-icon-box">
<img src="./assets/icons/insta.svg" class="footer-icon" alt="" />
Instagram
</a>
<a href="" class="footer-icon-box">
<img src="./assets/icons/youtube.svg" class="footer-icon" alt="" />
Youtube
</a>
<a href="rssfeed.php" class="footer-icon-box">
<img
src="./assets/icons/rss-feed.svg"
class="footer-icon"
alt=""
/>
Rss Feed
</a>
<!-- <a href="" > -->
<div class="footer-icon-box translatebox" id="google_element"></div>
<!-- </a> -->
</div>
</div>
</div>
</footer>
<!-- google translate script -->
<script src="http://translate.google.com/translate_a/element.js?cb=loadGoogleTranslate"></script>
<script>
function loadGoogleTranslate(){
new google.translate.TranslateElement("google_element");
}
</script>
<script>
const paymentMethodBtn = document.getElementById("paymentMethodBtn");
const popupOverlay = document.getElementById("popupOverlay");
const closePopup = document.getElementById("close-popup-form");
const cancelPopup = document.getElementById("popup-form-cancel");
paymentMethodBtn.addEventListener("click", (e) => {
e.preventDefault();
popupOverlay.classList.add("popup-active");
});
closePopup.addEventListener("click", (e) => {
e.preventDefault();
popupOverlay.classList.remove("popup-active");
});
cancelPopup.addEventListener("click", (e) => {
e.preventDefault();
popupOverlay.classList.remove("popup-active");
});
</script>
<script src="./js/script.js"></script>
<script src="./fontawesome/js/all.min.js"></script>
</body>
</html>