-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents.php
176 lines (145 loc) · 4.35 KB
/
events.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
<?php
global $going,$u;
extract($_POST);
if(isset($save))
{
$org=mysqli_real_escape_string($conn,$_POST['org']);
$time=mysqli_real_escape_string($conn,$_POST['when']);
$offers=mysqli_real_escape_string($conn,$_POST['offers']);
$place=mysqli_real_escape_string($conn,$_POST['place']);
$addedby=$uname;
date_default_timezone_set('Asia/Kolkata');
$datetime = date('m/d/Y h:i:s a', time());
$query="insert into events values('','$time','$org','$offers','$place','0','$addedby','$datetime')";
$r=mysqli_query($conn,$query);
$err.= "
<div class='alert alert-success'>
<a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><b>events added !!</b>
</div>
";
}
?>
<style>
.back{
background: url("images/events.JPG");
background-size: cover;
background-position:center;
background-repeat: no-repeat;
font-family: Lato;
height: 100vh;
filter: brightness(100%);
margin-top: -20px;
}
#myDIV{
display:none;
}
</style>
<script>
//toggle option for event form
function myFunction() {
var x = document.getElementById("myDIV");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function Approve(id)
{
if(confirm("Are you really interested ?"))
{
window.location.href="going_to_event.php?id="+id;
}
}
function disapprove(id)
{
if(confirm("you have decided not to go :?"))
{
window.location.href="not_going.php?id="+id;
}
}
</script>
<div class="back">
<div class="container">
<div class="row">
<div class="col-lg-10">
<div id="content">
<h1>The Student Network Event</h1>
<h3>Scroll down to see exclusive offers</h3>
<button class="btn btn-default btn-lg"><i class="fa fa-hand-o-right" aria-hidden="true"></i><a href="#offers">Take me to the offers</a></button>
<button type="button" onclick="myFunction()"class="btn btn-lg btn-primary">Add New Events</button>
<br><br>
<div class="col-md-8" id="login_msg">
<?php echo($err) ?>
</div>
<div id="offers">
<div id="myDIV" class="event offers">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="panel panel-info">
<div class="panel-heading">Add New Event</div>
<div class="panel-body">
<form method="post" id="form1">
<div class="row">
<div class="col-md-12">
<input type="text" placeholder="Enter Organiser Name" id="org" name="org" class="form-control" required>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" id="when" name="when" placeholder="Enter Date and Time for the event" required>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" id="offers" name="offers" placeholder="Enter offers availabale" required>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" id="place" name="place" placeholder="Enter place where event will take place" required>
</div>
</div>
<p><br/></p>
<div class="row">
<div class="col-md-12">
<input name="save" type="submit" value="Add this event" class="btn btn-lg btn-success btn-block">
</div>
</div>
</div>
</form>
</div>
<div class="col-md-2"></div>
</div>
</div>
</div>
</div><!-- /.content -->
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
</div><!-- /.container -->
</div>
<div id="offers">
<h3 class="events">Have an event to promote? Contact us at <a href="mailto:himanshukumar9334004134@gmail.com?Subject=Hello%20again" target="_top">info@studentnetwork.ie</a></h3>
</div>
<!--modal for add event-->
<!--end modal-->
<script>
function autoRefresh_div()
{
$("#result").load("loadevents.php").show();// a function which will load data from other file after x seconds
}
setInterval('autoRefresh_div()', 2000);
</script>
<div id="result">
<?php
include("loadevents.php");
?>
</div>
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>