-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaverages.php
More file actions
53 lines (46 loc) · 1.36 KB
/
averages.php
File metadata and controls
53 lines (46 loc) · 1.36 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
<?php include '/var/www/_database/database.php' ?>
<?php echo '<link rel="stylesheet" type="text/css" href="style.css">';?>
<center><h1 class="rainbowize">Averages</h1><center>
<?php
$result = mysqli_query($database,"select *,
AVG(AutonMoveBaseline),
AVG(AutonGearsScored),
AVG(AutonFuelScoredLow),
AVG(AutonCycle),
AVG(AutonFuelScoredHigh),
AVG(TeleopGearsMissed),
AVG(TeleopGearsScored),
AVG(TeleopFuelScoredHigh1+TeleopFuelScoredHigh2+TeleopFuelScoredHigh3+TeleopFuelScoredHigh4+TeleopFuelScoredHigh5+TeleopFuelScoredHigh6+TeleopFuelScoredHigh7+TeleopFuelScoredHigh8+TeleopFuelScoredHigh9) AS TELEOPHIGHAVG,
AVG(TeleopFuelScoredLow),
AVG(DefensiveSkill),
AVG(DefenseAvoidanceSkill),
AVG(GroundBallPickup),
AVG(Control),
AVG(Climb),
AVG(HopperPickUp),
AVG(GearFloorPickup),
AVG(GearHumanPickup),
AVG(ShootingCycles),
AVG(AutonFuelHighHopper)
FROM mytable GROUP BY TeamNum");
echo "<table border='1'>";
$i = 0;
while($row = $result->fetch_assoc())
{
if ($i == 0) {
$i++;
echo "<tr>";
foreach ($row as $key => $value) {
echo "<th>" . $key . "</th>";
}
echo "</tr>";
}
echo "<tr>";
foreach ($row as $value) {
echo "<td>" . $value . "</td>";
}
echo "</tr>";
}
echo "</table>";
mysqli_close($database);
?>