-
Notifications
You must be signed in to change notification settings - Fork 0
/
elements.php
94 lines (91 loc) · 2.39 KB
/
elements.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
<?php
function logo()
{
echo
"
<header>
<h1>
PhPanda
<i class=\"icon-database\"></i>
<a onclick=\"changeTheme()\">
<i id=\"themeChanger\" class=\"icon-moon\"></i>
</a>
</h1>
</header>
";
//? Should we make a logo
}
function menu()
{
echo
"
<nav>
<a href=\"./index.php\" title=\"Strona Główna\"><div><i class=\"icon-home\"></i><div>Strona Główna</div></div></a>
<div class=\"border\">=======</div>
<a href=\"./index.php?p=rebuild\" title=\"Odbuduj\"><div>Odbuduj</div></a>
<div class=\"border\">=======</div>
<a href=\"./index.php?p=repair\" title=\"Napraw\"><div>Napraw</div></a>
</nav>
";
}
function content()
{
require ('./content.php');
require ("./controllers.php");
echo
"
<section>
";
if (isset($_GET["p"])) {
switch ($_GET["p"]) {
case "rebuild":
if
(
isset($_POST["db_server"]) &&
isset($_POST["db_name"]) &&
isset($_POST["db_user"]) &&
isset($_POST["db_new_user_login"]) &&
isset($_POST["db_new_user_password"]) &&
isset($_POST["warning"]) &&
$_POST["warning"] === "true"
) {
rebuild(
$_POST["db_server"],
$_POST["db_name"],
$_POST["db_user"],
$_POST["db_password"],
$_POST["db_new_user_login"],
$_POST["db_new_user_password"],
);
} else {
$_POST = null;
rebuildContent();
}
break;
case "repair":
repairContent();
break;
default:
mainPage();
break;
}
} else {
mainPage();
}
echo
"
</section>
";
}
function footer()
{
echo
"
<div>
<footer>
Wszystkie prawa zastrzeżone. © 2024<br/>
Stworzone przez Marek7639
</footer>
</div>
";
}