-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminEventPlanner.php
More file actions
176 lines (167 loc) · 6.71 KB
/
adminEventPlanner.php
File metadata and controls
176 lines (167 loc) · 6.71 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Event Management System - Attendees</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
}
#sidebar {
position: fixed;
width: 250px;
height: 100%;
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
padding-top: 20px;
transition: all 0.3s;
overflow-y: auto; /* Enable vertical scrolling */
}
#sidebar a {
padding: 10px 15px;
text-decoration: none;
font-size: 15px;
color: #818181;
display: block;
transition: all 0.3s;
}
#sidebar a:hover {
color: #f8f9fa;
}
#content {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 250px; /* Adjust the width as needed */
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
padding: 15px;
color: #000;
overflow-y: auto; /* Enable vertical scrolling */
}
@media (max-width: 768px) {
#sidebar {
width: 100%;
height: auto;
position: relative;
}
#sidebar a {
padding: 10px;
}
#content {
margin-left: 0;
}
}
.table-responsive {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-dark active" id="sidebar">
<div class="text-center">
<h2 class="text-white">EventHive</h2>
</div>
<hr class="bg-light">
<ul class="list-unstyled">
<li><a href="admin.php"><i class="fas fa-home"></i> Dashboard</a></li>
<li><a href="adminEvent.php"><i class="fas fa-calendar-alt"></i> Events</a></li>
<li><a href="#"><i class="fas fa-users"></i> Attendees</a></li>
<li><a href="adminEventPlanner.php"><i class="fas fa-user-tie"></i> Event Planner</a></li>
</ul>
</div>
<!-- /#sidebar -->
<!-- Page Content -->
<div id="content" class="bg-light">
<nav class="navbar navbar-expand-lg navbar-light" style="background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);">
<!-- Button removed here -->
</nav>
<?php
session_start();
require 'eventClass.php';
$obj = new db();
$users = $obj->get_all_eventPlanner();
?>
<h2 align="center">Event Planner</h2>
<div class="container mt-4">
<div class="mb-3">
<input type="text" id="searchInput" class="form-control" placeholder="Search Event Planner by name or ID">
</div>
<h3>Event Planner List</h3>
<div class="table-responsive">
<?php if($users){ ?>
<table id="attendeesTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Department</th>
<th>Email</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach ($users as $user) {
echo "<tr>";
echo "<td>" . $user['studentId'] . "</td>";
echo "<td>" . $user['name'] . "</td>";
echo "<td>" . $user['department'] . "</td>";
echo "<td>" . $user['email'] . "</td>";
echo "<td>" . $user['phonenumber'] . "</td>";
echo "<td>";
echo "<button class='btn btn-success mr-2'><a href=adminEventPlannerUpdate.php?key_id=".$user['eventPlannerId']."><i class='fas fa-edit'></i></a></button>";
echo "<button class='btn btn-danger ml-2'><a href=adminEventPlannerDelete.php?key_id=".$user['eventPlannerId']."><i class='fas fa-trash-alt'></i></a></button>";
echo "</td>";
echo "</tr>";
}
}else{
echo "<h4>No attendees found</h4>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /#content -->
</div>
<!-- Bootstrap JS and dependencies -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
<script>
// Filter function for searching attendees by ID or name
function filterAttendees() {
var input, filter, table, tr, tdId, tdName, i;
input = document.getElementById("searchInput");
filter = input.value.toUpperCase();
table = document.getElementById("attendeesTable");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
tdId = tr[i].getElementsByTagName("td")[0]; // First column for ID
tdName = tr[i].getElementsByTagName("td")[1]; // Second column for name
if (tdId || tdName) {
var idText = tdId.textContent || tdId.innerText;
var nameText = tdName.textContent || tdName.innerText;
// Check if the ID or name contains the search input value
if (idText.toUpperCase().indexOf(filter) > -1 || nameText.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
// Attach event listener to the search input
document.getElementById("searchInput").addEventListener("keyup", filterAttendees);
</script>
</body>
</html>