generated from akshatvg/template-materialize
-
Notifications
You must be signed in to change notification settings - Fork 4
/
loginFaculty.php
80 lines (67 loc) · 2.56 KB
/
loginFaculty.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
<!DOCTYPE html>
<html lang="en">
<?php
include("templates/metas.php");
?>
<!-- URLs -->
<meta name="url" content="https://exc-vtop.akshatvg.com/loginFaculty">
<meta property="og:url" content="https://exc-vtop.akshatvg.com/loginFaculty">
<link rel="canonical" href="https://exc-vtop.akshatvg.com/loginFaculty">
<?php
include("templates/header.php");
?>
<?php
include("templates/nav-vit.php");
?>
<!-- Main Content -->
<div class="container">
<!-- Login Form -->
<div class="row mt-5 mb-5">
<div class="w-100 w-md-50 mx-auto">
<div class="card white card-top-green">
<div class="card-content">
<span class="card-title black-text">EXC-VTOP Faculty Login</span>
<form method="POST" action="loginFaculty.php">
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="empId" name="empId" type="text" class="validate" maxlength="5" required>
<label for="empId">Employee ID</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">lock</i>
<input id="password" name="password" type="password" class="validate" required>
<label for="password">Password</label>
</div>
<div class="center">
<button id="loginFacultyBtn" name="loginFacultyBtn" class="btn btn-exc-green z-depth-0 waves-effect mb-n4" value="Login">Login</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
include("templates/footer.php");
?>
<?php
if (isset($_POST['loginFacultyBtn'])) {
// echo htmlspecialchars($_POST['empId']);
// echo htmlspecialchars($_POST['password']);
if (empty($_POST['empId'])) {
echo "<script>M.toast({ html: 'Employee ID cannot be empty' });</script>";
} else {
$empId = $_POST['empId'];
if (!preg_match('/[0-9]{5}/', $empId)) {
echo "<script>M.toast({ html: 'Employee ID must be a 5 digit series of numbers' });</script>";
}
}
if (empty($_POST['password'])) {
echo "<script>M.toast({ html: 'Password cannot be empty' });</script>";
} else { }
}
?>
</body>
</html>