summaryrefslogtreecommitdiff
path: root/buildmaster/statistics.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
committerErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
commit5c5ed42237757efcf698a36c37cf9bd0630232c3 (patch)
tree184a92122c95c33ccb09aa5db2955af2d32e2771 /buildmaster/statistics.php
parent8af016645fee5c0b22e69d46de9b3401c1bc82d3 (diff)
downloadwebsite-5c5ed42237757efcf698a36c37cf9bd0630232c3.tar.xz
buildmaster/*.php: use lib/mysql.php
Diffstat (limited to 'buildmaster/statistics.php')
-rw-r--r--buildmaster/statistics.php43
1 files changed, 20 insertions, 23 deletions
diff --git a/buildmaster/statistics.php b/buildmaster/statistics.php
index 47f1418..8c13548 100644
--- a/buildmaster/statistics.php
+++ b/buildmaster/statistics.php
@@ -1,33 +1,30 @@
<?php
+include "lib/mysql.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);
-}
-if (! $result = $mysql -> query(
- "SELECT DISTINCT ".
- "UNIX_TIMESTAMP(`statistics`.`date`) AS `date`," .
- "`statistics`.`pending_tasks_count`," .
- "`statistics`.`pending_packages_count`," .
- "`statistics`.`staging_packages_count`," .
- "`statistics`.`testing_packages_count`," .
- "`statistics`.`tested_packages_count`," .
- "`statistics`.`broken_tasks_count`," .
- "`statistics`.`dependency_loops_count`," .
- "`statistics`.`dependency_looped_tasks_count`," .
- "`statistics`.`locked_tasks_count`," .
- "`statistics`.`blocked_tasks_count`," .
- "`statistics`.`next_tasks_count`" .
- "FROM `statistics` " .
- "WHERE `statistics`.`date`>=ADDTIME(NOW()," . $min_time . ") " .
- "ORDER BY `statistics`.`date`"
- ))
- die($mysql->error);
+$result = mysql_run_query(
+ "SELECT DISTINCT ".
+ "UNIX_TIMESTAMP(`statistics`.`date`) AS `date`," .
+ "`statistics`.`pending_tasks_count`," .
+ "`statistics`.`pending_packages_count`," .
+ "`statistics`.`staging_packages_count`," .
+ "`statistics`.`testing_packages_count`," .
+ "`statistics`.`tested_packages_count`," .
+ "`statistics`.`broken_tasks_count`," .
+ "`statistics`.`dependency_loops_count`," .
+ "`statistics`.`dependency_looped_tasks_count`," .
+ "`statistics`.`locked_tasks_count`," .
+ "`statistics`.`blocked_tasks_count`," .
+ "`statistics`.`next_tasks_count`" .
+ "FROM `statistics` " .
+ "WHERE `statistics`.`date`>=ADDTIME(NOW()," . $min_time . ") " .
+ "ORDER BY `statistics`.`date`"
+);
$t_min = -1;
$t_max = -1;