-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.php
More file actions
119 lines (98 loc) · 2.81 KB
/
dashboard.php
File metadata and controls
119 lines (98 loc) · 2.81 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
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('server.php') ?>
<?php
if(! empty($_SESSION['username'])){ // checks if the user is logged in
}
else{
header("location: index.php"); // redirects if user is not logged in
}
?>
<!DOCTYPE html>
<html lang="en">
<?php include 'header.php';?>
<body>
<h4>Welcome to Free-Gigs,the Free Concert Website</h4>
<div class="wrapper">
<header>
<p><strong><?php echo $_SESSION['username']; ?></strong></p>
</header>
<section>
<div>
<nav>
<ul>
<h4>Admin Area</h4>
<p><strong>Welcome <?php echo $_SESSION['username']; ?></strong></p>
<p> <a href="bands.php" style="color: blue;">Manage Bands</a>
</p><p> <a href="venues.php" style="color: blue;">Manage Venues</a> </p>
<p> <a href="concerts.php" style="color: blue;">Manage Concerts</a> </p>
<p> <a href="logout.php" style="color: red;">logout</a> </p>
</ul>
</nav>
<div id="content-wrap">
<div id="info-wrap">
<div class="info"> <h5>Current bands</h5>
<?php $results = mysqli_query($db, "SELECT * FROM band"); ?>
<table>
<thead>
<tr>
<th>Band Id</th>
<th>Band Name</th>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>
<td><?php echo $row['band_id']; ?></td>
<td><?php echo $row['band_name']; ?></td>
</tr>
<?php } ?>
</table>
</div>
<div class="info"> <h5>Available Venues</h5>
<?php $results = mysqli_query($db, "SELECT * FROM venue"); ?>
<table>
<thead>
<tr>
<th>Venue Id</th>
<th>Venue Name</th>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>
<td><?php echo $row['venue_id']; ?></td>
<td><?php echo $row['venue_name']; ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<!--concert addition-->
<div class="info"> <h5>Concerts</h5>
<?php $results = mysqli_query($db, "SELECT c.concert_date,b.band_name,v.venue_name FROM concert as c JOIN venue v ON c.venue_id = v.venue_id JOIN band as b WHERE c.band_id = b.band_id");
?>
<table>
<thead>
<tr>
<th>Date</th>
<th>Band</th>
<th>Venue</th>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($results)) {
if (strtotime($row['concert_date']) > time()) { ?>
<tr>
<td><?php echo $row['concert_date']; ?></td>
<td><?php echo $row['band_name']; ?></td>
<td><?php echo $row['venue_name']; ?></td>
</tr>
<?php
}
}?>
</table>
</div>
</div>
</div>
</section>
<footer>
<p>Free-Gigs <?php echo date("Y");?></p>
</footer>
</body>
</html>