-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewProfileAcademic.html
413 lines (320 loc) · 14.5 KB
/
viewProfileAcademic.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Profile Academic</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="adminPage.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/Bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/Bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/Bootstrap.min.js" integrity="sha384-IDwe1+LCz02ROU9k972gdyvl+AESN10+x7tBKgc9I5HFtuNz0wWnPclzo6p9vxnk" crossorigin="anonymous"></script>
<style>
.wrapper{
width: 450px;
border-radius: 7px;
background: #fff;
padding: 30px 25px 40px;
}
.wrapper :where(textarea,input,select,button){
width:100%;
outline: none;
border: none;
border-radius: 5px;
}
.wrapper textarea{
height: 270px;
resize: none;
padding: 8px 13px;
border: 1px solid #ccc;
}
.wrapper .file-option{
display: flex;
margin-top: 10px;
align-items: center;
justify-content: space-between;
}
.file-option .option{
width: calc(100% / 2 - 8px);
}
.option :where(input,.select-menu){
height: 50px;
padding: 0 15px;
margin-top: 6px;
border-radius: 5px;
border: 1px solid #bfbfbf;
}
.option .select-menu select{
height: 50px;
background: none;
}
.wrapper .save-btn{
margin-top: 20px;
padding: 16px 0;
background: #17A2B8;
}
.topic{
color: brown;
text-align: center;
margin-top: 10px;
}
</style>
</head>
<body class="d-flex flex-column min-vh-100">
<header>
<nav class="navbar navbar-expand-lg bg-body-tertiary ">
<div class="container-fluid">
<img src="Photos/Logo.png" alt="Bootstrap" width="90" height="40">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarSupportedContent">
<div class="navbar-nav ms-auto mb-2 mb-lg-0 n">
<div class="nav-item ">
<a class="nav-link " aria-current="page" href="index.html">Home</a>
</div>
<div class="nav-item">
<a class="nav-link " href="about.html">About</a>
</div>
<div class="nav-item">
<a class="nav-link " href="doctor.html">Doctors</a>
</div>
<div class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</div>
<div class="nav-item">
<a class="nav-link " href="index.html"><i class="bi bi-box-arrow-right"></i>Log out</a>
</div>
<div class="nav-item">
<a class="nav-link" href="http://127.0.0.1:5000">
<button type="button" class="btn btn-dark"><span class="bi bi-chat-quote-fill"></span></button>
</a>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="card-body p-1">
<h1 class="topic fw-bold">E-DOC</h1>
<h2 class="topic fw-bold">View Profile Academic</h2>
<div class="container mt-3 mt-3">
<div class="input-group mb-3">
<input id="SearchBar" type="text" class="form-control" placeholder="Search A Record" >
<select id="CategorySelected">
<option selected>Choose...</option>
<option value="1">Full Name</option>
<option value="2">Reg Number </option>
<option value="2">Email </option>
</select>
<button id="SearchBtn" class="btn btn-outline-primary ml-1" type="button" id="button-addon2">Search</button>
</div>
<table class="table table-striped bg-light table-bordered">
<thead>
<th></th>
<th>Full Name</th>
<th>Reg Number</th>
<th>Email</th>
<th>Tel Number</th>
</thead>
<tbody id="tbody1"></tbody>
</table>
</div>
<div class="modal fade" id="exampleModalCenter" tabindex="-10" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Create Medical Approve</h5>
<button type="button" class="btn-close float-end" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="wrapper">
<textarea>
SRI JAYEWARDENEPURA UNIVERSITY
HEALTH SERVICES
MEDICAL CERTIFICATE
Ref No:
Date :
This is to certify that Mr./Miss/Mrs. (Type here full name) of the Engineering Faculty was under treatment at the health Centre/ Referred for hospital treatment on (mention here).I recommended (mention no of days) leave from (date) due to (Reason).
Medical Officer
Medical Center
Faculty Of Engineering,
University Of SriJayewardanapura
</textarea>
<div class="file-option">
<div class="option file-name">
<label>File Name</label>
<input type="text" placeholder="Enter File Name">
</div>
<div class="option save-as">
<label>Save as</label>
<div class="select-menu">
<select>
<option value="text/plain">Text File (.txt)</option>
<!-- <option value="application/pdf">Pdf File (.txt)</option> -->
<option value="application/msword">Doc File (.txt)</option>
<option value="text/javascript">JS File (.txt)</option>
<option value="application/vnd.ms-powerpoint">PPT File (.txt)</option>
</select>
</div>
</div>
</div>
<button class="save-btn">Save as Text File</button>
</div>
<div class="modal-footer">
<button type="reset" class="btn btn-secondary" data-dismiss="modal">Close</button>
<a href="https://mail.google.com/mail/u/1/#inbox">
<button type="button" class="btn btn-primary" id="update">SEND</button>
</a>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="module">
const textarea=document.querySelector("textarea"),
fileNameInput=document.querySelector(".file-name input"),
selectMenu=document.querySelector(".save-as select"),
saveBtn=document.querySelector(".save-btn");
selectMenu.addEventListener("change",()=>{
let selectedOption=selectMenu.options[selectMenu.selectedIndex].text;
saveBtn.innerText=`Save As ${selectedOption.split(" ")[0]} File`;
});
saveBtn.addEventListener("click",()=>{
const blob=new Blob([textarea.value],{type:selectMenu.value});
const fileUrl = URL.createObjectURL(blob);
const link = document.createElement("a");
link.download=fileNameInput.value;
link.href=fileUrl;
link.click();
});
//-------------------------------------Filling Table-----------------------//
var tbody=document.getElementById("tbody1");
var No=0;
function AddItemToTable(FirstName,RegNumber,Email,TelNumber){
let trow=document.createElement("tr");
let td0=document.createElement('td');
let td1=document.createElement('td');
let td2=document.createElement('td');
let td3=document.createElement('td');
let td4=document.createElement('td');
td0.innerHTML=++No;
td1.innerHTML=FirstName;
td2.innerHTML=RegNumber;
td3.innerHTML=Email;
td4.innerHTML=TelNumber;
td1.classList +="FullNameField";
td2.classList +="RegNumberField";
td3.classList +="EmailField";
td4.classList +="TelNumberField";
trow.appendChild(td0);
trow.appendChild(td1);
trow.appendChild(td2);
trow.appendChild(td3);
trow.appendChild(td4);
// var ControlDiv = document.createElement("div");
// //ControlDiv.innerHTML= '<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModdelCenter" onclick="FillBoxes(null)">Edit Record</button>';
// ControlDiv.innerHTML+= '<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter" onclick="FillTboxes('+No+')">Create Medical Approve</button>';
// trow.appendChild(ControlDiv);
tbody.appendChild(trow);
}
//------------------------------import + Configuration---------------------//
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.17.2/firebase-app.js";
import { getDatabase,set,ref,get,update,remove,child,onValue } from "https://www.gstatic.com/firebasejs/9.17.2/firebase-database.js";
const firebaseConfig = {
apiKey: "AIzaSyD6022n259Mf4FCqynEVJxCzzIDr2c9HHg",
authDomain: "se-mini-project-fcee4.firebaseapp.com",
databaseURL: "https://se-mini-project-fcee4-default-rtdb.firebaseio.com",
projectId: "se-mini-project-fcee4",
storageBucket: "se-mini-project-fcee4.appspot.com",
messagingSenderId: "574489212826",
appId: "1:574489212826:web:c1a7cbda00ed8c6fd72c23"
};
const app=initializeApp(firebaseConfig);
const db =getDatabase();
//-----------------------------Get All Data---------------------------------------//
function AddAllItemToTable(Student){
tbody.innerHTML="";
Student.forEach(element=>{
AddItemToTable(element.FirstName,element.RegNumber,element.Email,element.TelNumber);
});
}
function GetAllDataOnce(){
const dbRef=ref(db);
get(child(dbRef,"Acedamic Profile/"))
.then((snapshot)=>{
var Student=[];
snapshot.forEach(childSnapshot=>{
Student.push(childSnapshot.val());
});
AddAllItemToTable(Student);
})
}
window.onload=GetAllDataOnce;
var searchbar=document.getElementById("SearchBar");
var searchBtn=document.getElementById("SearchBtn");
var category=document.getElementById("CategorySelected");
var tbody=document.getElementById("tbody1");
function SearchTableByExactValues(Category){
var filter=searchbar.value.toUpperCase();
var tr=tbody.getElementsByTagName("tr");
var found;
for(let i=0;i<tr.length;i++){
var td=tr[i].getElementsByClassName(Category);
for(let j=0;j<td.length;j++){
if(td[j].innerHTML.toUpperCase()==filter){
found=true;
}
}
if(found){
tr[i].style.display="";
found=false;
}
else{
tr[i].style.display="none";
}
}
}
searchBtn.onclick=function(){
if(searchbar.value==""){
SearchTableByExactValues("FullNameField");
}
else if(category.value==1)
SearchTableByExactValues("FullNameField");
else if(category.value==2)
SearchTableByExactValues("RegNumberField");
else if(category.value==3)
SearchTableByExactValues("EmailField");
}
</script>
</div>
<footer class="bg-dark text-center text-white mt-auto ">
<hr class="m-0" />
<div class="text-center py-2 align-items-center" style="background-color: rgba(0, 0, 0, 0.2);">
<div class="name">
<p>University of Sri Jayewardenepura<br>
Gangodawila, Nugegoda, Sri Lanka.</p>
</div>
<div class="name">
<p>+94 11 2758000, +94 11 2802022<br>
+94 11 2801024, +94 11 2801025</p>
</div>
</a>
</div>
<!-- Copyright -->
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
© 2023 Copyright:
<p><a href="https://www.sjp.ac.lk/" target="blank">[email protected]</a></p>
</div>
<!-- Copyright -->
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>