-
Notifications
You must be signed in to change notification settings - Fork 1
/
games.php
62 lines (61 loc) · 2.81 KB
/
games.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
<!DOCTYPE html>
<html lang="en">
<?php
readfile("header.php");
?>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<span class="navbar-brand">Bobs Bowl Challenge</span>
<div class="container">
<ul class="nav navbar-nav">
<li role="presentation" ><a href="home.php">Home</a></li>
<li role="presentation" class="active"><a href="games.php">Games</a></li>
<li role="presentation" ><a href="leaders.php">Leaders</a></li>
</ul>
</div>
</nav>
<div class="container-fluid" style="padding-top: 70px;">
<table class="table table-hover table-striped table-fixedheader">
<?php
$data = file("data.csv");
$dataArray = [];
for($i=0; $i<count($data); $i++){
array_push($dataArray, explode(",",$data[$i]));
}
//Head
echo "<thead><tr>";
echo "<th class='date'>".$dataArray[0][0]."</th>";
//echo "<th class='time'>".$dataArray[0][1]."</th>";
//echo "<th class='tv'>".$dataArray[0][2]."</th>";
echo "<th class='bowl'>".$dataArray[0][3]."</th>";
for($i=6; $i<count($dataArray[0])-1; $i++){
echo "<th class='teamname'>".$dataArray[0][$i]."</th>";
}
echo "</tr></thead>";
//Body
echo "<tbody>";
for($i=1; $i<count($dataArray); $i++){
echo $modalTeam1;
echo "<tr>";
echo "<td class='date'>".$dataArray[$i][0]."</td>";
//echo "<td class='time'>".$dataArray[$i][1]."</td>";
//echo "<td class='tv'>".$dataArray[$i][2]."</td>";
echo "<td class='bowl'>".$dataArray[$i][3]."</td>";
echo "<td class='teamname'>"; if(empty($dataArray[$i][6])){echo "-";}else{echo $dataArray[$i][6];} echo "</td>";
echo "<td class='teamname'>"; if(empty($dataArray[$i][7])){echo "-";}else{echo $dataArray[$i][7];} echo "</td>";
echo "<td class='teamname'>"; if($dataArray[$i][8]==1){echo $dataArray[$i][6];}elseif($dataArray[$i][8]==2){echo $dataArray[$i][7];}else{echo "-";} echo "</td>";
for($j=9; $j<count($dataArray[$i])-1; $j++){
echo "<td class='teamname'>";
if($dataArray[$i][$j] == $dataArray[$i][8] && is_numeric($dataArray[$i][8])){echo "✔ ";}
elseif($dataArray[$i][$j] != $dataArray[$i][8] && is_numeric($dataArray[$i][8]) && !empty($dataArray[$i][8])){echo "✘ ";}
if($dataArray[$i][$j]==1){echo $dataArray[$i][6];}elseif($dataArray[$i][$j]==2){echo $dataArray[$i][7];}else{echo "-";}
echo "</td>";
}
echo "</tr>";
}
echo "</tbody>";
?>
</table>
</div>
</body>
</html>