/
index.php
98 lines (72 loc) · 3.24 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<?php include('mysqli_connect.php'); ?>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" media="screen" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/style.css" type="text/css">
<title>2016 San Diego Chargers Roster</title>
</head>
<body>
<header>
<a href="http://www.kuroppi.com/chargers"><img src="images/chargers_logo.png" alt="San Diego Chargers logo"></a>
</header>
<div class="container">
<h1>CHARGERS ROSTER</h1>
<table id="myTable" class="striped-table-odd">
<thead>
<tr>
<th>#</th>
<th>NAME</th>
<th>POS</th>
<th>HT.</th>
<th>WT.</th>
<th>EXP</th>
<th>COLLEGE</th>
</tr>
</thead>
<tbody>
<?php
$query = 'SELECT p.player_number, p.player_last_name, p.player_first_name, o.position, p.height, p.weight, p.experience, p.college
FROM players AS p
INNER JOIN
position AS o
on p.position_id = o.position_id
ORDER BY p.player_last_name';
if ($r = mysqli_query($dbc, $query)) {
while ($row = mysqli_fetch_array($r)) {
print "<tr>
<td>{$row['player_number']}</td>
<td>{$row['player_last_name']}, {$row['player_first_name']}</td>
<td>{$row['position']}</td>
<td>{$row['height']}</td>
<td>{$row['weight']}</td>
<td>{$row['experience']}</td>
<td>{$row['college']}</td>
</tr>";
}
}
mysqli_close($dbc);
?>
</tbody>
</table>
<a href="add_player.php" class="btn add-player">Add Player</a>
<a href="delete_player.php" class="btn delete-player">Delete Player</a>
</div>
<footer>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<script>
$(document).ready(function()
{
$("#myTable").tablesorter();
}
);
</script>
</body>
</html>