-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoperator.php
297 lines (283 loc) · 12.2 KB
/
operator.php
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
<?php
require_once("include/database.php");
$STH = $DB->prepare("SELECT user_password FROM users WHERE user_login = :login");
$got_password = md5($_POST["password"]);
$STH->execute(array("login" => $_POST["login"]));
$STH->setFetchMode(PDO::FETCH_NUM);
$pass = $STH->fetchAll();
if(count($pass) == 0) {
//echo "User not found";
?> <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="error_style.css" />
<title>Error</title>
</head>
<body id="body-error" class="noselect">
<div class="textbox">
<div class="user-icon"><i class="fa fa-user" aria-hidden="true"></i></div>
<p>User not found!</p>
</div>
</body>
</html> <?php
exit();
}
$pass = $pass[0][0];
if($pass == $got_password) { ?>
<!DOCTYPE html>
<?php
require_once 'include/container_list.php';
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Algorithm and structure visualisation</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="menu_style.css" />
<link rel="stylesheet" href="footer_style.css" />
<link rel="stylesheet" href="context_menu.css" />
<link rel="stylesheet" href="modal_add.css" />
<link rel="stylesheet" href="modal_style.css" />
<link rel="stylesheet" href="scene_buttons.css" />
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
</head>
<body class="noselect">
<!--Operator mode-->
<div class="operator">
<div id="header" class="header">
<div id="add-scene" class="plus-scene">+Добавить сцену</div>
</div>
<!--Drawing window-->
<div id="drawing">
<div class="menu-draw">
</div>
<!--Structures menu-->
<div id="structures-col">
<ul class="menu" id="available-containers">
<?php foreach ($containers as $container):
$id = strval($container["id"]);
?>
<li class="one-container" id=<?=$id?>><?=$container["container_name"]?></li>
<ul class="algorithm-list" id=<?="alg".$id?>></ul>
<?php endforeach; ?>
</ul>
<div id="add-a-container-div"><div id="add_a_container" class="one-container">+</div></div>
</ul>
</div>
</div>
<!--Footer-->
<div id="footer">
<div class="container">
<button class="btn btn2" id="no-alg">Сбросить</button>
<button class="btn btn4" id="op_button"> <a href="/?action=out" class="btn-ref" ="on">Выйти из режима
оператора</a></button>
</div>
</div>
</div>
<!--Context menu for removal-->
<nav class="context-menu" id="my-menu">
<ul class="context-menu__items">
<li class="context-menu__item">
<a href="#" class="context-menu__link" id="delete-container">
<i class="fa fa-eye"></i> Удалить
</a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" id="show-info">
<i class="fa fa-eye"></i> Посмотреть информацию
</a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" id="edit-info">
<i class="fa fa-eye"></i> Редактировать
</a>
</li>
</ul>
</nav>
<!--Context menu for a scene-->
<nav class="context-menu" id="scene-menu">
<ul class="context-menu__items">
<li class="context-menu__item">
<a href="#" class="context-menu__link" id="show-scene-button">
<i class="fa fa-eye"></i> Показать сцену
</a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" id="scene-delete-button">
<i class="fa fa-eye"></i> Удалить сцену
</a>
</li>
</ul>
</nav>
<!--Dialog window for entering info about a container-->
<div class="modal" id="modal-window">
<div class="modal-content" id="add-container-modal-content">
<div class="modal-header">
<span class="cross" id="cross1">×</span>
<h2>Добавить структуру данных</h2>
</div>
<div class="modal-body">
<div class="hint" id="struct-name">Название контейнера</div>
<input class="input-str" id="str-inp-name" type="text">
<div class="hint" id="struct-info">Описание</div>
<textarea name="Text1" cols="40" rows="10" class="input-str" id="str-inp-info"></textarea>
<btn class="confirm" id="conf">OK</btn>
</div>
<div class="modal-footer">
<h3> </h3>
</div>
</div>
</div>
<!--Modal window for displaying info about structures-->
<div id="list1Modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="closeBtn" id="cross0">×</span>
<h2 id="cont-name"></h2>
</div>
<div class="modal-body">
<p id="cont-descr"></p>
</div>
<div class="modal-footer">
<h3> </h3>
</div>
</div>
</div>
<!--Modal window for displaying info about an algorithm-->
<div id="modal-alg-info" class="modal">
<div class="modal-content" id="modal-alg-info-content">
<div class="modal-header">
<span class="closeBtn" id="cross5">×</span>
<h2 id="alg-name-info"></h2>
</div>
<div class="modal-body">
<p id="alg-descr"></p>
<h4>Сложность алгоритма:</h4>
<p id="alg-diff"></p>
</div>
<div class="modal-footer">
<h3> </h3>
</div>
</div>
</div>
<!--Dialog window for entering info about an algorithm-->
<div class="modal" id="dialog-add-alg">
<div class="modal-content" id="dialog-alg-add-content">
<div class="modal-header">
<span class="cross" id="cross2">×</span>
<h2 id="dialog-header">Добавить новый алгоритм</h2>
</div>
<div class="modal-body">
<div class="hint" id="alg-name">Имя алгоритма</div>
<input class="input-str" id="str-inp-alg-name" type="text">
<div class="hint" id="alg-info">Описание алгоритма</div>
<textarea name="Text1" cols="40" rows="10" class="input-str" id="str-inp-alg-info"></textarea>
<div class="hint" id="alg-dif">Сложность алгоритма</div>
<input class="input-str" id="str-inp-alg-dif" type="text">
<btn class="confirm" id="conf1">OK</btn>
</div>
<div class="modal-footer">
<h3> </h3>
</div>
</div>
</div>
<!--Dialog window for editing info about an algorithm-->
<div class="modal" id="dialog-edit-alg">
<div class="modal-content">
<div class="modal-header">
<span class="cross" id="cross3">×</span>
<h2 id="dialog-header">Редактировать информацию об алгоритме</h2>
</div>
<div class="modal-body">
<div class="hint" id="alg-name">Имя алгоритма</div>
<input class="input-str" id="str-edit-alg-name" type="text">
<div class="hint" id="edit-alg-info">Описание алгоритма</div>
<textarea name="Text1" cols="40" rows="10" class="input-str" id="str-edit-alg-info"></textarea>
<div class="hint" id="edit-alg-dif">Сложность алгоритма</div>
<input class="input-str" id="str-edit-alg-dif" type="text">
<btn class="confirm" id="conf3">OK</btn>
</div>
<div class="modal-footer" id="dialog-edit-alg-footer">
<h3> </h3>
</div>
</div>
</div>
<!--Dialog window for editing info about a container-->
<div class="modal" id="dialog-edit-container">
<div class="modal-content">
<div class="modal-header">
<span class="cross" id="cross4">×</span>
<h2>Редактировать информацию о контейнере</h2>
</div>
<div class="modal-body">
<div class="hint" id="struct-name">Название контейнера</div>
<input class="input-str" id="str-edit-container-name" type="text">
<div class="hint" id="struct-info">Описание</div>
<textarea name="Text1" cols="40" rows="10" class="input-str" id="str-edit-container-info"></textarea>
<btn class="confirm" id="conf4">OK</btn>
</div>
<div class="modal-footer" id="dialog-edit-container-footer">
<h3> </h3>
<h3> </h3>
</div>
</div>
</div>
<!--Dialog window for showing a scene-->
<div class="modal" id="modal-show-scene">
<div class="modal-content" id="modal-show-scene-content">
<div class="modal-header">
<span class="cross" id="cross6">×</span>
<h2>Просмотр сцены</h2>
</div>
<div class="show-scene-wrap">
<p class="modal-body" id="show-scene"></p></div>
<div class="modal-footer">
<h3> </h3>
</div>
</div>
</div>
<!--App's scripts-->
<script src="drawio-integration/diagram-editor.js"></script>
<script src="add_container.js" type="module"></script>
<script src="context_menu.js" type="text/javascript"></script>
<script src="modal.js" type="text/javascript"></script>
<script src="alg_list.js" type="text/javascript"></script>
<script src="alg_add.js" type="text/javascript"></script>
<script src="alg_delete.js" type="text/javascript"></script>
<script src="alg_edit.js" type="text/javascript"></script>
<script src="alg_select.js" type="text/javascript"></script>
<script src="container_edit.js" type="text/javascript"></script>
<script src="timings.js" type="text/javascript"></script>
<script src="delete_container.js"></script>
<script src="scene_add.js" type="text/javascript"></script>
<script src="scene_edit.js" type="text/javascript"></script>
<script src="scene_show.js" type="text/javascript"></script>
<script src="scene_delete.js" type="text/javascript"></script>
<script src="scene_swap.js" type="text/javascript"></script>
</body>
</html>
<?php
} else {
//echo "Incorrect password";
?> <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="error_style.css" />
<title>Error</title>
</head>
<body id="body-error" class="noselect">
<div class="textbox">
<div class="user-icon"><i class="fa fa-lock" aria-hidden="true"></i></div>
<p>Incorrect password!</p>
</div>
</body>
</html> <?php
}