-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_profile.html
250 lines (192 loc) · 10.9 KB
/
edit_profile.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/materialize.min.css"/>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css"/>
<style>
.card {box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;}
.card-panel{box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;}
</style>
<title>Hello World</title>
</head>
<body class="blue-grey lighten-4">
<div class="navbar-fixed">
<nav class="blue-grey darken-3">
<div class="nav-wrapper">
<a href="#" class="brand-logo">Edit Profile</a>
<ul class="left"><a href="settings.html" data-activates="slide-out" class="button-collapse"><i class="fa fa-angle-left"></i></a></ul>
</div>
</nav>
</div>
<div style="width:90%; height:auto;margin:auto;">
<div class="card-panel" style="width:100%;">
<div style="width:;margin-left:;margin-right:;text-align:;">
<form method="post" class="white">
<div class="input-field" class="white">
<input style="border: 2px solid #e0e0e0;border-radius:5px;" style="50px" id="uname" type="text" placeholder="Edit username">
</div>
<button type="button" value="create" class="btn waves-effect waves-light blue-grey" id="a">Edit</button>
</form>
</div>
</div>
<div class="card-panel" style="width:100%;">
<div style="width:;margin-left:;margin-right:;text-align:;">
<form method="post" class="white">
<div class="input-field" class="white">
<input style="border: 2px solid #e0e0e0;border-radius:5px;" style="50px"id="email" type="text" placeholder="Edit Email">
</div>
<button type="button" value="create" class="btn waves-effect waves-light blue-grey" id="b">Edit</button>
</form>
</div>
</div>
<div class="card-panel" style="width:100%;">
<div style="width:;margin-left:;margin-right:;text-align:;">
<form method="post" class="white">
<div class="input-field" class="white">
<input style="border: 2px solid #e0e0e0;border-radius:5px;" style="50px"id="pword1" type="text" placeholder="Old password">
<input style="border: 2px solid #e0e0e0;border-radius:5px;" style="50px"id="pword2" type="text" placeholder="New password">
</div>
<button type="button" value="create" class="btn waves-effect waves-light blue-grey" id="c">Edit</button>
</form>
</div>
</div>
<!-- <div class="card-panel" style="width:100%;">
<div style="width:;margin-left:;margin-right:;text-align:;">
<form method="post" class="white">
<div class="input-field col s12">
<select id="country">
<option value="" disabled selected>Change your country</option>
<option value="male" >Nigeria</option>
</select>
</div>
<button type="button" value="create" class="btn waves-effect waves-light blue-grey" id="d">Edit</button>
</form>
</div>
</div>-->
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/materialize.min.js"></script>
<script>
$(document).ready(function(){
$('select').material_select();
$("#a").click(function(){
var uname = $("#uname").val();
if (uname != "" ) {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/check.php',
//url: 'check.php',
data: {
username: uname,
},
success:function(response) {
if (response == "success") {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/update_username.php',
data: {uname:uname},
success:function(response) {
if (response == "success") {
Materialize.toast("Profile updated", 10000);
}
else {
Materialize.toast("Profile not updated", 10000);
}
}
});
}
else {
Materialize.toast("Username already exists", 10000);
}
}
});
}else {Materialize.toast('Input a username!', 4000);}
});
$("#b").click(function(){
var email = $("#email").val();
if (email != "" ) {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/check_email.php',
//url: 'check.php',
data: {
email: email,
},
success:function(response) {
if (response == "success") {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/update_email.php',
data: {uname:uname},
success:function(response) {
if (response == "success") {
Materialize.toast("Profile updated", 10000);
}
else {
Materialize.toast("Profile not updated", 10000);
}
}
});
}
else {
Materialize.toast("Email already exists", 10000);
}
}
});
}else {Materialize.toast('Input an Email!', 4000);}
});
$("#c").click(function(){
var pword1 = $("#pword1").val();
var pword2 = $("#pword2").val();
if (pword1 != "" && pword2 != "" ) {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/check_oldpassword.php',
data: {
pword1: pword1,
},
success:function(response) {
if (response == "success") {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/update_email.php',
data: {pword2:pword2},
success:function(response) {
if (response == "success") {
Materialize.toast("Password updated", 10000);
}
else {
Materialize.toast("Password not updated", 10000);
}
}
});
}
else {
Materialize.toast("Old email not the same", 10000);
}
}
});
}else {Materialize.toast('Input your old and new passwords!', 4000);}
});
});
// }else {Materialize.toast('Select a new name!', 4000);}
// }
</script>
</body>
</html>