-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
33 lines (25 loc) · 1.05 KB
/
dashboard.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
<?php
include_once("lib/appLibLoader.php");
// Defaults
$actualConfig = Configuration::getInstance()->monthsOverview();
$startTime1 = date("Y-m-d 00:00:00");
$endTime1 = date("Y-m-d 23:59:59");
$timeLabelUnit = TimeHelper::prepareTimeUnit($startTime1, $endTime1);
// Prepare DB
$errorMsg = "";
$db = Database::getInstance();
$overviewPageService = new OverviewPageService($db->getPdoConnection());
$overviewPageService->calculateHourData($startTime1, $endTime1);
// configure VIEW
$pageTitle = "Dashboard";
$jsHeaderFiles = ["/js/utils.js", "js/dashboard/configureEnergyChart.js"];
$jsFooterFiles = ["/js/dashboard/documentReady.js"];
$cssFiles = ["/css/dasboardPage.css"];
$jsVars = [
"timestampsTooltip" => json_encode($overviewPageService->getLabelsTooltip()),
"timestampsXAxis" => json_encode($overviewPageService->getLabelsXAxis()),
"data1" => json_encode($overviewPageService->getData1List()->convertToJsChartArray()),
"timeLabelUnit" => json_encode($timeLabelUnit),
"config" => $actualConfig->toJson()
];
include("views/partials/layout.phtml");