-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-Event.php
521 lines (461 loc) · 26.3 KB
/
add-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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<?php
include "linc.php";
if (!isset($_SESSION['a']))
{
header('Location: adminlogin.php');
}
?>
<!doctype html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Add EVENTS | FiestaEase </title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- favicon
============================================ -->
<link rel="shortcut icon" type="image/x-icon" href="https://i.pinimg.com/originals/6e/19/81/6e1981e45ddfa3b5bb2f44a6a196c99d.png"> <!-- icon shown on top of heading of admin page -->
<!-- Google Fonts
============================================ -->
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,700,900" rel="stylesheet">
<!-- Bootstrap CSS
============================================ -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Bootstrap CSS
============================================ -->
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- owl.carousel CSS
============================================ -->
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/owl.theme.css">
<link rel="stylesheet" href="css/owl.transitions.css">
<!-- animate CSS
============================================ -->
<link rel="stylesheet" href="css/animate.css">
<!-- normalize CSS
============================================ -->
<link rel="stylesheet" href="css/normalize.css">
<!-- meanmenu icon CSS
============================================ -->
<link rel="stylesheet" href="css/meanmenu.min.css">
<!-- main CSS
============================================ -->
<link rel="stylesheet" href="css/main.css">
<!-- educate icon CSS
============================================ -->
<link rel="stylesheet" href="css/educate-custon-icon.css">
<!-- morrisjs CSS
============================================ -->
<link rel="stylesheet" href="css/morrisjs/morris.css">
<!-- mCustomScrollbar CSS
============================================ -->
<link rel="stylesheet" href="css/scrollbar/jquery.mCustomScrollbar.min.css">
<!-- metisMenu CSS
============================================ -->
<link rel="stylesheet" href="css/metisMenu/metisMenu.min.css">
<link rel="stylesheet" href="css/metisMenu/metisMenu-vertical.css">
<!-- calendar CSS
============================================ -->
<link rel="stylesheet" href="css/calendar/fullcalendar.min.css">
<link rel="stylesheet" href="css/calendar/fullcalendar.print.min.css">
<!-- style CSS
============================================ -->
<link rel="stylesheet" href="style.css">
<!-- responsive CSS
============================================ -->
<link rel="stylesheet" href="css/responsive.css">
<!-- modernizr JS
============================================ -->
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Start Left menu area -->
<div class="left-sidebar-pro">
<nav id="sidebar" class="">
<div class="sidebar-header">
<a href="index_new.php"><img class="main-logo" src="https://i.pinimg.com/originals/6e/19/81/6e1981e45ddfa3b5bb2f44a6a196c99d.png" height = 300 width = 100 alt="Go to index page" /></a>
<strong><a href="index_new.php"><img src="img/zephyr-img.jpg" height = 300 width = 100 alt="Go to index page"/></a></strong>
</div>
<div class="left-custom-menu-adp-wrap comment-scrollbar">
<nav class="sidebar-nav left-sidebar-menu-pro">
<ul class="metismenu" id="menu1">
<li>
<!--<a href= "query_box.php" aria-expanded="false"><span class="educate-icon educate-pages icon-wrap" aria-hidden="true"></span> <span class="mini-click-non">Query Box</span></a>-->
</li>
<li>
<a class = "has-arrow" title="Landing Page" href="google-calendar.html" aria-expanded="false"><span class="educate-icon educate-event icon-wrap sub-icon-mg" aria-hidden="true"></span> <span class="mini-click-non">Event</span></a>
<ul class="submenu-angle" aria-expanded="false">
<!--<li><a title="All Events" href="all-Events.php"><span class="mini-sub-pro">All Events</span></a></li>-->
<li><a title="Add Event" href="add-Event.php"><span class="mini-sub-pro">Add Event</span></a></li>
<li><a title="Edit Event" href="edit-Eventform.php"><span class="mini-sub-pro">Edit Event</span></a></li>
<li><a title="Delete Event" href="delete-details.php"><span class="mini-sub-pro">Delete Event</span></a></li>
</ul>
</li>
<li>
<a class="has-arrow" href="all-Managers.php" aria-expanded="false"><span class="educate-icon educate-professor icon-wrap"></span> <span class="mini-click-non">Managers</span></a>
<ul class="submenu-angle" aria-expanded="false">
<li><a title="All Managers" href="all-Managers.php" ><span class="mini-sub-pro">All Managers</span></a></li>
<li><a title="Add Manager" href="take-Manager-info.php"><span class="mini-sub-pro">Add Manager</span></a></li>
<li><a title="Edit Managers" href="edit-Managers.php"><span class="mini-sub-pro">Edit Manager</span></a></li>
<li><a title="Delete Manager" href="delete-details.php" <span class="mini-sub-pro">Delete Manager</span></a></li>
</ul>
</li>
<li>
<a class="has-arrow" href="all-Participants.php" aria-expanded="false"><span class="educate-icon educate-student icon-wrap"></span> <span class="mini-click-non">Participants</span></a>
<ul class="submenu-angle" aria-expanded="false">
<li><a title="All Participants" href="all-Participants.php"><span class="mini-sub-pro">All Participants</span></a></li>
<li><a title="Participants Required Details" href="Participants-req-details.php"><span class="mini-sub-pro"> Participants <br>Required Details </span></a></li>
<li><a title="Delete Participant" href="delete-details.php"> <span class="mini-sub-pro">Delete Participant </span></a></li>
</ul>
</li>
<li>
<a class="has-arrow" href="all-Volunteers.php" aria-expanded="false"><span class="educate-icon educate-student icon-wrap"></span> <span class="mini-click-non">Volunteers</span></a>
<ul class="submenu-angle" aria-expanded="false">
<li><a title="All Volunteers" href="all-Volunteers.php"><span class="mini-sub-pro">All Volunteers</span></a></li>
<li><a title="Add Volunteers" href="take-Volunteer-info.php"><span class="mini-sub-pro">Add Volunteer</span></a></li>
<li><a title="Edit Volunteers" href="edit-Volunteersform.php"><span class="mini-sub-pro">Edit Volunteer</span></a></li>
<li><a title="Delete Volunteer" href="delete-details.php" > <span class="mini-sub-pro">Delete Volunteer</span></a></li>
</ul>
</li>
<li>
<li>
<a class="has-arrow" href="all-Sponsors.php" aria-expanded="false"><span class="educate-icon educate-department icon-wrap"></span> <span class="mini-click-non">Sponsors</span></a>
<ul class="submenu-angle" aria-expanded="false">
<li><a title="All Sponsors" href="all-Sponsors.php"><span class="mini-sub-pro">All Sponsors</span></a></li>
<li><a title="Add Sponsors" href="take-Sponsor-info.php"><span class="mini-sub-pro">Add Sponsor</span></a></li>
<li><a title="Edit Sponsors" href="edit-Sponsorsform.php"><span class="mini-sub-pro">Edit Sponsors</span></a></li>
<li><a title="Delete Sponsor" href="delete-details.php"> <span class="mini-sub-pro">Delete Sponsor</span></a></li>
</ul>
</li>
<li>
<li>
<a class="has-arrow" href="all-Chief_Guests.php" aria-expanded="false"><span class="educate-icon educate-department icon-wrap"></span> <span class="mini-click-non">Chief Guests</span></a>
<ul class="submenu-angle" aria-expanded="false">
<li><a title="All Chief-Guests" href="all-Chief_Guests.php"><span class="mini-sub-pro">All Chief-Guests</span></a></li>
<li><a title="Add Chief-Guests" href="take-Chief_Guest-info.php"><span class="mini-sub-pro">Add Chief-Guest</span></a></li>
<li><a title="Edit Chief-Guests" href="edit-Chief_Guests.php"><span class="mini-sub-pro">Edit Chief-Guests</span></a></li>
<li><a title="Delete Chief-Guest" href="delete-details.php"><span class="mini-sub-pro">Delete Chief-Guest</span></a></li>
</ul>
</li>
<li>
<a class="has-arrow" href="" aria-expanded="false"><span class="educate-icon educate-interface icon-wrap"></span> <span class="mini-click-non">Interface</span></a>
<ul class="submenu-angle interface-mini-nb-dp" aria-expanded="false">
<li><a title="Google Map" href="google-map.php"><span class="mini-sub-pro">Google Map</span></a></li>
<li><a title="Pdf Viewer" href="pdf-viewer.php"><span class="mini-sub-pro">Pdf Viewer</span></a></li>
</ul>
</li>
<li id="removable">
<a href="adminlogout.php" aria-expanded="false"><span class="educate-icon educate-pages icon-wrap"></span> <span class="mini-click-non"> Logout </span></a> <!-- Logout Page -->
</li>
</ul>
</nav>
</div>
</nav>
</div>
<!-- End Left menu area -->
<!-- Start Welcome area -->
<div class="all-content-wrapper" >
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="logo-pro">
<a href="index_new.php"><img class="main-logo" src="img/logo/logo.png" alt="" /></a>
</div>
</div>
</div>
</div>
<div class="header-advance-area">
<div class="header-top-area">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="header-top-wraper">
<div class="row">
<div class="col-lg-1 col-md-0 col-sm-1 col-xs-12">
<div class="menu-switcher-pro">
<!-- To collapse left menu -->
<button type="button" id="sidebarCollapse" class="btn bar-button-pro header-drl-controller-btn btn-info navbar-btn">
<i class="educate-icon educate-nav"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Welcome area ends here -->
<!-- Shows navigation path -->
<div class="breadcome-area">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="breadcome-list">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<ul class="breadcome-menu">
<li><a href="index_new.php">Home</a> <span class="bread-slash">/</span>
</li>
<li><span class="bread-blod"> Add Event </span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="single-pro-review-area mt-t-30 mg-b-15" id="work-area" >
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="product-payment-inner-st">
<h2 align="center"> Enter EVENT to-be-added details below</h2>
<div class="tab-content custom-product-edit">
<div class="product-tab-list tab-pane fade active in" >
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="review-content-section">
<div class="pro-ad">
<form action="#" method = "POST" >
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="form-group"><h3> Event Name: </h3>
<input name="ev_name" type="text" required class="form-control" placeholder="Event Name">
</div><br><br>
<div class="form-group"><h3> Category: </h3>
<select required name="ev_cat" class="form-control">
<option value="0" selected="" > DANCE </option>
<option value="1"> DRAMA </option>
<option value="2"> LITERARY </option>
<option value ="3"> MUSICAL </option>
<option value ="4"> FUN </option>
<option value ="5"> ART/PHOTO </option>
<option value ="6"> TECHNICAL </option>
</select>
</div> <br><br>
<div class="form-group"><h3> Type: </h3>
<select name="ev_type" required class="form-control">
<option value="0" selected="" > WORKSHOP </option>
<option value="1"> TALK / SEMINAR </option>
<option value="2"> COMPETITION - SOLO </option>
<option value ="3"> COMPETITION - GROUP </option>
<option value ="4"> SHOW </option>
<option value ="5"> GAME </option>
</select>
</div> <br><br>
<div class="form-group"><h3> Venue ID: </h3>
<input name="ev_venue" type="number" required class="form-control" placeholder="Event Venue/Location">
</div><br><br>
<div class="form-group"><h3> First prize: </h3>
<input name="fp" type="number" class="form-control" required placeholder="first prize amount">
</div><br><br>
<div class="form-group"><h3> Second prize: </h3>
<input name="sp" type="number" class="form-control" required placeholder="second prize amount">
</div><br><br>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="form-group"><h3> Start Time: </h3>
<input name="ev_start" type="time" class="form-control" required placeholder="Starting time of event - hh:mm:ss">
</div><br><br>
<div class="form-group"><h3> End Time: </h3>
<input name="ev_end" type="time" class="form-control" required placeholder="Ending time of event - hh:mm:ss">
</div><br><br>
<div class="form-group"><h3> Begin Date: </h3>
<input name="ev_begin" type="date" class="form-control" required placeholder="Beginning Date of event - DD/MM/YYYY">
</div> <br><br>
<div class="form-group"><h3> Closing Date: </h3>
<input name="ev_close" type="date" class="form-control" required placeholder="Closing date of event - DD/MM/YYYY">
</div> <br><br>
<div class="form-group"><h3> Third prize: </h3>
<input name="tp" type="number" class="form-control" required placeholder="third prize amount">
</div><br><br>
<br><br>
</div>
</div><br><br>
<div class="row">
<div class="col-lg-12">
<div class="payment-adress">
<button type="submit" class="btn btn-primary waves-effect waves-light" name='sub-but'>Submit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- php code to insert data into mysql here -->
<?php
if(isset($_POST["sub-but"]))
{
$name = $_POST["ev_name"] ;
$c = $_POST["ev_cat"] ;
$t = $_POST["ev_type"] ;
$venue = $_POST["ev_venue"] ;
$start = $_POST["ev_start"] ;
$end = $_POST["ev_end"] ;
$begin = $_POST["ev_begin"] ;
$close = $_POST["ev_close"] ;
$fp=$_POST["fp"];
$sp=$_POST["sp"];
$tp=$_POST["tp"];
if(isset($name) and isset($c) and isset($t) and isset($venue) and isset($start) and isset($end) and isset($begin) and isset($close) )
//if($name and $c and $t and $venue and $year and $start and $end and $begin and $close)
{
include "linc.php" ;
// $host = "localhost" ; //can be changed according to host
// $user_name = "DK" ; //username according to that used in database
// $passwd = "DK@ZEPHYR" ; //password according to useraccount created in database
// $schema = "ZEPHYR" ; // to store database/schema wheree all relations are present
//CONNECT TO MySQL
// if(!($database = mysqli_connect($host, $user_name, $passwd))) //returns database handle - representation of connectn. of php to database
// {
// die("Could not connect to database </body></html> ") ;
// }
// //open ZEPHYR database
// if(!mysqli_select_db($database ,$schema) )
// {
// die("Could not open ZEPHYR database</body></html> ") ;
// }
switch($c)
{
case 0:
$cat = "DANCE" ;
break ;
case 1:
$cat = "DRAMA" ;
break ;
case 2 :
$cat = "LITERARY" ;
break ;
case 3 :
$cat = "MUSICAL" ;
break ;
case 4 :
$cat = "FUN" ;
break ;
case 5 :
$cat = "ART/PHOTO" ;
break ;
case 6 :
$cat = "TECHNICAL" ;
break ;
}
switch($t)
{
case 0:
$type = "WORKSHOP" ;
break ;
case 1:
$type = "TALK/SEMINAR" ;
break ;
case 2 :
$type = "COMPETITION-S" ;
break ;
case 3 :
$type = "COMPETITION-G" ;
break ;
case 4 :
$type = "SHOW" ;
break ;
case 5 :
$type = "GAME" ;
break ;
}
//queries
$query_in = "INSERT INTO events VALUES('' ,'" .$name. "' ,'".$type."' ,'".$cat."' ,'" .$begin."' ,'".$close."' ,'".$start."' ,'".$end."' ,'".$fp."' ,'".$sp."','".$tp."','".$venue."' ) ;" ;
$querycheck = "SELECT * FROM events WHERE event_name= '" .$name. "' and category= '".$cat."' AND type= '".$type."' AND v_id= '" .$venue."' AND begin_time= '".$start."' AND end_time= '".$end."' AND begin_date= '".$begin."' AND end_date= '".$close."' AND first_prize='".$fp."' AND second_prize='".$sp."' AND third_prize='".$tp."';" ;
$resultcheck = mysqli_query($mysqli,$querycheck);
if(mysqli_num_rows($resultcheck) == 0) // to check if given event already exists
{
$result_in = mysqli_query($mysqli , $query_in) ;
if(isset($result_in))
{
echo("<p><br><br> <h2 align='center'> Event inserted in database. </h2><p>") ;
echo("<p><br><br> <h1 align='center'> Successfully inserted entered data in EVENTS Relation. </h1><p>") ;
echo($result_in) ;
mysqli_commit($mysqli) ;
}
}
else
{
echo("<p><br><br> <h2 align='center'> Event already exists !!</h2><p>") ;
mysqli_commit($mysqli) ;
}
mysqli_close($mysqli) ;
}
else
{
die("<p><br><br> <h2 align='center'>Please Enter all the details</h2> </body></html> <p>") ;//exit immediately, no further computations
}
}
?> <!--end PHP script-->
</div>
<!-- jquery
============================================ -->
<script src="js/vendor/jquery-1.12.4.min.js"></script>
<!-- bootstrap JS
============================================ -->
<script src="js/bootstrap.min.js"></script>
<!-- wow JS
============================================ -->
<script src="js/wow.min.js"></script>
<!-- price-slider JS
============================================ -->
<script src="js/jquery-price-slider.js"></script>
<!-- meanmenu JS
============================================ -->
<script src="js/jquery.meanmenu.js"></script>
<!-- owl.carousel JS
============================================ -->
<script src="js/owl.carousel.min.js"></script>
<!-- sticky JS
============================================ -->
<script src="js/jquery.sticky.js"></script>
<!-- scrollUp JS
============================================ -->
<script src="js/jquery.scrollUp.min.js"></script>
<!-- mCustomScrollbar JS
============================================ -->
<script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/scrollbar/mCustomScrollbar-active.js"></script>
<!-- metisMenu JS
============================================ -->
<script src="js/metisMenu/metisMenu.min.js"></script>
<script src="js/metisMenu/metisMenu-active.js"></script>
<!-- morrisjs JS
============================================ -->
<script src="js/sparkline/jquery.sparkline.min.js"></script>
<script src="js/sparkline/jquery.charts-sparkline.js"></script>
<script src="js/sparkline/sparkline-active.js"></script>
<!-- calendar JS
============================================ -->
<script src="js/calendar/moment.min.js"></script>
<script src="js/calendar/fullcalendar.min.js"></script>
<script src="js/calendar/fullcalendar-active.js"></script>
<!-- plugins JS
============================================ -->
<script src="js/plugins.js"></script>
<!-- main JS
============================================ -->
<script src="js/main.js"></script>
<!-- tawk chat JS
============================================ -->
<script src="js/tawk-chat.js"></script>
</body>
</html>