summaryrefslogtreecommitdiff
path: root/web-scripts
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-23 09:14:32 +0100
committerErich Eckner <git@eckner.net>2018-03-23 09:14:32 +0100
commit6f7e155ea0dd7f0e5894ec133be313bbdb4589ba (patch)
tree1efc0ae65f5abd6f2afd750b69014810169c72c1 /web-scripts
parentba6f43ca62a719d075cd23ccba35dbbab5f43951 (diff)
downloadbuilder-6f7e155ea0dd7f0e5894ec133be313bbdb4589ba.tar.xz
web-scripts/statistics.php: add option to chose time axis differently
Diffstat (limited to 'web-scripts')
-rw-r--r--web-scripts/statistics.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/web-scripts/statistics.php b/web-scripts/statistics.php
index 01bbb52..c919f93 100644
--- a/web-scripts/statistics.php
+++ b/web-scripts/statistics.php
@@ -1,5 +1,10 @@
<?php
+if (isset($_GET["from"]))
+ $min_time="from_base64(\"" . base64_encode("-".$_GET["from"]) . "\")";
+else
+ $min_time="\"-7 00:00:00\"";
+
$mysql = new mysqli("localhost", "webserver", "empty", "buildmaster");
if ($mysql->connect_error) {
die("Connection failed: " . $mysql->connect_error);
@@ -19,7 +24,7 @@ if (! $result = $mysql -> query(
"`statistics`.`blocked_tasks_count`," .
"`statistics`.`next_tasks_count`" .
"FROM `statistics` " .
- "WHERE `statistics`.`date`>=ADDTIME(NOW(),\"-7 00:00:00\") " .
+ "WHERE `statistics`.`date`>=ADDTIME(NOW()," . $min_time . ") " .
"ORDER BY `statistics`.`date`"
))
die($mysql->error);