summaryrefslogtreecommitdiff
path: root/html/pages/match_info_charts.php
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2018-01-14 11:28:01 +0100
committerGitHub <noreply@github.com>2018-01-14 11:28:01 +0100
commit76ab07b6646c807d321274bfdfb2814cffb6af90 (patch)
tree3878861d9f6c8c70fd5d638fb3ce58857cee00d5 /html/pages/match_info_charts.php
parentcbae6c7e376faf9b4a76ab0631d9da168545e41f (diff)
parent701165fded99ff9f70a4379444d9bd1432052c63 (diff)
Merge pull request #7 from sn3p/new-design4.4.0
New design
Diffstat (limited to 'html/pages/match_info_charts.php')
-rw-r--r--html/pages/match_info_charts.php65
1 files changed, 31 insertions, 34 deletions
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 .= "</td></tr><tr><td>";
+ if ($i>1 && $i%2 == 0)
+ $chartOutput .= "</td></tr><tr><td>";
else
- $chartOutput .= "</td><td>";
- }
-
+ $chartOutput .= "</td><td>";
+ }
+
$prevRenderedChart = renderChart($mid."-".$i,$layout,$color,$title,$data,$labels,$categories,$renderer_width*$columns,$renderer_heigth,$charttype);
$i++;
}
-
+
// finishing up
$chartOutput .= $prevRenderedChart;
$chartOutput .= renderFootBlock();
- echo "
- <script type='text/javascript'>
- function toggle_visibility(id) {
- var e = document.getElementById(id);
- if(e.style.display != 'none')
- e.style.display = 'none';
- else
- e.style.display = '';
- }
- </script>
- ";
-
+ echo '
+ <script type="text/javascript">
+ function toggle_visibility(id) {
+ var e = document.getElementById(id);
+ if (e.style.display != "none")
+ e.style.display = "none";
+ else
+ e.style.display = "";
+ }
+ </script>';
+
echo $chartOutput;
}
-
-
-?> \ No newline at end of file
+?>