-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.php
More file actions
75 lines (66 loc) · 2.65 KB
/
Event.php
File metadata and controls
75 lines (66 loc) · 2.65 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
<?php
include "connect.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Events</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<button class="btn btn-primary my-5">
<a href="view_event.php" class="text-light"> Add Event </a>
</button>
<table class="table">
<thead class="thead-light">
<tr>
<th scope="col">EventID</th>
<th scope="col">EventName</th>
<th scope="col">EventDescription</th>
<th scope="col">EventDate</th>
<th scope="col">EventType</th>
<th scope="col">Participants</th>
<th scope="col">StudentID</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM event";
$result = mysqli_query($con, $sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
$eventID = $row['EventID'];
$eventName = $row['EventName'];
$eventDescription = $row['EventDescription'];
$eventDate = $row['EventDate'];
$eventType = $row['EventType'];
$participants = $row['Participants'];
$studentID = $row['StudentID'];
echo '
<tr>
<th scope="row">' . $eventID . '</th>
<td>' . $eventName . '</td>
<td>' . $eventDescription . '</td>
<td>' . $eventDate . '</td>
<td>' . $eventType . '</td>
<td>' . $participants . '</td>
<td>' . $studentID . '</td>
<td>
<button class="btn btn-danger"><a href="event_delete.php?deleteid=' . $eventID . '" class="text-light">Delete</a></button>
<button class="btn btn-danger"><a href="event_update.php?deleteid=' . $eventID . '" class="text-light">Update</a></button>
</td>
</tr>';
}
}
?>
<a href="index.php" style="float: right;"><button type="submit" class="btn btn-primary"
name="home">Home</button></a>
</tbody>
</table>
</div>
</body>
</html>