-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminUpdate.php
More file actions
172 lines (161 loc) · 6.33 KB
/
adminUpdate.php
File metadata and controls
172 lines (161 loc) · 6.33 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
<?php
$eventid = $_GET['key_id'];
include "eventClass.php";
$obj = new db();
$r = $obj->fetch_event_info($eventid);
?>
<?php
session_start();
if(isset($_POST['createEvent'])){
$eventName = $_POST['EventName'];
$organizerName = $_POST['OrganizerName'];
$date = $_POST['date'];
$time = $_POST['time'];
$venue = $_POST['veneu'];
$Description = $_POST['description'];
$cost = $_POST['cost'];
$epid = $r['epId'];
// Handling image upload
// Call the event_register function with all the parameters
$r = $obj->event_update($eventid,$eventName, $organizerName, $date, $time, $venue, $Description, $cost, $target_file, $epid);
if($r > 0) {
header('location:adminEvent.php');
exit;
} else {
$em = "Failed to register event";
header('location:createEvent.php?error=' . $em);
exit;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Create Event - Event Management System</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/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%);
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
}
#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;
}
@media (max-width: 768px) {
#sidebar {
width: 100%;
height: auto;
position: relative;
}
#sidebar a {
padding: 10px;
}
#content {
margin-left: 0;
}
}
.form-container {
background: linear-gradient(90deg, rgb(189, 222, 230) 0%, rgb(172, 197, 237) 83%);
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 500px;
width: 100%;
margin: auto;
margin-top: 20px;
margin-bottom: 30px; /* Added padding to the bottom */
}
.form-container h2 {
text-align: center;
margin-bottom: 20px;
}
</style>
</head>
<body>
<!-- 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 -->
<!-- Main Content -->
<div class="container mt-4">
<div class="form-container">
<h2>Update Event </h2>
<form method="POST" enctype="multipart/form-data">
<div class="mb-3">
<label for="eventName" class="form-label">Event Name</label>
<input type="text" class="form-control" id="eventName" name="EventName" value = "<?php echo $r['eventName']?>">
</div>
<div class="mb-3">
<label for="organizerName" class="form-label">Organizer Name</label>
<input type="text" class="form-control" id="organizerName" name="OrganizerName" value = "<?php echo $r['OrganizerName']?>">
</div>
<div class="mb-3">
<label for="eventDate" class="form-label">Event Date</label>
<input type="date" class="form-control" name="date" id="eventDate">
</div>
<div class="mb-3">
<label for="eventTime" class="form-label">Event Time</label>
<input type="time" class="form-control" name="time" id="eventTime">
</div>
<div class="mb-3">
<label for="eventCost" class="form-label">Event Cost</label>
<input type="text" class="form-control" id="eventCost" name="cost" value = "<?php echo $r['cost']?>">
</div>
<div class="mb-3">
<label for="eventVenue" class="form-label">Event Venue</label>
<input type="text" class="form-control" id="eventVenue" name="veneu" value = "<?php echo $r['venue']?>">
</div>
<div class="mb-3">
<label for="eventDescription" class="form-label">Event Description</label>
<textarea class="form-control" id="eventDescription" name="description" rows="3"
value = "<?php echo $r['Description']?>"></textarea>
</div>
<div class="mb-3">
<label for="eventImage" class="form-label">Event Image</label>
<input class="form-control" type="file" name="eImage" id="eventImage" value = "<?php echo $r['Image']?>" readonly>
</div>
<button type="submit" name="createEvent" class="btn btn-primary">Update Event</button>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
</body>
</html>