-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcreateevent.php
More file actions
408 lines (340 loc) · 11.1 KB
/
createevent.php
File metadata and controls
408 lines (340 loc) · 11.1 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
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
<?php
include "config.php" ;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>Create Event</title>
</head>
<style>
html {
overflow-x: hidden;
}
#content {
display: flex;
flex-direction: column;
height: 90%;
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
/* font-size: 35px; */
padding: 20px;
}
.event-form {
width: 50%;
padding: 2%;
margin-left: 10%;
/* background-color: palegoldenrod; */
}
.ev-img {
display: flex;
justify-content: center;
align-items: center;
/* width: 260px;
height: 190px; */
}
.event-image {
width: 260px;
height: 190px;
}
.event_title {
font-size: 15px;
font-weight: 800;
margin-bottom: 15px;
}
.eve_form {
/* background-color: azure; */
padding: 10px;
/* width: 60%; */
}
.subject {
display: block;
/* font-size: 18px;
font-weight: bold; */
width: 100%;
}
.rem-item {
background: #FFFFFF;
border: 1px solid #4B9AFB;
border-radius: 45px;
padding: 10px;
margin: 10px;
font-size: 18px;
}
.rem_icon {
color: #4B9AFB;
margin-right: 15px;
}
.content-name {
position: absolute;
bottom: 5px;
left: 0px;
transition: all 0.3s ease;
}
.form_btn {
width: 100%;
background: #4B9AFB;
border-radius: 10px;
color: white;
text-align: center;
padding: 15px;
margin-top: 30px;
}
.txt {
width: 100%;
margin-bottom: 10px;
margin-top: 15px;
cursor: pointer;
}
.txt p {
padding-left: 15px;
}
.txticon {
padding: 10px;
}
.input-icons i {
position: absolute;
}
.input-icons {
width: 100%;
margin-bottom: 10px;
border: none;
}
.icon {
padding: 10px;
color: black;
min-width: 50px;
}
.input-field {
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 50px;
}
/* POPUP */
.pop-box .button {
font-size: 18px;
text-decoration: none;
color: black;
border: 1px solid black;
border-radius: 20px;
margin-top: 20px;
padding: 10px 20px;
}
.bg-popContainer {
display: none;
}
.pop-box {
width: 100%;
height: auto;
background: #FFFFFF;
border: 1px solid rgba(225, 225, 225, 0.66);
box-shadow: 0px 11px 25px rgba(0, 0, 0, 0.1);
padding: 20px;
position: relative;
}
.cont {
border-radius: 20px;
}
input {
width: 50%;
display: block;
margin: 15px auto;
padding: 5px;
}
.closer {
position: absolute;
top: 0;
right: 14px;
font-size: 30px;
transform: rotate(45deg);
cursor: pointer;
}
::placeholder {
color: black;
opacity: 1;
/* Firefox */
}
:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: black;
}
::-ms-input-placeholder {
/* Microsoft Edge */
color: black;
}
/* MEDIA QUERY */
@media screen and (min-width: 720px) {
/* Styles go here */
.mobile-menu {
display: none;
}
}
@media (min-width: 0px) and (max-width: 720px) {
#content {
/* padding: 0 !important; */
}
.event-form {
/* height: 100%; */
margin-left: 0 !important;
width: 100%;
display: flex;
/* justify-content: center; */
justify-content: space-around;
align-items: center;
flex-direction: column;
}
}
</style>
<body>
<!-- Navbar Start -->
<?php
include("navbar.php")
?>
<!-- Navbar End -->
<!-- Contents Start -->
<div id="content">
<div class="event-form">
<div class="ev-img">
<img class="event-image" src="images/eventlist.png" alt="">
</div>
<br>
<form action="createevent.php" method="post">
<div class="eve_form">
<label for="subject" class="event_title">EVENT NAME</label>
<!-- <input class="subject" type="text" name="subject" placeholder="Category" style="padding:10px 0px;"> -->
<select class="subject" type="text" name="subject" placeholder="Category" style="padding:10px 0px;">
<option value="consultation">Consultation</option>
<option value="dietplan">Diet Plan</option>
<option value="followup">Follow Up</option>
</select>
<br>
<div class="reminder">
<div class="event_title">REMINDER TYPE</div>
<div class="rem">
<div style="display: inline-block;" class="rem-item"><i
class="fa-solid fa-suitcase rem_icon"></i>Consultation</div>
<div style="display: inline-block;" class="rem-item"><i
class="fa-solid fa-apple-whole rem_icon"></i>Diet Plan</div>
<div style="display: inline-block;" class="rem-item"><i
class="fa-solid fa-phone rem_icon"></i>Call
</div>
<div style="display: inline-block;" class="rem-item"><i
class="fa-solid fa-add rem_icon"></i>Others
</div>
</div>
<br>
<div class=" event_title">EVENT DETAILS</div>
<form style="max-width:100%;margin:auto">
<div class="input-icons">
<i class="fa-solid fa-user icon">
</i>
<input style="border-top:none;border-left:none;border-right:none" class="input-field"
placeholder="Add Client">
</div>
<div class="input-icons">
<i class="fa-solid fa-suitcase icon">
</i>
<select style="border-top:none;border-left:none;border-right:none" name="meetingtype" class="input-field">
<option value="select">Meeting Type</option>
<option value="videocall">Video Call</option>
<option value="call">Call</option>
<option value="3">In person</option>
</select>
</div>
<div class="txt button" style="border-bottom:1.8px solid black;" id="button">
<i class="fa-solid fa-calendar-days txticon" style="display:inline-block">
</i>
<p style="display:inline-block">Date and Time</p>
</div>
<div id="bg_container" class="bg-popContainer">
<div class="pop-box">
<div id="close" class="closer">+</div>
<div>
<p style="display:inline-block; margin-right:10px">Start Date</p>
<input style="display:inline-block;" type="datetime-local" name="startdate" placeholder="StartDate">
</div>
<div>
<p style="display:inline-block;margin-right:18px">End Date</p>
<input style="display:inline-block;" type="datetime-local"
placeholder="EndDate" name="enddate">
</div>
</div>
</div>
<div class="input-icons">
<i class="fa-solid fa-location icon">
</i>
<input style="border-top:none;border-left:none;border-right:none" class="input-field"
type="password" placeholder="Place of meeting" name="placeofmeeting">
</div>
<div class="input-icons">
<i class="fa-solid fa-bars icon">
</i>
<input style="border-top:none;border-left:none;border-right:none" class="input-field"
type="password" placeholder="Add Description" name="description">
</div>
<div class="input-icons">
<i class="fa-solid fa-paperclip icon">
</i>
<input style="border-top:none;border-left:none;border-right:none" class="input-field"
type="password" placeholder="Attachment" name="attachment">
</div>
</form>
<button class="form_btn" type="submit">Book Appointment</button>
</div>
</div>
</form>
</div>
</div>
<!-- Contents End -->
<!-- PHP INSERT QUERIES -->
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST"){
// value from session
$personid = 1;
$eventname = $_POST['subject'];
// Using session and getting it from add client page
$client_id = 2;
$meeting_type = $_POST['meetingtype'];
$start_date = $_POST['startdate'];
$end_date = $_POST['enddate'];
$place_of_meeting = $_POST['placeofmeeting'];
$description = $_POST['description'];
$attachment = "hello";
$sql = "INSERT INTO create_event (PersonID, eventname, client_id, meeting_type, start_date, end_date, place_of_meeting, description, attachment) VALUES ('$personid','$eventname','$client_id','$meeting_type','$start_date','$end_date','$place_of_meeting','$description','$attachment')";
$result=mysqli_query($conn,$sql);
if($result){
echo "Successful";
}
else {
echo "ERROR";
}
// mysqli_close();
}
?>
</body>
<script>
// get elements by id
const popOutButton = document.getElementById("button")
const exitcontainer = document.getElementById("bg_container")
const bg_container = document.querySelector(".bg-popContainer")
// Add event listeners
popOutButton.addEventListener("click", popOutNow);
function popOutNow(e) {
e.preventDefault();
document.querySelector(".bg-popContainer").style.display = "flex";
}
const cancelPop = document.getElementById("close");
cancelPop.addEventListener("click", CancelPopOut);
function CancelPopOut(e) {
e.preventDefault();
bg_container.style.display = "none";
}
</script>
</html>