summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandommonk <randommonk@gmail.com>2018-01-05 22:05:40 +0000
committerrandommonk <randommonk@gmail.com>2018-01-05 22:05:40 +0000
commitf59e733e76e8d9fdd8949a4e715d6285367f89ac (patch)
tree0859b4c454277616241f953b37f459cb001b06cb
parent25f3706452bb77f20aaba25648e890da67673959 (diff)
Added charttype inserts to check.php
-rwxr-xr-xhtml/pages/admin/check.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php
index 7a8194c..938d036 100755
--- a/html/pages/admin/check.php
+++ b/html/pages/admin/check.php
@@ -349,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');";