-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathevents.php
More file actions
executable file
·60 lines (47 loc) · 1.4 KB
/
events.php
File metadata and controls
executable file
·60 lines (47 loc) · 1.4 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
<?php
session_start();
include("global.php");
eventSecure();
?>
<html>
<head>
<link rel="stylesheet" href="styles/events.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div class="center-row">
<div class="event-btn">
<div class="btn-contents">
<h2>Select Event</h2>
<form id="selectedEvent" method="get" action="edit/general.php">
<select name="id">
<?php
// Get all the events from the database and add them to a selector
$get_events_stmt = $db->prepare("SELECT * from event WHERE admin=:user");
$get_events_stmt ->bindValue(":user",$_SESSION['username']);
$get_events_stmt->execute();
while($get_events_res = $get_events_stmt->fetch(PDO::FETCH_ASSOC)) {
echo '<option value="' . attrstr($get_events_res['ID']) . '">' . htmlstr($get_events_res['name']) . '</option>';
}
?>
</select>
<input type="submit" value="Select">
</form>
</div>
</div>
<div class="event-btn" onclick="newEvent();">
<div class="btn-contents">
<h2>Create New Event</h2>
<form id="addEvent" action="edit/general.php" method="post">
<input type="hidden" name="action" value="newEvent">
</form>
</div>
</div>
</div>
</body>
<script>
function newEvent() {
$("#addEvent").submit();
}
</script>
</html>