-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteamdetails.php
71 lines (64 loc) · 2 KB
/
teamdetails.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
<?php
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
?>
<center>
<link rel="stylesheet" href="css/jordan.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
table td{
color:white;
}
h3 {
color:white;
}
</style>
<?php
if(!empty($_GET['teamNum'])){
$teamNum = $_GET['teamNum'];
require_once('../../mysqli_connect.php');
$statQuery = "SELECT * FROM teams WHERE teamNum = ?";
$statStmt = mysqli_prepare($dbc, $statQuery);
mysqli_stmt_bind_param($statStmt, "i", $teamNum);
mysqli_stmt_execute($statStmt);
$response1 = mysqli_stmt_get_result($statStmt);
mysqli_stmt_close($statStmt);
if($response1){
echo '<h3>Stats For Team ' . $teamNum . '</h3><br><table>';
while($row = mysqli_fetch_array($response1)){
echo '<tr><td>Hab start</td><td>';
if($row['LevelTwoStart']==1){
echo "Yes</td></tr><tr>";
}else if($row['LevelTwoStart']==0){
echo "No</td></tr><tr>";
}else{
echo "</td></tr><tr>";
}
echo "<td>Ball Levals</td><td>";
echo $row['BallLevels'] . '</td></tr><tr>';
echo "<td>Hatch Levels</td><td>";
echo $row['HatchLevels'] . '</td></tr><tr>';
echo "<td>Climb Levels</td><td>";
echo $row['ClimbLevels'] . '</td></tr><tr>';
echo "<td>Practice Time</td><td>";
echo $row['PracticeTime'] . '</td></tr>';
}
echo '</table>';
}else{
echo "Couldn't issue database query";
echo mysqli_error($dbc);
}
$matchQuery = "SELECT m.MatchName FROM teams t LEFT JOIN performances p ON t.TeamNum = p.TeamNum LEFT JOIN matches m ON m.MatchNum = p.MatchID WHERE m.MatchNum ORDER BY m.MatchNum ASC";
mysqli_close($dbc);
}else{
echo "NOPE";
}
?>
<a href = "teams.php"> Back </a>
</center>