forked from bindle03/ewbUHMembershipManagement
-
Notifications
You must be signed in to change notification settings - Fork 0
/
members.php
87 lines (82 loc) · 3.04 KB
/
members.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
<?php
session_start();
require_once "pdo.php";
include 'nav.php';
include 'pass.php';
$stmt = $pdo->query("SELECT members.member_id, uh_id, first_name, last_name, member_type, major, email, phone_number, member_point, semester
FROM members JOIN semester_details JOIN semesters JOIN member_types
ON members.member_id = semester_details.member_id AND semesters.semester_id = semester_details.semester_id
AND member_types.member_type_id = semester_details.member_type_id WHERE semester_details.semester_id = " . $_GET['semester_id']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Members</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>Members</h1>
</div>
<div class="outer-wrapper">
<div class="table-wrapper">
<table>
<thead>
<th></th>
<th>UH ID</th>
<th>Name</th>
<th>Member Type</th>
<th>Major</th>
<th>Email</th>
<th>Phone number</th>
<th>Point</th>
</thead>
<tbody>
<?php
$i = 0;
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)):
$i++;
?>
<tr>
<td> <?= $i ?>
<td>
<?= $row['uh_id'] ?>
</td>
<td>
<a href="edit_member.php?semester_id=<?= $_GET['semester_id'] ?>&member=<?=$row['member_id']?>"><?= $row['first_name'] . " " . $row['last_name'] ?></a>
</td>
<td>
<?= $row["member_type"] ?>
</td>
<td>
<?= $row['major'] ?>
</td>
<td>
<?= $row['email'] ?>
</td>
<td>
<?= $row['phone_number'] ?>
</td>
<td>
<?= $row['member_point'] ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
<div class="button">
<a class="newEvent" href="semester.php" rel="nofollow noopener">Back</a>
</div>
</body>
</html>