From f659fecf589c24e07de17987f6f70e05325a5b0a Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Thu, 27 Nov 2014 14:21:32 -0800 Subject: [PATCH] Take suite instead of suiteVersion as input.w --- website/overview/data-suite.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/website/overview/data-suite.php b/website/overview/data-suite.php index 1cb90aa..60ec60c 100644 --- a/website/overview/data-suite.php +++ b/website/overview/data-suite.php @@ -9,7 +9,7 @@ include "../internals.php"; init_database(); $machine = (int)$_GET["machine"]; -$suiteVersion = (int)$_GET["suiteVersion"]; +$suite = (int)$_GET["suite"]; $query = "SELECT id, stamp FROM `awfy_run` WHERE machine = $machine AND @@ -23,18 +23,19 @@ $row = mysql_fetch_array($results); $runId = $row[0]; $overview["machine"] = $machine; $overview["stamp"] = $row[1]; -$overview["suiteVersion"] = $suiteVersion; -if (!has_permissions()) { - $query = "SELECT awfy_suite.id FROM `awfy_suite` - LEFT JOIN awfy_suite_version on suite_id = awfy_suite.id - WHERE awfy_suite_version.id = $suiteVersion AND - visible = 1 - LIMIT 1"; - $results = mysql_query($query); - if (!$results || mysql_num_rows($results) != 1) - die(); -} +$query = "SELECT awfy_suite_version.id FROM `awfy_suite` + LEFT JOIN awfy_suite_version on suite_id = awfy_suite.id + WHERE awfy_suite.id = $suiteId "; +if (!has_permissions()) + $query .= "AND visible = 1 "; +$query .= "LIMIT 1"; +$results = mysql_query($query); +if (!$results || mysql_num_rows($results) != 1) + die(); +$row = mysql_fetch_array($results); +$suiteVersion = $row[0]; +$overview["suiteVersion"] = $row[0]; $query = "SELECT id, mode_id FROM `awfy_build` WHERE run_id = $runId";