-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
140 lines (136 loc) · 4.86 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
<!DOCTYPE html>
<html lang="ru">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-61547474-4"
></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())
gtag('config', 'UA-61547474-4')
</script>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="css/style.css" />
<title>Студаки МТУСИ</title>
</head>
<body class="bg-dark text-white">
<div class="container">
<div
class="alert alert-danger alert-dismissible fade show"
role="alert"
id="alert"
>
<strong>Внимание!</strong> Автор данного сайта не несет никакой
ответственности за базу данных используемую на нем.
<a
href="https://gist.github.com/WhiteNinjaRU/94081677ec934db68db34e2f2b9a35ab"
class="alert-link"
>Она находится в открытом доступе</a
>, доверяйте информации изложенной в ней на свой страх и риск.
<button
type="button"
class="close"
data-dismiss="alert"
aria-label="Close"
id="close-alert"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="row align-items-center">
<div class="col-12 mx-auto">
<div class="input-group input-group-lg">
<input
type="text"
class="form-control"
id="search-field"
placeholder="Введите ФИО"
aria-describedby="button-search"
/>
<div class="input-group-append">
<button class="btn btn-success" type="button" id="button-search">
Поиск
</button>
</div>
</div>
</div>
</div>
<div class="row align-items-center ans-box">
<div class="col-12 mx-auto">
<div class="jumbotron bg-white text-dark" id="jumbotron">
<div class="d-flex">
<div class="spinner-grow mx-auto" role="status">
<span class="sr-only">Загрузка...</span>
</div>
</div>
<div class="text-center">
<h5 class="font-400">
Поиск студенческого по фамилии, имени или отчеству
</h5>
</div>
</div>
</div>
</div>
</div>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<!-- Optional JavaScript -->
<script src="js/bd.js"></script>
<script>
function getCookie(name) {
let matches = document.cookie.match(
new RegExp(
'(?:^|; )' +
name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') +
'=([^;]*)'
)
)
return matches ? decodeURIComponent(matches[1]) : undefined
}
if (getCookie(`alert`) == `allreadyread`) {
document.getElementById('alert').style.display = 'none'
}
document.getElementById('close-alert').onclick = () => {
document.cookie = 'alert=allreadyread'
}
document.getElementById('button-search').onclick = () => {
document.getElementById(
'jumbotron'
).innerHTML = `<div class="d-flex" style=""><div class="spinner-grow mx-auto" role="status"><span class="sr-only">Загрузка...</span>`
let searchStr = document.getElementById('search-field').value
let readyList = ''
for (var i = 0; i < data.studDocs.length; i++) {
if (data.studDocs[i].name.includes(searchStr)) {
readyList =
readyList +
`<h5 class="">${data.studDocs[i].studNum} <small class="text-muted">${data.studDocs[i].name}</small></h5>`
}
}
if (readyList != '') {
document.getElementById('jumbotron').innerHTML = readyList
} else {
document.getElementById(
'jumbotron'
).innerText = `😥 Ничего не найдено.`
}
}
</script>
</body>
</html>