-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
executable file
·96 lines (86 loc) · 3.03 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
<?php
# CSV Output
# Settings
require_once("inc/settings.inc.php");
# Load saved svc file settings
require_once("inc/sources.inc.php");
# Load PHP functions
require_once("inc/functions.inc.php");
# Rendering of the HTML content begins here
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>CSV Viewer</title>
<link href="css/bootstrap.min.css" rel="stylesheet" media="all" type="text/css" />
<link href="css/bottombar.css" rel="stylesheet" media="all" type="text/css" />
<link href="css/csvtable.css" rel="stylesheet" media="all" type="text/css" />
<link rel="SHORTCUT ICON" href="images/favicon.ico" type="image/x-icon">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-alerts.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-buttons.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tabs.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-twipsy.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/csvviewer.js"></script>
</head>
<body style="padding-top: 40px;">
<div class="navbar navbar-fixed-top" data-dropdown="dropdown">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.php">CSV Viewer</a>
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reports</a>
<ul class="dropdown-menu">
<?php echo renderReportsNav(); ?>
</ul>
</li>
</ul>
</div>
</div>
</div>
<br />
<div class="container">
<div class="tabbable tabs-below">
<div class="tab-content" id="content">
<?php
if (strrpos($_GET["file"], ".csv") > 1) {
echo renderTable(loadCsv($_GET["file"]));
} elseif (strrpos($_GET["file"], ".inc.php") > 1) {
require_once($GLOBALS["reports_path"] . "/" . $_GET["file"]);
echo renderTable(runReport());
} else {
echo "<h2>Files:</h2>";
echo "<ul>" . renderCsvNav() . "</ul>";
echo "<br /><br /><h2>Reports</h2>";
echo "<ul>" . renderReportsNav() . "</ul>";
}
?>
</div>
<ul class="nav nav-tabs">
<?php echo renderCsvNav(); ?>
</ul>
</div>
</div>
<br />
<div class="bottombar">
<div class="fill">
<div class="container">
© by <?php echo $GLOBALS["author"]; ?>.
</div>
</div>
</div>
</body>
</head>