-
Notifications
You must be signed in to change notification settings - Fork 3
/
admin.php
63 lines (61 loc) · 2.52 KB
/
admin.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
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . "toolkit.php";
if (session_status() == PHP_SESSION_NONE){
session_start();
}
checkLoggedAdmin();
if (isset($_POST['editUser'])){
header("Location: searchEditUser.php");
}
if (isset($_POST['editRoomBooking'])){
header("Location: roomBookSearch.php");
}
if (isset($_POST['editInstrumentBooking'])){
header("Location: instrumentBookSearch.php");
}
if (isset($_POST['editRooms'])){
header("Location: searchEditRoom.php");
}
if (isset($_POST['newRoom'])){
header("Location: aggiungiSala.php");
}
if (isset($_POST['addInstruments'])){
header("Location: aggiungiStrumentazione.php");
}
if (isset($_POST['editInstruments'])){
header("Location: searchEditInstruments.php");
}
if (isset($_POST['uploadImg'])){
header("Location: uploadImg.php");
}
$content = file_get_contents("struttura.html");
setTitle($content, "Pannello Amministrazione");
setUserStatus($content);
setupMenu($content, -1);
setAdminAreaFull($content, true);
setLangArea($content, $_SERVER['PHP_SELF']);
initBreadcrumbs($content, "Home", "index.php");
addBreadcrumb($content, "Pannello Amministrazione", "");
$admpanel = file_get_contents(__("struttura_adminpanel.html"));
$torepl = "<!--USER-->";
$admpanel = str_replace($torepl, $_SESSION['username'], $admpanel);
$torepl = "<!--CONTENUTO-->";
$replaced = str_replace($torepl, $admpanel, $content);
$statusline = "";
if (isset($_SESSION['statussuccess'])){
if ($_SESSION['statussuccess']==true){
$statusline="<div class='statussuccess'>" . $_SESSION['statusmessage'] . "</div>";
}else{
$statusline="<div class='statusfailed'>" . $_SESSION['statusmessage'] . "</div>";
}
unset($_SESSION['statussuccess']);
unset($_SESSION['statusmessage']);
}
$replaced = str_replace("<!--STATUS-->", $statusline, $replaced);
$xml = new DOMDocument();
$xml->loadHTML($replaced);
setHTMLNameSpaces($xml);
$replaced = $xml->saveXML($xml->documentElement);
addXHTMLdtd($replaced);
echo ($replaced);
?>