-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
81 lines (62 loc) · 1.84 KB
/
add.php
File metadata and controls
81 lines (62 loc) · 1.84 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
<?php
include_once("header.php");
include_once("navigation.php");
include_once("adminsidebar.php");
include_once("connection.php");
echo '<div id="page-content-wrapper">';
if(isset($_POST['ename']) && isset($_POST['edate']) && isset($_POST['ecomment'])) {
$n = mysqli_real_escape_string($conn,$_POST['ename']);
$d = mysqli_real_escape_string($conn,$_POST['edate']);
$comment = $_POST['ecomment'];
$sql = "INSERT into addevent SET ENAME = '$n', EDATE = '$d', DETAILS = '$comment'";
mysqli_query($conn,$sql);
$_SESSION['sent'] = 'sent';
}
?>
<form action="add.php" method="POST">
<div class="container">
<div class="col-lg-5">
<br/>
<h1>
<i class="fa fa-calendar"></i> Add Event </h1>
<?php
if (isset($_SESSION['sent'])) {
if ($_SESSION['sent'] == 'sent') {
echo ' <h3 class="alert alert-success" style="margin-top: 30px"> <i class="fa fa-thumbs-o-up fa-2x" aria-hidden="true"></i> Event successfully added!</h3>';
}
$_SESSION['sent'] ='';
}
?>
<br/>
<div class="row">
<div class="col-lg-2">
<strong>Name:</strong> </div>
<div class="col-lg-10">
<input type="text" class="form-control" name="ename" required><br/>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Date:</strong> </div>
<div class="col-lg-10">
<input type="text" class="form-control" id="dateToReserve1" name="edate" required><br/>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Details:</strong> </div>
<div class="col-lg-10">
<textarea cols="10" rows="5" class="form-control" name="ecomment" required>
</textarea><br/>
</div>
</div>
<div class="row">
<div class="col-lg-10 col-lg-offset-2">
<input type="submit" class="btn btn-warning btn-lg">
<a href="dashboard.php"><input type="button" class="btn btn-danger btn-lg" value="Back to Home"></a>
</div>
</div>
</form>
<?php
include_once('footeradmin.php');
?>