-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
253 lines (243 loc) · 8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IUS ID Decoder</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
scroll-behavior: smooth;
}
</style>
<link rel="icon" type="image/x-icon" href="fav.png" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous"
/>
</head>
<body>
<div class="container">
<div style="height: 100vh" class="row">
<div class="col align-items-center d-flex justify-content-center">
<div class="card mb-3" style="max-width: 540px">
<div class="row g-0">
<div class="col-md-4 col-6">
<img
src="main.jpg"
class="img-fluid h-100 rounded-start"
alt="..."
/>
</div>
<div class="col-md-8 col-6">
<div class="card-body">
<h5 class="card-title">ID Decoder</h5>
<form id="id_form" class="form-floating mb-3">
<input
name="id_input"
type="text"
class="form-control border-primary"
id="floatingInput"
placeholder="221010020"
/>
<label style="font-size: 15px" for="floatingInput"
>Ex: 221010020</label
>
</form>
<p class="card-text">
<small id="note" class="text-body-secondary"
>University of Scholars</small
>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Button trigger modal -->
<button
id="modal_hidden_btn"
type="button"
class="d-none btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#staticBackdrop"
>
Launch static backdrop modal
</button>
<!-- Modal -->
<div
class="modal fade"
id="staticBackdrop"
data-bs-backdrop="static"
data-bs-keyboard="false"
tabindex="-1"
aria-labelledby="staticBackdropLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="staticBackdropLabel">
Decoded Information of '<span id="input_id"></span>'
</h1>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<div class="table-responsive text-center">
<table class="table">
<tbody>
<tr>
<td>
<span class="fw-bold">Admission Year:</span>
<span class="fst-italic fw-lighter" id="year">Mark</span>
</td>
</tr>
<tr>
<td>
<span class="fw-bold">Session:</span>
<span class="fst-italic fw-lighter" id="session"
>Mark</span
>
</td>
</tr>
<tr>
<td>
<span class="fw-bold">Department:</span>
<span class="fst-italic fw-lighter" id="department"
>Mark</span
>
</td>
</tr>
<tr>
<td>
<span class="fw-bold">Batch:</span>
<span class="fst-italic fw-lighter" id="batch">Mark</span>
</td>
</tr>
<tr>
<td>
<span class="fw-bold">Roll:</span>
<span class="fst-italic fw-lighter" id="roll">Mark</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-bs-dismiss="modal"
>
Close
</button>
</div>
</div>
</div>
</div>
</body>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"
></script>
<script>
document.getElementById("id_form").addEventListener("submit", (e) => {
e.preventDefault();
f = false;
let id = e.target.id_input.value;
let current_year;
if (parseInt(id)) {
id = parseInt(id);
if (parseInt(id / 100000) >= 1710) {
if (id.toString().length === 9) {
current_year = new Date().getFullYear().toString().substr(2);
current_year = parseInt(current_year);
if (current_year >= parseInt(id.toString().substr(0, 2)) && id) {
f = true;
id = id.toString();
let year = id.substr(0, 2);
let session = id.substr(2, 2);
let dept = id.substr(4, 2);
let roll = id.substr(6);
//Decode Year
let d_year =
new Date().getFullYear().toString().substr(0, 2) + year;
//Decode Session
let d_session;
if (session === "10") {
d_session = "Spring";
} else if (session === "20") {
d_session = "Fall";
} else {
f = false;
}
//Decode Dept
let d_dept;
if (dept === "10") {
d_dept = "CSE";
} else if (dept === "40") {
d_dept = "English";
} else if (dept === "20") {
d_dept = "EEE";
} else if (dept === "30") {
d_dept = "Textile";
} else if (dept === "50") {
d_dept = "BBA";
} else {
f = false;
}
//Decode Roll
let d_roll = roll;
//Decode Batch
let flag = false;
let batch = 1;
let temp = 17;
while (true) {
if (parseInt(id.substr(0, 2)) == temp) {
if (id.substr(2, 1) === "2") {
batch++;
break;
}
break;
}
batch += 2;
temp++;
}
//Attached Info
document.getElementById("year").innerText = d_year;
document.getElementById("department").innerText = d_dept;
document.getElementById("session").innerText =
d_session + "-" + d_year.substr(2);
document.getElementById("roll").innerText = d_roll;
document.getElementById("input_id").innerText = id;
document.getElementById("batch").innerText = batch;
}
}
}
}
if (f == true) {
note.style.removeProperty("color");
note.innerText = "University of Scholars";
id.value = e.target.id_input.value = "";
document.getElementById("modal_hidden_btn").click();
} else {
const note = document.getElementById("note");
note.innerText = "Invalid Id!";
note.style.setProperty("color", "red", "important");
}
});
</script>
</html>