diff options
author | Matthijs Kuiper <info@matthijskuiper.nl> | 2018-01-08 23:47:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-08 23:47:23 +0100 |
commit | e861eafbeae0560add7956530d76de6cc285be20 (patch) | |
tree | c32e746977fde711cecd716570989014bf2d3592 /html/pages/admin/check.php | |
parent | 66b162b5f01c996fd8a5cd4e570e31f8483cdffa (diff) | |
parent | 730c20dd04b5753cb372a289923e39516d1f8b87 (diff) |
Merge pull request #5 from randommonk/develop4.3.0
Bumped version to 4.3. Added jpgraph stats developed by killerEye
Diffstat (limited to 'html/pages/admin/check.php')
-rwxr-xr-x | html/pages/admin/check.php | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php index a03bf91..938d036 100755 --- a/html/pages/admin/check.php +++ b/html/pages/admin/check.php @@ -299,6 +299,34 @@ CREATE TABLE `uts_weaponstats` ( ) ENGINE=MyISAM; "; +$create_table['uts_chartdata'] = " +CREATE TABLE `uts_chartdata` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `mid` int(11) NOT NULL, + `chartid` mediumint(9) NOT NULL, + `title` varchar(50) NOT NULL, + `data` blob NOT NULL, + `labels` blob NOT NULL, + `categories` blob NOT NULL, + PRIMARY KEY (`id`), + KEY `mid` (`mid`), + KEY `mid_2` (`mid`) +) ENGINE=MyISAM; +"; + +$create_table['uts_charttypes'] = " +CREATE TABLE `uts_charttypes` ( + `id` mediumint(9) NOT NULL, + `category` varchar(25) NOT NULL, + `type` varchar(50) NOT NULL, + `color` varchar(10) NOT NULL, + `layout` text NOT NULL, + `charttype` varchar(15) NOT NULL, + `columns` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; +"; + foreach ($create_table as $table => $query) { echo ' <tr> @@ -321,6 +349,59 @@ foreach ($create_table as $table => $query) { } echo ' </tbody></table><br>'; + +// check graph types - have to use id since no other unique key except composite ones. +$create_charttype['90'] = "INSERT INTO `uts_charttypes` VALUES (90, 'Frags Team', 'teamScore', 'team', 'title: {\ntext: ''Battle for #1''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['20'] = "INSERT INTO `uts_charttypes` VALUES (20, 'Domination', 'teamScore', 'team', 'title: {\ntext: ''Score''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['21'] = "INSERT INTO `uts_charttypes` VALUES (21, 'Domination', 'teamDeriv', 'team', ' title : {\n text : ''Score''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''Dom Score''\n },\n min: 0,\n floor: 0,\n opposite: true\n },{\n title: {\n text: ''net dom points per min''\n },\n min: 0,\n floor: 0\n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\npointPlacement: ''between'', pointPadding : 0,\npointRange: 1, groupPadding : 0.2, borderWidth : 0, shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1);"; +$create_charttype['92'] = "INSERT INTO `uts_charttypes` VALUES (92, 'Frags Team', 'teamNormal', 'team', 'title: {\ntext: ''Spread vs #2 team''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['91'] = "INSERT INTO `uts_charttypes` VALUES (91, 'Frags Team', 'teamDeriv', 'team', ' title : {\n text : ''Battle for #1''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },\n min: 0,\n floor: 0,\n opposite: true\n },{\n title: {\n text: ''frags per min''\n },\n min: 0,\n floor: 0\n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\n pointPadding : 0,\n groupPadding : 0,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1);"; +$create_charttype['93'] = "INSERT INTO `uts_charttypes` VALUES (93, 'Top fraggers', 'playerScore', 'player', 'title: {\ntext: ''Battle for #1''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['95'] = "INSERT INTO `uts_charttypes` VALUES (95, 'Top fraggers', 'playerNormal', 'player', 'title: {\ntext: ''Spread vs #2''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['94'] = "INSERT INTO `uts_charttypes` VALUES (94, 'Top fraggers', 'playerDeriv', 'player', 'title : {\n text : ''Battle for #1''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },allowDecimals : false,\n tickPositioner: function () {\n\n var maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),3);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n },\n \n \n opposite: true\n },{\n title: {\n text: ''frags per min''\n },allowDecimals : false, tickPositioner: function () {\n\n\n var maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),3);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n } \n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\n pointPadding : 0,\n groupPadding : 0,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1);"; +$create_charttype['96'] = "INSERT INTO `uts_charttypes` VALUES (96, 'Frags #5-8', 'playerScore5', 'player', 'title: {\ntext: ''Battle for #5''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; +$create_charttype['97'] = "INSERT INTO `uts_charttypes` VALUES (97, 'Frags #5-8', 'playerNormal5', 'player', 'title: {\ntext: ''Spread vs #5''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n}', 'line', 1);"; +$create_charttype['10'] = "INSERT INTO `uts_charttypes` VALUES (10, 'CTF Score', 'teamScore', 'team', 'title : {\n text : ''CTF Team Score''\n },\n\ntooltip: {\n\n positioner: function () {\n return { x: 10, y: 10 };\n },\nformatter:function() {\n\nif(this.point.tooltipdata === ''undefined'' || this.point.tooltipdata == null ) {\n return Math.floor(this.x)+''min ''+Math.round((this.x-Math.floor(this.x))*60)+''sec<br><span style=\"color: '' + this.series.color + ''\"></span> ''+this.series.name+'' : ''+this.y;\n} else {\nreturn Math.floor(this.x)+''min ''+Math.round((this.x-Math.floor(this.x))*60)+''sec<br><span style=\"color: '' + this.series.color + ''\"></span> ''+this.series.name+'' : ''+this.y+''<br>''+this.point.tooltipdata;\n}\n}\n\n},\n credits : {\n enabled : false\n },\n legend : {\n enabled : false\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },\n min: 0,\n floor: 0,\n allowDecimals: false,\n opposite: true\n }, {\n title: {\n text: ''grabs per min''\n },\n min: 0,\n allowDecimals: false,\n floor: 0\n }],\n plotOptions : {\n column : {\n pointPlacement: ''between'',\n pointPadding : 0,\npointRange: 1, groupPadding : 0.2,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linestepcolumn', 2);"; +$create_charttype['11'] = "INSERT INTO `uts_charttypes` VALUES (11, 'CTF Grabs', 'teamBreakdown', 'player', '\n title : {\n text : ''Grab conversion''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\ncategories: [''Red'',''Blue'']\n },\n yAxis: {\n \n title: '''',allowDecimals: false,\n reversedStacks: false,stackLabels: {\n enabled: true }\n },\n plotOptions : {\n bar : { \n stacking : ''normal'', borderWidth : 0\n }\n }', 'bar', 2);"; +$create_charttype['100'] = "INSERT INTO `uts_charttypes` VALUES (100, 'Items', 'Team Pickups', 'team', '\n credits : {\n enabled : false\n },\n title: {\n text: ''''\n },\n \n pane: {\n size: ''100%''\n },\n\n plotOptions: {\n series: {\n fillOpacity: 0.4\n }\n },\nxAxis: {\n tickmarkPlacement: ''on'',\n lineWidth: 0\n },\n\n yAxis: {\n labels: {enabled:false},\n tickPixelInterval: 25,\n tickPositions: [0,25,50,75,100],\n gridLineInterpolation: ''polygon'',lineWidth: 0\n },\ntooltip: { \nvalueSuffix: '' %'' }', 'radar', 1);"; +$create_charttype['101'] = "INSERT INTO `uts_charttypes` VALUES (101, 'Items', 'Player Pickups', 'player', ' credits : {\n enabled : false\n },\n title: {\n text: ''''\n },\n \n pane: {\n size: ''100%''\n },\n\n plotOptions: {\n series: {\n fillOpacity: 0.4\n }\n },\nxAxis: {\n tickmarkPlacement: ''on'',\n lineWidth: 0\n },\n\n yAxis: {\n labels: {enabled:false},\n tickPixelInterval: 25,\n ickPositions: [0,25,50,75,100],\n gridLineInterpolation: ''polygon'',lineWidth: 0\n },\ntooltip: { \nvalueSuffix: '' %'' }', 'radar', 1);"; +$create_charttype['102'] = "INSERT INTO `uts_charttypes` VALUES (102, 'Items', 'ampRuns', 'team', 'title : {\n text : ''Amp runs net points''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : false\n },\n xAxis : {\n title : '''',\n tickPosition: ''inside'',\n labels: {\n align: ''left'',\n overflow: false,\n x:5,\n y:3,\n style: { whiteSpace: ''nowrap'' }\n }\n },\n yAxis : {\n\n title : '''',\n allowDecimals : false,\n reversedStacks : false,\n tickPositioner: function () {\nvar maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),6);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-maxDeviation,-2*thirdMaxDeviation,-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n },\n stackLabels : {\n enabled : false\n }\n },\n plotOptions : {\n bar : {\n stacking : ''normal'',\n borderWidth : 0,\n pointPadding: 0.1,\n groupPadding: 0.1\n }\n },\n\ntooltip: {\nformatter:function() {\n return this.x+''<br><span style=\"color: '' + this.point.color + ''\">●</span>''+this.series.name+ '' : ''+this.y;}\n\n}', 'bar', 1);"; + + +echo ' + <table class="box" border="0" cellpadding="1" cellspacing="2"> + <tr> + <td class="smheading" align="center" height="25" width="550" colspan="2">Checking all graphs types are in database</td> + </tr>'; +if (small_count("SHOW TABLES LIKE 'uts_charttypes'") != 1) { + // database exists, check columns + echo ' + <td class="warn" align="left" width="550" colspan = "2">Table uts_charttypes does not exist!</td></tr>'; +} +else { + foreach ($create_charttype as $charttype => $query) { + echo ' + <tr> + <td class="smheading" align="left" width="350">', $charttype, '</td>'; + if (small_count("SELECT id FROM uts_charttypes WHERE id = '$charttype' LIMIT 0,1") == 1) { + // database exists, check columns + echo ' + <td class="grey" align="left" width="200">OK</td></tr>'; + } + else { + if (mysql_query($query)) { + echo ' + <td class="grey" align="left" width="200">Added</td></tr>'; + } + else { + echo ' + <td class="warn" align="left" width="200">Not found!</td></tr>'; + } + } + } +} +echo ' + </tbody></table><br>'; // Check the weapons $create_weapon['Translocator'] = "INSERT INTO `uts_weapons` VALUES (1, 'Translocator', 'trans.jpg', 1, 'N');"; |