-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
277 lines (246 loc) · 15.6 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="stylesheet" href="assets/css/style.css" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" />
<title>Register|Login</title>
</head>
<body>
<div class="mb-5">
<nav>
<div class="nav nav-tabs d-flex justify-content-around" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="login-tab" data-toggle="tab" href="#login" role="tab" aria-controls="nav-home" aria-selected="true">Login</a>
<a class="nav-item nav-link" id="signup-tab" data-toggle="tab" href="#signup" role="tab" aria-controls="nav-profile" aria-selected="false">Signup</a>
</div>
</nav>
<div class="tab-content mt-5" id="nav-tabContent">
<div class="tab-pane fade show active" id="login" role="tabpanel" aria-labelledby="nav-home-tab">
<div class="container">
<div class="row">
<div class="col-sm-9 col-md-7 col-lg-5 mx-auto">
<div class="card card-login my-5">
<div class="card-body">
<h5 class="card-title text-center">Log In</h5>
<form class="form-signin" onsubmit="return validateLoginForm()" id="login-form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Email address" autofocus id="login-email" name="login-email">
<span class="text-danger font-weight-bold" id="login-email-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" id="login-password" name="login-password">
<span class="text-danger font-weight-bold" id="login-password-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Remember
password</label>
</div>
<button class="btn btn-lg btn-primary btn-block text-uppercase" type="submit">Sign in</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="signup" role="tabpanel" aria-labelledby="nav-profile-tab">
<div class="container">
<div class="row">
<div class="col-sm-9 col-md-7 col-lg-5 mx-auto">
<div class="card card-signup flex-row mt-0">
<div class="card-body">
<h5 class="card-title text-center">Sign Up</h5>
<form class="form-signup" onsubmit="return validateSignupForm()" id="signup-form">
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<input type="text" class="form-control" placeholder="First name" id="firstname">
<span class="text-danger font-weight-bold" id="firstname-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<input type="text" class="form-control" placeholder="Last name" id="lastname">
<span class="text-danger font-weight-bold" id="lastname-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
</div>
</div>
<div class="form-group">
<input type="text" name="Roll_Number" class="form-control" placeholder="Roll Number" id='roll-number'>
<span class="text-danger font-weight-bold" id="roll-number-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Phone Number" id='phone-number' name="phone-number" )>
<span class="text-danger font-weight-bold" id="phone-number-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Email address" id="signup-email">
<span class="text-danger font-weight-bold" id="signup-email-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="form-group ">
<input type="text " class="form-control" placeholder="Address" id='adress'>
<span class="text-danger font-weight-bold" id="adress-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="form-group ">
<input type="text" class="form-control" placeholder="City" id='city'>
<span class="text-danger font-weight-bold" id="city-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class="row ">
<div class="col-lg-6 ">
<div class="form-group ">
<input type="text " class="form-control " placeholder="State " id="state">
<span class="text-danger font-weight-bold" id="state-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
</div>
<div class="col-lg-6 ">
<div class="form-group ">
<input type="text " class="form-control " placeholder=" PIN Code " id="pincode">
<span class="text-danger font-weight-bold" id="pincode-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
</div>
</div>
<div class=" form-group ">
<input type="password" class="form-control" placeholder="Password" id='signup-password'>
<span class="text-danger font-weight-bold" id="signup-password-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<div class=" form-group ">
<input type="password" class="form-control" placeholder=" Confirm Password " id='confirm-password'>
<span class="text-danger font-weight-bold" id="signup-confirm-password-alert">
<!-- alerts innerHTML goes here -->
</span>
</div>
<button class=" btn btn-lg btn-primary btn-block text-uppercase " type="submit " id="signup-submit">Sign Up</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src=" https://code.jquery.com/jquery-3.5.1.slim.min.js " integrity=" sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj " crossorigin=" anonymous "></script>
<script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js " integrity=" sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo " crossorigin=" anonymous "></script>
<script src=" https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js " integrity=" sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI " crossorigin=" anonymous "></script>
<script src=" assets/ajax/index.js "></script>
<script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous">
</script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
$(document).ready(function() {
$("#signup-form").on('submit', (function(e) {
e.preventDefault();
var fname = $("#firstname").val()
var lname = $("#lastname").val();
var email = $("#signup-email").val();
var rollno = $("#roll-number").val();
var adress = $("#adress").val();
var city = $("#city").val();
var state = $("#state").val();
var pin = $("#pincode").val();
var password = $("#signup-password").val();
var cpass = $("#confirm-password").val();
var phoneno = $("#phone-number").val();
// console.log(name);
$.ajax({
url: 'apis/register.php',
data: {
fname: fname,
lname: lname,
email: email,
rollno: rollno,
phoneno: phoneno,
adress: adress,
city: city,
state: state,
pin: pin,
password: password,
cpass: cpass
},
type: 'POST',
success: function(response) {
console.log(response);
var res = JSON.parse(response);
if (res.status == "success") {
swal('Registration Successfull!', '', 'success').then((value) => {
window.location = 'index.html';
});
} else {
swal(res.message, '', 'error');
}
}
});
return false;
}));
return false;
});
</script>
<script>
$(document).ready(function() {
$("#login-form").on('submit', (function(e) {
e.preventDefault();
var loginEmail = $("#login-email").val();
var loginPassword = $("#login-password").val();
$.ajax({
url: 'apis/login.php',
data: {
loginEmail: loginEmail,
loginPassword: loginPassword,
},
type: 'POST',
success: function(response) {
console.log((response));
var res = JSON.parse(response);
if (res.status == "success") {
// alert(res.message);
swal('Login Successfull!', '', 'success').then((value) => {
window.location = 'views/index.html';
});
}
else if (res.status == "success1")
{
swal('Login Successfull!', '', 'success').then((value) => {
window.location = 'views/response.html';
});
}
else {
swal(res.message, '', 'error');
}
}
});
return false;
}));
return false;
});
</script>
</body>
</html>