-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·130 lines (101 loc) · 5 KB
/
index.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
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="container">
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100 p-t-5 p-b-5">
<form class="login100-form validate-form">
<span>
<center><img src="images/lapis/login.png" width="50%"></center>
</span>
<div class="wrap-input100 validate-input m-t-15 m-b-15" data-validate="Enter email">
<input class="input100" type="text" name="email" id="email">
<span class="focus-input100" data-placeholder="Email"></span>
</div>
<div class="wrap-input100 validate-input m-b-50" data-validate="Enter password">
<input class="input100" type="password" name="pass" id="pass">
<span class="focus-input100" data-placeholder="Password"></span>
</div>
<div class="container-login100-form-btn">
<button class="login100-form-btn" id="login">
Login
</button>
</div>
<ul class="login-more p-t-50">
<li class="m-b-8">
<span class="txt1">
Forgot
</span>
<a href="forgotpassword.html" class="txt2">
Password?
</a>
</li>
<li>
<span class="txt1">
Don`t have an account?
</span>
<a href="signup.html" class="txt2">
Sign up
</a>
</li>
</ul>
</form>
</div>
</div>
</div>
</div> <!-- END container -->
<div class="site-cache" id="site-cache"></div>
<script src="js/jquery-1.11.1.js"></script>
<script src="js/index.js"></script>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="js/main.js"></script>
<script>
$(document).ready(function (e) {
document.getElementById("email").value = localStorage.getItem("email");
});
//Login Function
$("#login").click(function () {
var email = document.getElementById("email").value;
var password = document.getElementById("pass").value;
localStorage.setItem("email", email);
if ($.trim(email).length > 0 & $.trim(password).length > 0) {
$.ajax({
type: 'GET', //Request method: GET, POST
url: 'http://gemelligiuntinihci.altervista.org/myPHP/login.php', //Where to send the data
crossDomain: true,
cache: false,
data: {email, password},
success: function (data) {
/* first login professor */
if (data == "00") {
window.location.href = "professor/first_login/teaching.html";
}
/* normal login professor */
else if (data == "01") {
window.location.href = "professor/homepage.html";
}
/* first login student */
else if (data == "10") {
window.location.href = "student/first_login/general_info.html";
} else if (data == "11") {
window.location.href = "student/homepage.html";
} else if (data == "failed") {
alert("Login error");
} else if (data == "verify") {
window.location.href = "verifyEmail.html";
}
}
});
}
return false;
});
</script>
</body>
</html>