index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-04-17 10:04:07 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-04-17 10:04:07 +0200 |
commit | 5c5ed42237757efcf698a36c37cf9bd0630232c3 (patch) | |
tree | 184a92122c95c33ccb09aa5db2955af2d32e2771 /buildmaster/statistics.php | |
parent | 8af016645fee5c0b22e69d46de9b3401c1bc82d3 (diff) |
-rw-r--r-- | buildmaster/statistics.php | 43 |
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; |