forked from nxvipin/Paathshaala
-
Notifications
You must be signed in to change notification settings - Fork 7
/
editprofile.html
104 lines (95 loc) · 3.38 KB
/
editprofile.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
<script src='js/fileuploader.js' type="text/javascript"></script>
<link href='css/fileuploader.css' rel='stylesheet' type='text/css'>
<span class='fbTitle'>Edit your profile</span>
<span id='cross' onclick='hideEditProfile()'>X</span>
<div id='blueLine'></div>
<ul class='links'>
<li class='hilite'>Edit profile</li>
<li >Update password</li>
<li >Display Picture</li>
</ul>
<div class='content'>
<div class='panel' style='display:block;'>
<form class='feedbackForm'>
<input required id='pName' type='text' placeholder='Full name' /><br />
<input required id='pEmail' type='email' placeholder='Your Email' /><br />
<input disabled id='pUName' type='text' placeholder='You cant change your username' /><br />
<input required id='pRoll' type='text' placeholder='Institute roll number' /><br />
<input required id='pDesc' type='text' placeholder='One word to describe you' /><br />
<span id='feedbackFormSubmitProfile' class='grayButton'>Submit</span>
</form>
</div>
<div class='panel' style='display:none;'>
<form class='feedbackForm'>
<input required id='pWord' type='password' placeholder='Existing password' /><br />
<input required id='pWord1' type='password' placeholder='Enter new password' /><br />
<input required id='pWord2' type='password' placeholder='Repeat new password' /><br />
<span id='feedbackFormSubmitPasswd' class='grayButton'>Update password</span>
</form>
</div>
<div class='panel' style='display:none;'>
<form class='feedbackForm'>
<div id="fileUploader">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
<!-- or put a simple form for upload here -->
</noscript>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$('div#editProfile ul.links li').click(function() {
$(this).parent().children().removeClass('hilite');
$(this).addClass('hilite');
var numb = $('div#editProfile ul.links li').index(this);
$('div#editProfile div.content div.panel').hide().eq(numb).fadeIn("fast");
});
$('span#feedbackFormSubmitProfile').click(function() {
var profile = {} ;
profile.fname = $('input#pName').attr('value');
profile.roll = $('input#pRoll').attr('value');
profile.email = $('input#pEmail').attr('value');
if( profile.fname !=='' && profile.roll !=='' && profile.email !== '') {
$.post("response/userupdate.php" ,profile, function(data){
$('div.content').html(data);
setTimeout(function(){
hideEditProfile();
},1000);
});
} else {
alert("Fill in all the fields of the form.")
}
});
$('span#feedbackFormSubmitPasswd').click(function() {
var p = $('input#pWord1').attr('value'),
p1 = $('input#pWord1').attr('value'),
p2 = $('input#pWord2').attr('value');
if( p1 !== p2) {
alert("Enter the same password");
} else if ( p1.length < 6 ) {
alert("Password too short. Minimum 6 characters");
} else if ( p1 == $('span#profileUsername').text() ) {
alert("Password same as your username. Too insecure");
} else {
$.post("response/userupdate.php" , { 'oldPassword': p,'newPassword': p1 } , function(data){
$('div.content').html(data);
setTimeout(function(){
hideEditProfile();
},1000);
});
}
});
$('div#darkenScreenObject').click(function(){
hideEditProfile();
});
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('fileUploader'),
action: 'functions/upload.php',
debug: true
});
};
createUploader();
</script>
<!-- </div> -->