forked from jkleiber/BBQ-FIRST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchamps.php
119 lines (103 loc) · 3.05 KB
/
champs.php
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
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
include('connect.php');
$query="SELECT * FROM `maintenance` LIMIT 1";
$sqli=$mysqli->query($query);
$row=mysqli_fetch_assoc($sqli);
$fleg=$row['flag'];
if($fleg=="minutes" || $fleg=="hours")
{
include 'downtime.php';
}
else
{
?>
<html>
<title>BBQ FIRST - Championship Division Rankings</title>
<!--
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon"
type="image/png"
href="http://bbqfrc.x10host.com/favicon.png">
<link rel="stylesheet" href="styler.css">
<link rel="stylesheet" href="mobile_styler.css">
<link rel="stylesheet" href="small_styler.css">
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.js"></script>
</head>
!-->
<?php include('navheader.html'); ?>
<script>
$(document).ready(function()
{
$("#divstable").tablesorter({cssAsc:"regionSortUp",cssDesc:"regionSortDown",cssHeader:"regionSort"});
}
);
function linktoevent(key, yr)
{
location.href = 'event_info.php?key=' + key + "&year=" +yr;
}
</script>
<body onload="load()">
<div id="container">
<div class="nav">
<a href="index.php" class="nav">
</a>
<a href="help.php" class="nav_txt">
Help
</a>
</div>
<br>
<br>
<h1>Championship Division Comparisons</h1>
<h5>You can sort columns by clicking the headers</h5>
<?php
error_reporting(E_ALL ^ E_NOTICE);
if($_GET['year'])
{
$year=$_GET['year'];
}
else
{
$year=2015;
}
$qq = "SELECT regional_info.reg_name, regional_info.year, regional_info.yearweek, regional_data.bbq, regional_data.sauce, regional_data.ribs, regional_data.bbq_pdq, regional_data.briquette, regional_info.sponsored, `regional_data`.`teams`, regional_data.reg_key
FROM regional_data
INNER JOIN regional_info
ON regional_data.reg_key=regional_info.reg_key
WHERE regional_info.reg_key = '2015gal' OR regional_info.reg_key = '2015carv' OR regional_info.reg_key = '2015hop' OR regional_info.reg_key = '2015cur' OR regional_info.reg_key = '2015arc' OR regional_info.reg_key = '2015new' OR regional_info.reg_key = '2015tes' OR regional_info.reg_key = '2015cars'";
$result = $mysqli->query($qq);
?>
<table id="divstable" class="region" style="width:90%">
<thead>
<th class="region">Division Name</th>
<th class="region">BBQ</th>
<th class="region">SAUCE</th>
<th class="region">BRIQUETTE</th>
<th class="region">RIBS</th>
<th class="region">Teams</th>
</thead>
<tbody>
<?php
while($r = $result->fetch_array(MYSQLI_ASSOC))
{
$vars = array($r["reg_key"], $r['year']);
$jsvars = json_encode($vars, JSON_HEX_TAG | JSON_HEX_AMP);
$jsvars = str_replace("[","", $jsvars);
$jsvars = str_replace("]","", $jsvars);
?>
<tr class="regions" onclick='linktoevent(<?php echo $jsvars; ?>)'>
<td><?php echo $r['reg_name']; ?></td>
<td><?php echo round($r['bbq'], 5); ?></td>
<td><?php echo round($r['sauce'], 5); ?></td>
<td><?php echo round($r['briquette'], 5); ?></td>
<td><?php echo round($r['ribs'], 5); ?></td>
<td><?php echo round($r['teams'], 5); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>