-
Notifications
You must be signed in to change notification settings - Fork 1
/
events.php
76 lines (71 loc) · 2.31 KB
/
events.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
<?php
session_start();
require_once "pdo.php";
include 'nav.php';
include 'pass.php';
$stmt = $pdo->query("SELECT event_id, event_name, event_date FROM meetings WHERE semester_id = " . $_GET['semester_id'] . " ORDER BY event_date DESC");
$stmt2 = $pdo->query("SELECT * FROM semesters WHERE semester_id = " . $_GET['semester_id']);
$semester = $stmt2->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event List</title>
<link rel="stylesheet" href="resources\css\table.css">
</head>
<body>
<?php
if (!isset($_SESSION['pass']) || $_SESSION['pass'] !== $stored_hash) {
die("Hey, where's your password?");
}
$_SESSION['id'] = NULL;
?>
</div>
<div class="heading">
<h1><?= $semester['semester'] ?> - Events</h1>
</div>
<div class="outer-wrapper">
<div class="table-wrapper">
<table>
<thead>
<th></th>
<th>Event</th>
<th>Date</th>
<th>Attendance Taking Link</th>
</thead>
<tbody>
<?php
$i = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)):
$i++;
?>
<tr>
<td> <?= $i ?>
<td>
<a href="attendance.php?event_id=<?= $row['event_id'] ?>&semester_id=<?=$_GET['semester_id']?>">
<?= $row['event_name'] ?>
</a>
</td>
<td>
<?= $row['event_date'] ?>
</td>
<td>
<a href="checkin.php?event_id=<?= $row['event_id']?>&semester_id=<?= $_GET['semester_id'] ?>">
Link
</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
<div class="button">
<a class="newEvent" href="semester.php" rel="nofollow noopener">Back</a>
<a class="newEvent" href="newEvent.php?semester_id=<?=$_GET['semester_id']?>" rel="nofollow noopener">Plan something new?</a>
<a class="newEvent" href="newMember.php?semester_id=<?=$_GET['semester_id']?>" rel="nofollow noopener">New Member?</a>
</div>
</body>
</html>