-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewEvent.php
More file actions
executable file
·197 lines (164 loc) · 4.51 KB
/
Copy pathnewEvent.php
File metadata and controls
executable file
·197 lines (164 loc) · 4.51 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
<!DOCTYPE html>
<html>
<head>
<?php require 'signedIn.php'; ?>
<meta charset='utf-8' />
<link href='fullcalendar.min.css' rel='stylesheet' />
<script src='fullcalendar.min.js'></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>TerpRoots</title>
<link rel="icon" type="image/png" href="NewTerpRootsLogo.png"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
/* initialize the external events
-----------------------------------------------------------------*/
var containerEl = document.getElementById('external-events-list');
new FullCalendar.Draggable(containerEl, {
itemSelector: '.fc-event',
eventData: function(eventEl) {
return {
title: eventEl.innerText.trim()
}
}
});
//// the individual way to do it
// var containerEl = document.getElementById('external-events-list');
// var eventEls = Array.prototype.slice.call(
// containerEl.querySelectorAll('.fc-event')
// );
// eventEls.forEach(function(eventEl) {
// new FullCalendar.Draggable(eventEl, {
// eventData: {
// title: eventEl.innerText.trim(),
// }
// });
// });
/* initialize the calendar
-----------------------------------------------------------------*/
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true, // this allows things to be dropped onto the calendar
drop: function(arg) {
// is the "remove after drop" checkbox checked?
if (document.getElementById('drop-remove').checked) {
// if so, remove the element from the "Draggable Events" list
arg.draggedEl.parentNode.removeChild(arg.draggedEl);
}
}
});
calendar.render();
// function to add events to calendar
$("#external-events-list").load("newEvents_script.php");
});
</script>
<style>
.navbar {
overflow: hidden;
font-family: Arial, Helvetica, sans-serif;
background-color: #C9C9C9;
color: black;
position: fixed; /* Set the navbar to fixed position */
top: 0; /* Position the navbar at the top of the page */
width: 100%; /* Full width */
}
/* Links inside the navbar */
.navbar a {
float: left;
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Change background on mouse-over */
.navbar a:hover {
background: #63A7E5;
color: white;
}
body {
margin-top: 40px;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#signOut {
float: right;
}
#wrap {
overflow: scroll;
padding-top: 70px;
width: 1100px;
margin: 0 auto;
}
#external-events {
float: left;
width: 150px;
padding: 0 10px;
border: 1px solid #ccc;
background: #eee;
text-align: left;
height: 707px;
overflow: scroll;
}
#external-events h4 {
font-size: 16px;
margin-top: 0;
padding-top: 1em;
}
#external-events .fc-event {
margin: 10px 0;
cursor: pointer;
}
#external-events p {
margin: 1.5em 0;
font-size: 11px;
color: #666;
}
#external-events p input {
margin: 0;
vertical-align: middle;
}
#calendar {
float: right;
width: 900px;
}
#fc-event {
background-color:#840B0B;
}
</style>
</head>
<body>
<body id="landing_page">
<div class="navbar">
<a href="homePage.php">Home</a>
<a href="organizations_main.php">Organizations</a>
<a href="newEvent.php">Events</a>
<a href="account.php">Account</a>
<?php include 'current_user.php'?>
<a id="signOut" href="signOut_script.php">Sign Out</a>
</div>
<div id='wrap'>
<div id='external-events'>
<h4>Events</h4>
<p>
<input type='checkbox' id='drop-remove' />
<label for='drop-remove'>remove after adding</label>
</p>
<div id='external-events-list'>
<!-- displays events from db; check newEvents_script.php -->
</div>
</div>
<div id='calendar'></div>
<div style='clear:both'></div>
</div>
</body>
</html>