-
Notifications
You must be signed in to change notification settings - Fork 1
/
authentication.php
163 lines (153 loc) · 7.65 KB
/
authentication.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
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
<?php
/**
* @package DEVELOPMENT OF MANAGEMENT INFORMATION SYSTEM FOR CAVITE STATE UNIVERSITY-AFFILIATED RENEWABLE ENERGY CENTER FOR REGION IV (CvSU-AREC IV)
*
* @copyright Copyright (C) 2019, All rights reserved.
* @license MIT License version or later; see licensing/LICENSE.txt
*/
session_start();
if(isset($_SESSION['login_user']))
{
header('location: dashboard');
}
?>
<!DOCTYPE html>
<html>
<?php
include("inc/main-head.php");
?>
<body class="login-page">
<div class="login-box" style="background-color: #408c40;">
<div class="text-center logo" >
<div style="height: 5px;"></div>
<h3 style="margin-top: 25px; color: white;">Login</h3>
</div>
<div class="card">
<div class="body">
<div id="sign_in" >
<div class="text-center msg">
<h3>Management Information System</h3>
<h5>CvSU</h5>
<img src="assets/images/cvsu_arec.png" alt="CvSU Logo" style="width: 100px;"><br><br>
<small>Login here using your username and password</small>
</div>
<div class="tab-content">
<div id="researcher" class="tab-pane fade in active">
<form action="data-login.php" method="POST" role="form">
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">person</i>
</span>
<div class="form-line">
<input type="text" class="form-control" name="username" placeholder="Username" required autofocus>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock</i>
</span>
<div class="form-line">
<input type="password" class="form-control" name="password" placeholder="Password" required>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<a class="btn btn-block bg-red waves-effect" data-toggle="tab" href="#register">REGISTER</a>
</div>
<div class="col-xs-6">
<button class="btn btn-block bg-blue waves-effect" type="submit" name="submit_login">SIGN IN</button>
</div>
</div>
</form>
</div>
<div id="register" class="tab-pane">
<form action="data-login.php" method="POST" role="form">
<div class="input-group">
<span class="input-group-addon">
</span>
<div class="form-line">
<input type="text" class="form-control" name="r_fname" placeholder="First Name" id="r_fname" required autofocus>
</div>
<span class="input-group-addon">
</span>
<div class="form-line">
<input type="text" class="form-control" name="r_lname" placeholder="Lastname" id="r_lname" required autofocus>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
</span>
<div class="form-line">
<input type="text" class="form-control" name="r_address" placeholder="Address" id="r_address" required autofocus>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
</span>
<div class="form-line">
<input type="text" class="form-control" name="r_contact" placeholder="Contact" id="r_contact" required autofocus onkeyup="allowedChar(this);" maxlength="11">
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">person</i>
</span>
<div class="form-line">
<input type="text" class="form-control" name="r_username" placeholder="Username" id="r_username" required autofocus>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock</i>
</span>
<div class="form-line">
<input type="password" class="form-control" name="r_password" id="r_password" placeholder="Password" minlength="6" required>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">lock</i>
</span>
<div class="form-line">
<input type="password" class="form-control" name="r_cpassword" id="r_cpassword" placeholder="Confirm Password" min="6" required>
</div>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="material-icons">email</i>
</span>
<div class="form-line">
<input type="email" class="form-control" name="r_email" placeholder="Email" id="r_email" required>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<a class="btn btn-block bg-red waves-effect" data-toggle="tab" href="#researcher">SIGN IN</a>
</div>
<div class="col-xs-6">
<button class="btn btn-block bg-blue waves-effect" type="submit" name="submit_register">REGISTER</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include("inc/main-js.php");
?>
<script type="text/javascript">
function allowedChar(elem) {
var validChars = /[0-9]/;
var strIn = elem.value;
var strOut = '';
for(var i=0; i < strIn.length; i++) {
strOut += (validChars.test(strIn.charAt(i)))? strIn.charAt(i) : '';
}
elem.value = strOut;
}
</script>
</body>
</html>