-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
75 lines (72 loc) · 2.83 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
<?php
include("classes/dbtool.php");
include("config.php");
echo "<html>";
echo "<head>";
echo " <meta charset='utf-8'>";
echo " <meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no'>";
echo " <title>MySQLiteSync</title>";
// <!-- Bootstrap -->
echo " <link href='includes/bootstrap/css/bootstrap.min.css' rel='stylesheet'>";
echo "</head>";
echo "<body>";
$dir=getcwd();
$dirdata=$dir."/data";
$dirconfig=$dir."/config.php";
$dirdb=$dir."";
if (!file_exists($dirconfig)) {
echo "<div class='alert alert-warning'>";
echo "Konfigurationsdatei config.php fehlt!<br>";
echo "</div>";
}
if (!file_exists($dirdata)) {
mkdir($dirdata, 0777, true);
if (!file_exists($dirdata)) {
echo "<h1 align='left'>".$headline."</h1>";
echo "<div class='alert alert-success'>";
echo "Bitte erzeugen Sie das Unterverzeichnis 'data' im Verzeichnis '".$dir."' mit Schreibrechten und rufen diese Seite zur weiteren Installation erneut auf.";
echo "</div>";
echo "<a href='index.php' class='btn btn-primary btn-sm active' role='button'>Neustart</a><br>";
} else {
include("classes/install.php");
}
} else {
$dirdb=$dirdata."/".$database;
if (!file_exists($dirdb)) {
include("classes/install.php");
} else {
//include("classes/checkupgrade.php");
//check_version();
$db = dbopen('','data/'.$database);
$parentid=$_GET['id'];
if ($parentid=="") {
$parentid='0';
}
echo "<div>";
echo "<h1 align='center'>".$headline."</h1>";
if ($admin=="J") {
$sql="SELECT * FROM tblmenu_liste WHERE fldview='J' AND fldid_parent='".$parentid."' ORDER BY fldsort";
} else {
$sql="SELECT * FROM tblmenu_liste WHERE fldview='J' AND fldadmin='N' AND fldid_parent='".$parentid."' ORDER BY fldsort";
}
$results = dbquery('',$db,$sql);
while ($row = dbfetch('',$results)) {
if ($row['fldmenu']=="SUBMENU") {
echo "<a href='index.php?id=".$row['fldindex']."&lastid=".$parentid."' class='btn btn-default btn-lg btn-block glyphicon ".$row['fldglyphicon']."' role='button'> ".$row['fldbez']."</a>";
} else {
if ($row['fldlink']<>"") {
echo "<a href='".$row['fldlink']."?id=".$parentid."' class='btn btn-default btn-lg btn-block glyphicon ".$row['fldglyphicon']."' role='button'> ".$row['fldbez']."</a>";
} else {
echo "<a href='classes/showtab.php?menu=".$row['fldmenu']."&id=".$parentid."' class='btn btn-default btn-lg btn-block glyphicon ".$row['fldglyphicon']."' role='button'> ".$row['fldbez']."</a>";
}
}
}
if ($parentid<>"0") {
echo "<a href='index.php?id=".$_GET['lastid']."' class='btn btn-default btn-lg btn-block glyphicon glyphicon-list' role='button'> zurück</a>";
}
echo "</div>";
}
}
echo "</body>";
echo "</html>";
?>