-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleague_table.php
More file actions
106 lines (91 loc) · 2.92 KB
/
league_table.php
File metadata and controls
106 lines (91 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<link href="main.css" rel="stylesheet" type="text/css">
<!--League table data is store in this file-->
<?php
$str = file_get_contents('league_data.js');
echo "<script>var global_arr = ".$str."</script>";
include 'create_graph_data.php';
$chart_data=create_graph_data();
?>
<script src="jquery/jquery-2.2.3.min.js"></script>
<script src="Chart.js"></script>
<script> //Global Variables
var lowest_position=1;
var lowest_id=1;
var lowest_result_id=1;
var player_list="";
var is_admin=0
</script>
<script type="text/javascript" src="league_functions.js"></script>
<title>Table tennis league table</title>
</head>
<body onload="re_organise_positions();fill_table_function(global_arr,1)">
<h1>Table Tennis Upcoming fixtures <span>Swindon Silicon Systems</span></h1>
<p>All fixtures are a best of 3</p>
<p>You may only challenge players 3 places ahead of you</p>
<div id="fixtures_table">
</div>
<h1>Table Tennis League Table</h1>
<canvas id="myChart2" width="300" height="65"></canvas>
<div id="specialtable">
</div>
<form onSubmit="return addFixture();">
<table><tr><td>Add a new fixture:</td><td><select id="player_1" type="select" maxlength="30"></select></td><td><select id="player_2" type="select" maxlength="30"></select></td><td><input type="submit" value="ADD"></input></td></tr></table>
</form>
<form onSubmit="return addPlayer();">
<table><tr><td>Add a new player. Name:</td><td><input id="playersname" type="text" maxlength="30"></input></td><td>Email: <input id="playersemail" type="text" maxlength="50"></input></td><td><input type="submit" value="ADD"></input></td></tr></table>
</form>
<form onSubmit="return removePlayer();">
<table><tr><td>Remove a player:</td><td><select id="remove_playersname" type="select" maxlength="30"></select></td><td><input type="submit" value="Remove Player"></input></td></tr></table>
</form>
<p> </p>
<h3>Previous Results</h3>
<div id="results_table">
</div>
<p>To aceess some admin stuff put this at the end of your URL: ?admin=true</p>
</body>
<!-- BELOW IS CODE TO GENERATE THE GRAPH -->
<script>
var ctx = document.getElementById("myChart2");
var myChart = new Chart(ctx, {
type: 'line',
options: {
responsive: true,
backgroundcolor:'white',
title: {
display: true,
text: 'League Postion vs Time'
},
legend: {
position: 'right',
display: true
},
scales: {
xAxes : [{
gridLines : {
display: false
}
}],
yAxes : [{
gridLines : {
display: false
},
ticks: {
stepsize: 1,
maxTicksLimit: <? echo $chart_data[1]; ?>
}
}]
}
},
data: {
labels: [<?php echo $chart_data[2]; ?>],
datasets: [
<?php echo $chart_data[0]; ?>
]
},
});
</script>
<!-- END OF GRAPH GENERATING CODE -->
</html>