-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
70 lines (52 loc) · 1.05 KB
/
main.js
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
$(document).ready(function(){
$("#save").click(function(event){
event.preventDefault();
$.ajax({
url: "register.php",
method: "POST",
data:$("form").serialize(),
success: function(data){
$("#signup_msg").html(data);
}
})
});
$("#login").click(function(event){
event.preventDefault();
var email=$("#e").val();
var pass=$("#p").val();
$.ajax({
url:"login.php",
method:"POST",
data:'',
data:{userLogin:1,userEmail:email,userPassword:pass},
cache: false,
success : function(data){
//alert(data);
//alert(data);
if(data == 1)
window.location.href="student.php";
else if(data == 2){
window.location.href="parent.php";
}
else if(data == 3){
window.location.href="teacher.php";
}
else{
$("#login_msg").html(data);
}
}
})
});
$("#update").click(function(event){
event.preventDefault();
$.ajax({
url:"action.php",
method:"POST",
data:{userupdate:1},
success : function(data){
//alert(data);
window.location.href="student.php";
}
})
});
})