From d0102c6fd4b188b0a1c5ffd3bf9a834a64a5c709 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Mon, 8 Jan 2018 16:30:56 +0100 Subject: Match info --- html/pages/match_info_charts.php | 65 +++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 34 deletions(-) (limited to 'html/pages/match_info_charts.php') diff --git a/html/pages/match_info_charts.php b/html/pages/match_info_charts.php index a6170e7..ed62fe5 100644 --- a/html/pages/match_info_charts.php +++ b/html/pages/match_info_charts.php @@ -11,15 +11,15 @@ $chartOutput = ""; $prevRenderedChart = ""; // get all charts for this match -$charts = mysql_query("SELECT d.* , t.charttype, t.category, t.type, t.color, t.layout,t.columns -FROM uts_chartdata d -JOIN uts_charttypes t ON d.chartid = t.id -WHERE d.mid = $mid -ORDER BY d.id ASC") or die(mysql_error()); +$charts = mysql_query("SELECT d.* , t.charttype, t.category, t.type, t.color, t.layout,t.columns + FROM uts_chartdata d + JOIN uts_charttypes t ON d.chartid = t.id + WHERE d.mid = $mid + ORDER BY d.id ASC") or die(mysql_error()); $chartCount = mysql_num_rows($charts); -if($chartCount >0) { +if ($chartCount >0) { $i = 0; // cycle over charts @@ -36,50 +36,47 @@ if($chartCount >0) { $data = unserialize(gzdecode($chart['data'])); $labels = unserialize(gzdecode($chart['labels'])); $categories = unserialize(gzdecode($chart['categories'])); - + // append previous chart - this is done to ensure proper outlining (can only know in +1 round) $chartOutput .= $prevRenderedChart; - + // print a new section if we're now in a different category - if($category != $prevCategory) { - - if(strlen($prevCategory)>0) + if ($category != $prevCategory) { + + if(strlen($prevCategory) > 0) $chartOutput .= renderFootBlock(); - + $chartOutput .= renderHeaderBlock($category); $prevCategory = $category; - + } else { - if($i>1 && $i%2 == 0) - $chartOutput .= ""; + if ($i>1 && $i%2 == 0) + $chartOutput .= ""; else - $chartOutput .= ""; - } - + $chartOutput .= ""; + } + $prevRenderedChart = renderChart($mid."-".$i,$layout,$color,$title,$data,$labels,$categories,$renderer_width*$columns,$renderer_heigth,$charttype); $i++; } - + // finishing up $chartOutput .= $prevRenderedChart; $chartOutput .= renderFootBlock(); - echo " - - "; - + echo ' + '; + echo $chartOutput; } - - -?> \ No newline at end of file +?> -- cgit