Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/buildmaster
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-03-27 11:46:35 +0100
committerErich Eckner <git@eckner.net>2019-03-27 11:46:35 +0100
commit1c3eb159945e8f4c0f9006498c93cdcc19724cb9 (patch)
tree903fa8f2d09b477e93cd2002bcf9a570d9d7c96a /buildmaster
parentea8659f141fd14165af05bd9cd06bf95919447f2 (diff)
buildmaster/statistics.php: arch_filter_query() separated into lib/mysel.php
Diffstat (limited to 'buildmaster')
-rw-r--r--buildmaster/statistics.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/buildmaster/statistics.php b/buildmaster/statistics.php
index 05d06c6..7d706c6 100644
--- a/buildmaster/statistics.php
+++ b/buildmaster/statistics.php
@@ -2,29 +2,23 @@
require_once "../init.php";
require_once BASE . "/lib/mysql.php";
-if (array_key_exists("from",$_GET))
+if (array_key_exists("from", $_GET))
$min_time="from_base64(\"" . base64_encode("-".$_GET["from"]) . "\")";
else
$min_time="\"-7 00:00:00\"";
-if (array_key_exists("arch",$_GET)) {
- $arch_filter="`architectures`.`name` IN (\"\"";
- foreach (explode("&",$_SERVER["QUERY_STRING"]) as $param) {
- if (strpos($param,"arch=")!==0)
- continue;
- $arch_filter .= ",from_base64(\"" . base64_encode(substr($param,5)) . "\")";
- }
- $arch_filter .= ")";
- $combiner_left="";
- $combiner_right="";
- $grouper="";
- $joiner=" JOIN `architectures` ON `statistics`.`architecture`=`architectures`.`id`";
+if (array_key_exists("arch", $_GET)) {
+ $arch_filter = arch_filter_query("architectures");
+ $combiner_left = "";
+ $combiner_right = "";
+ $grouper = "";
+ $joiner = " JOIN `architectures` ON `statistics`.`architecture`=`architectures`.`id`";
} else {
- $arch_filter="1";
- $combiner_left="SUM(";
- $combiner_right=")";
- $grouper=" GROUP BY `statistics`.`date`";
- $joiner="";
+ $arch_filter = "1";
+ $combiner_left = "SUM(";
+ $combiner_right = ")";
+ $grouper = " GROUP BY `statistics`.`date`";
+ $joiner = "";
};
$column_list = array(