-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.php
68 lines (68 loc) · 1.48 KB
/
tests.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
<?PHP
//---
if (isset($_REQUEST['test'])) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
};
//---
include_once __DIR__ . '/header.php';
//---
if (user_in_coord == false) {
echo "<meta http-equiv='refresh' content='0; url=index.php'>";
exit;
};
//---
echo '<script>$("#tests").addClass("active");</script>';
//---
include_once __DIR__ . '/actions/functions.php';
include_once __DIR__ . '/Tables/sql_tables.php';
//---
$tests_folders = [];
foreach (glob('tests/*.php') as $file) {
$tests_folders[] = basename($file, '.php');
};
//---
$lis = '';
#---
foreach ($tests_folders as $item) {
$lis .= "<li id='$item' class='nav-item'><a class='linknave' href='tests.php?te=$item'>$item</a></li>";
};
//---
echo <<<HTML
<div class='row content'>
<div class='col-md-2'>
<ul class='flex-column'>
$lis
</ul>
</div>
<div class='px-0 col-md-10'>
<div class='container-fluid'>
<div class='card'>
HTML;
//---
$te = $_REQUEST['te'] ?? 'email';
//---
if (in_array($te, $tests_folders)) {
require "tests/$te.php";
} else {
include_once __DIR__ . '/coordinator/404.php';
};
//---
if (isset($te)) {
echo "<script>$('#" . $te . "').addClass('active');</script>";
};
//---
echo <<<HTML
</div>
</div>
</div>
</div>
</div>
</div>
</div>
HTML;
//---
include_once __DIR__ . '/foter.php';
//---
?>