-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.php
More file actions
56 lines (50 loc) · 1.64 KB
/
Functions.php
File metadata and controls
56 lines (50 loc) · 1.64 KB
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
<?php
function getNavigation()
{
if (isset($_SESSION["bypass"])) {
// User ist eingeloggt
if ($_SESSION["admin"] == 0) {
// User ist ein Admin
$replace = '
<a href="./fahrzeuge.php"><button type="" name="button">Fahrzeuge</button></a>
<a href="./profile.php"><button type="" name="button">Mein Profil</button></a>
';
} elseif ($_SESSION["admin"] == 1) {
// User ist ein Admin
$replace = '
<a href="./fahrzeuge.php"><button type="" name="button">Fahrzeuge</button></a>
<a href="./mitarbeiter.php"><button type="" name="button">Mitarbeiter</button></a>
<a href="./profile.php"><button type="" name="button">Mein Profil</button></a>
';
} //END ($_SESSION["admin"]==0)
} else {
// User ist nicht eingeloggt
$replace = '
<a href="./login.php"><button type="" name="button">Login</button></a>
';
} // Ende if($_SESSION["bypass"] == TRUE)
return $replace;
}
function getFahrzeugMenue()
{
if ($_SESSION["bypass"] == 1) {
// Ein Nutzer ist eingeloggt
if ($_SESSION["admin"] == 1) {
$replace = '
<div class="menue" style="padding: 10px;">
<button onclick="fahrzeugeClicked()" >Fahrzeug Liste</button>
<button onclick="fahrzeugAnlegenClicked()" >Fahrzeug anlegen</button>
</div>
';
} else {
$replace = '
<div class="menue" style="padding: 10px;">
<button onclick="fahrzeugeClicked()" >Fahrzeug Liste</button>
</div>
';
}
} else {
header('Location: ./');
}
return $replace;
}