-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
242 lines (187 loc) · 10.3 KB
/
index.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
<?php
include("database/connect.php");
include("includes/session.php");
$result = $mysqli->query("SELECT * FROM `tb_appinfo`;");
if (isset($result) && $result->num_rows == 1) {
$appinfo = $result->fetch_assoc();
}
$result = $mysqli->query("SELECT * FROM `tb_ind_design` WHERE tb_user_ID = $session_userid;");
if (isset($result) && $result->num_rows == 1) {
$row = $result->fetch_assoc();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?php echo $appinfo["description"];?>">
<meta name="author" content="Erleiuat">
<title><?php echo $appinfo["title"];?></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<?php
if (preg_match("/(Trident\/(\d{2,}|7|8|9)(.*)rv:(\d{2,}))|(MSIE\ (\d{2,}|8|9)(.*)Tablet\ PC)|(Trident\/(\d{2,}|7|8|9))/", $_SERVER["HTTP_USER_AGENT"], $match) != 0) {
$fixCss=file_get_contents('css/evaStyles.min.css');
if(isset($row)){
$fixCss=str_replace("var(--hintergrund)", $row["hintergrund"],$fixCss);
$fixCss=str_replace("var(--akzentfarbe)", $row["akzentfarbe"],$fixCss);
$fixCss=str_replace("var(--schrift)", $row["schrift"],$fixCss);
$fixCss=str_replace("var(--link)", $row["link"],$fixCss);
} else {
$fixCss=str_replace("var(--hintergrund)", $appinfo["hintergrund"],$fixCss);
$fixCss=str_replace("var(--akzentfarbe)", $appinfo["akzentfarbe"],$fixCss);
$fixCss=str_replace("var(--schrift)", $appinfo["schrift"],$fixCss);
$fixCss=str_replace("var(--link)", $appinfo["link"],$fixCss);
}
echo '
<style>
.dashModuleIcon {
margin-bottom: -40px;
}
.dashModul {
padding-top: 0px !important;
}
'.$fixCss.'
</style>
';
} else {
if(isset($row)){
echo '
<meta name="theme-color" content="'.$row["akzentfarbe"].'"/>
<style>
:root {
--hintergrund: '.$row["hintergrund"].';
--akzentfarbe: '.$row["akzentfarbe"].';
--schrift: '.$row["schrift"].';
--link: '.$row["link"].';
}
body {
font-family: "MetaPro-Normal", sans-serif;
}
</style>
<link href="css/evaStyles.min.css" rel="stylesheet">
';
} else {
echo '
<meta name="theme-color" content="'.$appinfo["akzentfarbe"].'"/>
<style>
:root {
--hintergrund: '.$appinfo["hintergrund"].';
--akzentfarbe: '.$appinfo["akzentfarbe"].';
--schrift: '.$appinfo["schrift"].';
--link: '.$appinfo["link"].';
}
body {
font-family: "MetaPro-Normal", sans-serif;
}
</style>
<link href="css/evaStyles.css" rel="stylesheet">
';
}
}
?>
</head>
<?php
if(isset($_GET['adm'])){
echo '<body style="display: none">';
} else {
echo '<body>';
}
?>
<div class="loadScreen">
<span class="helper"></span><img class="img-responsive" id="loadingImg" src="img/loading.svg" alt="loadingImg"/>
</div>
<div id="pageContents" style="opacity: 0;">
<!-- Navigation -->
<div id="naviLink">
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top" id="slideMe" style="display: none;">
<div class="container">
<a class="navbar-brand" href="modul/dashboard/dashboard.php">
<img src="img/logo/basler/icon.png" width="40px" alt="Logo">
<span style="margin-left:10px;"><?php echo $appinfo["title"];?></span>
</a>
<button class="navbar-toggler custom-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<?php
$userID = ($mysqli->query("SELECT ID FROM tb_user WHERE bKey = '$session_username'")->fetch_assoc());
$sql1 = "SELECT mg.ID, mm.file_path, mm.title FROM tb_ind_nav AS mg INNER JOIN tb_modul AS mm ON mm.ID = mg.tb_modul_ID WHERE mg.tb_user_ID = " . $userID['ID'] . " ORDER BY mg.position";
$result = $mysqli->query($sql1);
if (isset($result) && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$link = '
<li class="nav-item">
<a class="nav-link" navLinkId="'. $row["ID"].'" href="'. $row["file_path"].'">'. $translate[$row["title"]].'</a>
</li>
';
echo $link;
}
} else {
$link = '
<li class="nav-item" id="editNavLink">
<a class="nav-link" href="modul/settings/settings.php">'. $translate[15].'</a>
</li>
';
echo $link;
}
if(isset($_GET['adm'])){
echo '
<li class="nav-item" id="editNavLink">
<a class="btn btn-warning" href="logout.php"><b>Back to my Account</b></a>
</li>
';
}
?>
</ul>
</div>
</div>
</nav>
</div>
<?php
if(isset($_GET['page']) && $_GET['page'] != ""){
if(strpos($_GET['page'], '/') !== false){
$pageLink = "modul/".$_GET['page'].".php";
} else {
$pageLink = "modul/".$_GET['page']."/".$_GET['page'].".php";
}
} else if(isset($_SESSION["user"]["currentPath"])){
$pageLink = $_SESSION["user"]["currentPath"];
} else {
$pageLink = "modul/dashboard/dashboard.php";
}
?>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<div page="<?php echo $pageLink; ?>" id="pageContent">
</div>
</div>
</div>
</div>
<!-- /.container -->
<footer class="footer" id="slideMeFoot" style="display: none;">
<div class="container">
<a class="foot-link" href="modul/settings/settings.php"><?php echo $translate[16] ?></a>
<b>|</b>
<a class="foot-link" href="modul/kontakt/kontakt.php"><?php echo $translate[263] ?></a>
<i> | <?php echo $_SESSION["user"]['username']; ?> </i>
<span>©
<a href="https://www.baloise.com/de/home.html"> Baloise </a> | 2018 |
<a href="https://github.com/baloise/eva"> <?php echo $appinfo["title"];?> v.1.2</a>
</span>
</div>
</footer>
</div>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script type="text/javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.1/moment.min.js"></script>
<?php include('./includes/useTranslations.php'); ?>
<script type="text/javascript" src="js/index.min.js"></script>
</body>
</html>