/
create_event.php
298 lines (287 loc) · 11 KB
/
create_event.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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
<html>
<head>
<?php require 'head.php';?>
</head>
<body class="slide" data-type="background" data-speed="5">
<!-- Javascript method to include navigation -->
<nav id="nav" role="navigation"><?php include 'nav.php';?></nav>
<!-- PHP method to include navigation -->
<!-- Javascript method to include header -->
<div id="header"><?php include 'header.php';?></div>
<!-- PHP method to include header -->
<div class="row">
<?php
$exec_page = False;
$active_page = True;
$public_page = False;
require_once('permissions.php');
function display($event_type) {
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
$response=$db->query("SELECT MAX(event_id) FROM events_listing");
$result=mysqli_fetch_array($response);
$next = $result['MAX(event_id)'] + 1;
if ($event_type=='Other')
{
?>
<h2>Create Other Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='<?= $event_type ?>'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<p>Leadership Points:
<input type="number" step="0.25" name="L_val" value="0"></p>
<p>Friendship Points:
<input type="number" step="0.25" name="F_val" value="0"></p>
<p>Service Points:
<input type="number" step="0.25" name="S_val" value="0"></p>
<p>Date: (leave blank if not applicable)
<input type='date' name='event_time' value=0></p>
<p>Meeting Location:
<input type='text' name='event_place' value='Circle Drive'></p>
<p>Description:<p>
<input type="text" name="event_description"></p>
<p>Event Cap: (use 0 if there is no cap)
<input type="number" name="event_cap" value="0"></p>
<p>Event Leader ID: (defaults to your ID)
<input type='number' name='event_leader_id' value=<?= $user_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>Required?
<input type="checkbox" name="required"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
else if ($event_type=='Attendance') {
?>
<h2>Create Attendance Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='<?= $event_type ?>'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<input type="hidden" step="0.25" name="L_val" value="0"></p>
<input type="hidden" step="0.25" name="F_val" value="0"></p>
<p>Service Points:
<input type="number" step="0.25" name="S_val" value="0"></p>
<p>Date: (leave blank if not applicable)
<input type='date' name='event_time' value=0></p>
<p>Meeting Location:
<input type='text' name='event_place' value='Circle Drive'></p>
<p>Description:<p>
<input type="text" name="event_description"></p>
<input type="hidden" name="event_cap" value="0"></p>
<p>Event Leader ID: (defaults to your ID)
<input type='number' name='event_leader_id' value=<?= $user_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>Required?
<input type="checkbox" name="required"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
else if ($event_type=='Regular') {
?>
<h2>Create Regular Service Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='<?= $event_type ?>'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<input type="hidden" step="0.25" name="L_val" value="0"></p>
<input type="hidden" step="0.25" name="F_val" value="0"></p>
<p>Service Points:
<input type="number" step="0.25" name="S_val" value="0"></p>
<input type='hidden' name='event_time' value=0>
<p> Occurence Information: </p>
<p> 0 : never on this day </p>
<p> 1 : weekly </p>
<p> 2 : every other week </p>
<p> 3 : irregular (monthly, etc) talk to webmaster after selecting<p>
<p> Sunday
<input type='number' name='sunday' value=0></p>
<p> Monday
<input type='number' name='monday' value=0></p>
<p> Tuesday
<input type='number' name='tuesday' value=0></p>
<p> Wednesday
<input type='number' name='wednesday' value=0></p>
<p> Thursday
<input type='number' name='thursday' value=0></p>
<p> Friday
<input type='number' name='friday' value=0></p>
<p> Saturday
<input type='number' name='saturday' value=0></p>
<p>Time
<input type='text' name='time' value=0></p>
<p>Meeting Location:
<input type='text' name='event_place' value='Circle Drive'></p>
<p>Description:
<input type="text" name="event_description"></p>
<p>Service Type:
<input type="text" name="service_type"></p>
<p>Event Cap: (use 0 if there is no cap) do not include project leader
<input type="number" name="event_cap" value="0"></p>
<p>Event Leader ID: (defaults to your ID)
<input type='number' name='event_leader_id' value=<?= $user_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>Required?
<input type="checkbox" name="required"></p>
<p>Youth?
<input type="checkbox" name="youth"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
else if ($event_type=='Large') {
?>
<h2>Create Large Service Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='<?= $event_type ?>'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<input type="hidden" step="0.25" name="L_val" value="0"></p>
<input type="hidden" step="0.25" name="F_val" value="0"></p>
<p>Service Points:
<input type="number" step="0.25" name="S_val" value="0"></p>
<p>Date: (leave blank if not applicable)
<input type='date' name='event_time' value=0></p>
<p>Meeting Location:
<input type='text' name='event_place' value='Circle Drive'></p>
<p>Description:<p>
<input type="text" name="event_description"></p>
<p>Event Cap: (use 0 if there is no cap)
<input type="number" name="event_cap" value="0"></p>
<p>Event Leader ID: (defaults to your ID)
<input type='number' name='event_leader_id' value=<?= $user_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>Required?
<input type="checkbox" name="required"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
else if ($event_type=='Taskforce') {
$task_desc = "Help an exec member!";
?>
<h2>Create Taskforce Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='<?= $event_type ?>'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<input type="hidden" step="0.25" name="L_val" value="0">
<input type="hidden" step="0.25" name="F_val" value="0"></p>
<p>Service Points:
<input type="number" step="0.25" name="S_val" value="0"></p>
<p>Date: (leave blank if not applicable)
<input type='date' name='event_time' value=0></p>
<input type='hidden' name='event_place' value='Circle Drive'>
<p>Description:<p>
<input type="text" name="event_description" value=<?= $task_desc ?>></p>
<p>Event Cap: (use 0 if there is no cap)
<input type="number" name="event_cap" value="0"></p>
<input type='hidden' name='event_leader_id' value=<?= $user_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
else if ($event_type=='Chapter') {
$rresponse=$db->query("SELECT id FROM contact_information WHERE position='Recording Secretary'");
$rresult=mysqli_fetch_array($rresponse);
$rec_id = $rresult['id'];
?>
<h2>Create Chapter Event</h2>
<form name="myform" action="create_event_done.php" method="post">
<input type='hidden' name='event_type' value='Chapter'>
<input type='hidden' name='event_id' value=<?= $next ?>>
<p>Event Title:
<input type="text" name="event_name" required></p>
<input type="hidden" step="0.25" name="L_val" value="0"></p>
<input type="hidden" step="0.25" name="F_val" value="0"></p>
<input type="hidden" step="0.25" name="S_val" value="0"></p>
<p>Date: (leave blank if not applicable)
<input type='date' name='event_time' value=0></p>
<p>Meeting Location:
<input type='text' name='event_place' value='Circle Drive'></p>
<p>Description:<p>
<input type="text" name="event_description"></p>
<p>Event Cap: (use 0 if there is no cap)
<input type="number" name="event_cap" value="0"></p>
<input type='hidden' name='event_leader_id' value=<?= $rec_id ?>></p>
<p>Repeatable?
<input type="checkbox" name="repeatable"></p>
<p>Required?
<input type="checkbox" name="required"></p>
<p>
<input type="submit" name="submit" value="create"/></p>
</form>
<?php
}
}
function show_active() {
?>
<h1> Event Creation Home </h1>
<?php
include('mysql_access.php');
$user_id = $_SESSION['sessionID'];
$aresponse=$db->query("SELECT status FROM contact_information WHERE id=$user_id");
$aresult=mysqli_fetch_array($aresponse);
$status = $aresult['status'];
if ($status == 'Appointed' || $status == 'Elected') {
$page = null;
//sets event info section from selection
$event_type = "none";
if(isset($_POST['type_set']))
{
$event_type = $_POST['type_set'];
}
$response=$db->query("SELECT COUNT(event_id) FROM events_listing");
$result=mysqli_fetch_array($response);
$next = $result['COUNT(event_id)'] + 1;
?>
<p>Event Type:
<form name="myform" action="" method="post">
<select name='type_set' onchange="this.form.submit()">
<option value='null' selected>-- select one --</option>
<option value='Chapter'>Chapter</option>
<option value='Attendance'>Attendance</option>
<option value='Taskforce'>Taskforce</option>
<!--<option value='Regular'>Regular Service</option>
<option value='Large'>Large Service</option>
<option value='Other'>Other</option>!-->
</select>
</form>
<?php
display($event_type);
}
else
{
echo "You cannot create events because you are not on Exec.";
}
}
?>
</div>
<!-- Javascript method to include footer -->
<div id="footer"><?php include 'footer.php';?></div>
<!-- PHP method to include footer -->
</body>
</html>