-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch.html
515 lines (458 loc) · 17.3 KB
/
search.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<!DOCTYPE html>
<html lang="en">
<head>
<title>THANA</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="formstyle.css">
<link href='http://fonts.googleapis.com/css?family=Bitter' rel='stylesheet' type='text/css'>
<link rel="icon" href="assets/blacklogo.png" type="image/icon type">
<style>
/* Center the loader */
#loader {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border: 16px solid #f3f3f3;
border-radius: 50%;
border-top: 16px solid black;
width: 120px;
height: 120px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Add animation to "page content" */
.animate-bottom {
position: relative;
-webkit-animation-name: animatebottom;
-webkit-animation-duration: 1s;
animation-name: animatebottom;
animation-duration: 1s
}
@-webkit-keyframes animatebottom {
from { bottom:-100px; opacity:0 }
to { bottom:0px; opacity:1 }
}
@keyframes animatebottom {
from{ bottom:-100px; opacity:0 }
to{ bottom:0; opacity:1 }
}
#myDiv {
display: none;
text-align: center;
}
</style>
</head>
<body onload="loading()">
<!-- NAVBAR -->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="assets/logoblk.png" width="60px"></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html"> Home </a></li>
<li><a href="about.html"> About Us </a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> Records <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="active"><a href="search.html"> Search Records </a></li>
<li style="cursor: pointer;"><a onclick="loginauth1()"> Add Criminal Records </a></li>
<li style="cursor: pointer;"><a href="modify.html"> Modify Criminal Records </a></li>
<li style="cursor: pointer;"><a href="delete.html"> Delete Criminal Records </a></li>
</ul>
</li>
<li><a href="contact.html"> Emergency Numbers </a></li>
<!-- MODAL LOGIN BUTTONS -->
<li>
<button class="btn" id="loginbtn" data-toggle="modal" data-target="#popUpWindow">
<span class="glyphicon glyphicon-log-in" ></span>
Log In
</button>
</li>
<li>
<button class="btn" id="btnLogout" style="display: none;" onclick="logout()">
<span class="glyphicon glyphicon-log-out"></span>
Log Out
</button>
</li>
</ul>
</div>
</div>
</nav>
<!-- MODAL LOGIN -->
<div class="container">
<div class="modal fade" id="popUpWindow">
<div class="modal-dialog">
<div class="modal-content">
<div id="login_div">
<!-- header -->
<div class="modal-header">
<h3 class="modal-title">Login</h3>
</div>
<!-- body -->
<div class="modal-header">
<form role="form">
<div class="form-group">
<input type="email" id= "txtEmail" class="form-control" placeholder="Email"/>
<br>
<input type="password" id="txtPassword" class="form-control" placeholder="Password" />
<br>
<input type="button" onclick="myFunction()" onmouseover="myFunction()" onmouseout="myFunction()" value="Show Password">
</div>
</form>
</div>
<!-- footer -->
<div class="modal-footer">
<button class="btn btn-block" id="btnLogin" onclick="login()">Log In</button>
</div>
</div>
<!-- success -->
<div id="user_div" class="modal-success" style="display: none;">
<h3 class="modal-title" style="text-align: center;">Logged In Successfully !!</h3>
</div>
</div>
</div>
</div>
</div>
<!-- JS for SHOW PASSWORD -->
<script>
function myFunction() {
var x = document.getElementById("txtPassword");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
<!-- MODAL LOGIN ENDS -->
<div style="padding: 2%; min-height: 45vw;">
<!-- FORM -->
<div class="form-style-10" style="display: none;">
<h1>Add to Criminal Record<span>Enter the Details of the Criminal</span></h1>
<form id="addCriminal">
<div class="section"><span>1</span>Personal Information</div>
<div class="inner-wrap">
<label>Full Name* <input type="text" id="cName" required></label>
<label>Gender*<br>
<input type="radio" id="cGender" name="gender" value="Male" required>Male
<input type="radio" id="cGender" name="gender" value="Female" required>Female
<input type="radio" id="cGender" name="gender" value="Other" required>Other
</label>
<label>Education <textarea id="cEducation"></textarea></label>
<label>Date of Birth* <input type="date" id="cDOB" required></label>
<label>Address<textarea id="cAdd"></textarea></label>
<label>Address of Hometown<textarea id="cHomeAdd"></textarea></label>
<label>Phone Number* <input type="tel" id="cPhone" pattern="[0-9]{10}" placeholder="10 Digits Phone Number Only" required></label>
<label>E-Mail Id <input type="email" id="cMail"></label>
<label>Father's Name <input type="text" id="cFather"></label>
<label>Mother's Name <input type="text" id="cMother"></label>
<label>Spouse's Name (if applicable) <input type="text" id="cSpouse"></label>
</div>
<div class="section"><span>2</span>Identification Details</div>
<div class="inner-wrap">
<label>Height (in cms) <input type="number" id="cHeight" min="0"></label>
<label>Weight (in kgs) <input type="number" id="cWeight" min="0"></label>
<label>Skin Colour <select id="cSkin">
<option value="" disabled selected hidden> Select </option>
<option value="Very Fair"> Very Fair </option>
<option value="Fair"> Fair </option>
<option value="Medium"> Medium </option>
<option value="Olive">Olive </option>
<option value="Brown">Brown </option>
<option value="Dark Brown"> Dark Brown </option>
</select>
</label>
<label>Body Type
<select id="cBody">
<option value="" disabled selected hidden> Select </option>
<option value="Skinny"> Skinny </option>
<option value="Athletic"> Athletic </option>
<option value="Bulky"> Bulky </option>
</select>
</label>
<label>Birth Mark (if any) <input type="text" id="cMark"></label>
</div>
<div class="section"><span>3</span>Past History</div>
<div class="inner-wrap">
<label>History of Crimes<textarea id="cCrimes"></textarea></label>
<label>Awards Announced by Various Agencies (if caught) <textarea id="cAwards"></textarea></label>
</div>
<div class="section"><span>4</span>Contact Persons</div>
<div class="inner-wrap">
<label>Format: Name & Relation (with Mobile Number) <textarea id="cContact"></textarea></label>
</div>
<div class="button-section">
<button id="submitForm"> Add Record</button>
</div>
</form>
</div>
<!-- FORM ENDS -->
<!-- TABLE -->
<div id="loader"></div>
<div style="display:none;" id="myDiv" class="animate-bottom">
<div style="padding: 5%;">
<h2 style="text-align: center;"> <b>Search Criminal Record</b></h2>
<br>
<table id="myTable">
<thead>
<tr>
<th>Name</th>
<th>Gender</th>
<th>Date of Birth</th>
<th>Phone Number</th>
</tr>
</thead>
<tbody id="table_bdy">
</tbody>
</table>
</div>
</div>
</div>
<!-- TABLE -->
<script>
function myFunction() {
var input, filter, table, tr, th, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
th = tr[i].getElementsByTagName("th")[0];
if (th) {
txtValue = th.textContent || th.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCnbcOpPwZDdKvlSz-cVFfXAME-VIjaVV8",
authDomain: "test-622c0.firebaseapp.com",
databaseURL: "https://test-622c0.firebaseio.com",
projectId: "test-622c0",
storageBucket: "test-622c0.appspot.com",
messagingSenderId: "81335831834",
appId: "1:81335831834:web:816865eafc5607b19970a3"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script>
var contactRef = firebase.database().ref().child("criminalRecord");
document.getElementById("addCriminal").addEventListener("submit",submitForm);
function submitForm(e){
e.preventDefault();
var Name = getInputVal("cName");
var Gender = getInputVal("cGender");
var Education = getInputVal("cEducation");
var DOB = getInputVal("cDOB");
var Add = getInputVal("cAdd");
var Home_Add = getInputVal("cHomeAdd");
var Phone = getInputVal("cPhone");
var Mail = getInputVal("cMail");
var Father = getInputVal("cFather");
var Mother = getInputVal("cMother");
var Spouse = getInputVal("cSpouse");
var Height = getInputVal("cHeight");
var Weight = getInputVal("cWeight");
var Skin = getInputVal("cSkin");
var Body = getInputVal("cBody");
var Mark = getInputVal("cMark");
var History = getInputVal("cCrimes");
var Awards = getInputVal("cAwards");
var Contact = getInputVal("cContact");
saveForm(Name, Gender, Education, DOB, Add, Home_Add, Phone, Mail, Father, Mother, Spouse, Height, Weight, Skin, Body, Mark, History, Awards, Contact);
document.getElementById('addCriminal').reset();
}
function getInputVal(id){
return document.getElementById(id).value;
}
function saveForm(Name, Gender, Education, DOB, Add, Home_Add, Phone, Mail, Father, Mother, Spouse, Height, Weight, Skin, Body, Mark, History, Awards, Contact){
var newContactRef = contactRef.push();
newContactRef.set({
Name: Name,
Gender: Gender,
Education: Education,
DOB: DOB,
Address: Add,
Hometown_Adress: Home_Add,
Phone_Number: Phone,
Mail_ID: Mail,
Father: Father,
Mother: Mother,
Spouse: Spouse,
Height: Height,
Weight: Weight,
Skin_Colour: Skin,
Body_Type: Body,
Birth_Marks: Mark,
Crime_History: History,
Awards: Awards,
Contact_Persons: Contact
})
}
contactRef.on("child_added", snap=>{
var Name = snap.child("Name").val();
var Gender = snap.child("Gender").val();
var DOB = snap.child("DOB").val();
var Phone = snap.child("Phone_Number").val();
$('#table_bdy').append("<tr> <td>"+Name+"</td> <td>"+Gender+"</td> <td>"+DOB+"</td> <td>"+Phone+"</td> </tr>");
});
</script>
<!-- Footer -->
<div class="footer">
<div class="f1">
<p class="linkfooter">
<img src="assets/logoblk.png" width="80px">
<br>
<br>
<a class="footerlink" href="index.html"> Home </a>
<br>
<a class="footerlink" href="about.html"> About Us </a>
<br>
<a class="footerlink" href="search.html"> Search Records </a>
<br>
<a class="footerlink" href="contact.html"> Emergency Numbers </a>
</p>
</div>
<div class="f2">
<p>
Project By:
<br>
Anmol Bansal (19BCE0630)
<br>
Gokul Nair (19BCE2245)
<br>
Harsh Londhekar (19BCE0496)
<br>
Suyash Johri (19BCE2201)
<br>
</p>
</div>
<br><br><br><br><br><br><br>
<hr color="red">
<span class="fl">
© Anmol Bansal, 2020, Version 1.4 (This website is for representation purpose only)
</span>
</div>
<!-- End of Footer -->
<!-- JS for LoginAuth -->
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCnbcOpPwZDdKvlSz-cVFfXAME-VIjaVV8",
authDomain: "test-622c0.firebaseapp.com",
databaseURL: "https://test-622c0.firebaseio.com",
projectId: "test-622c0",
storageBucket: "test-622c0.appspot.com",
messagingSenderId: "81335831834",
appId: "1:81335831834:web:816865eafc5607b19970a3"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script>
//on auth state change
firebase.auth().onAuthStateChanged(function(user) {
if (user)
{
// User is signed in.
document.getElementById("user_div").style.display = "block";
document.getElementById("login_div").style.display = "none";
document.getElementById("btnLogout").style.display = "block";
document.getElementById("loginbtn").style.display = "none";
}
else
{
// No user is signed in.
document.getElementById("user_div").style.display = "none";
document.getElementById("login_div").style.display = "block";
document.getElementById("btnLogout").style.display = "none";
document.getElementById("loginbtn").style.display = "block";
}
});
//for login
function login()
{
var txtEmail = document.getElementById("txtEmail").value;
var txtPass = document.getElementById("txtPassword").value;
firebase.auth().signInWithEmailAndPassword(txtEmail, txtPass).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
window.alert(errorMessage);
// ...
});
}
//for logout
function logout(){
firebase.auth().signOut();
location.reload();
}
//for add records authorisation
function loginauth1()
{
var user = firebase.auth().currentUser;
if (user)
{
location.replace("add.html");
}
else
{
window.alert("Login to Add in Criminal Record");
}
}
</script>
<!-- JS for LoginAuth Ends -->
<!-- JS for Loading -->
<script>
var myVar;
function loading() {
myVar = setTimeout(showPage, 5000);
}
function showPage() {
document.getElementById("loader").style.display = "none";
document.getElementById("myDiv").style.display = "block";
}
</script>
</body>
</html>