-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
257 lines (231 loc) · 8.86 KB
/
index.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
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title Page</title>
<!-- font-awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://bootswatch.com/4/flatly/bootstrap.min.css">
<!-- Bootstrap JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- jQueryUi -->
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!--script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script-->
<link rel="stylesheet" href="fullcalendar/fullcalendar.min.css">
<link rel="stylesheet" href="fullcalendar/fullcalendar.print.css" media="print">
<link rel="stylesheet" href="custom.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<button id="b" class="btn-dark rounded mt-3">Information</button>
<hr>
<div class="row">
<div class="col-md-4" style="margin-bottom: 50px;">
<div class="card">
<!-- choice a color -->
<div class="row m-2">
<!--div class="col-md-2">
<label for="color" class="control-label">Color</label>
</div-->
<div class="col-md-12">
<select name="color" class="form-control" id="color">
<option value="">Choose Color</option>
<option style="color:#0071c5;" value="#0071c5"> ⚫ Blue</option>
<option style="color:#2E716A;" value="#2E716A"> ⚫Teal</option>
<option style="color:#00a65a;" value="#00a65a;"> ⚫ Green</option>
<option style="color:#FF8C00;" value="#FF8C00"> ⚫ Orange</option>
<option style="color:#CA0202;" value="#CA0202"> ⚫ Dark Red</option>
<option style="color:#f56954;" value="#f56954"> ⚫ Lite Red</option>
</select>
</div>
</div>
<!-- how to use -->
<div class="row" id="how" style="display: none">
<div class="col-md-12">
<ol class='text-info list-group'>
<li class='list-group-item list-group-item-dark'> <i class="fa fa-info-circle"></i> You must change the color.The default color is blue.</li>
<li class='list-group-item list-group-item-info'> <i class="fa fa-info-circle"></i> Click on the Date to Insert Event.</li>
<li class='list-group-item list-group-item-danger'> <i class="fa fa-info-circle"></i> Drag on the Date to Insert Event in Mulitple Date.</li>
<li class='list-group-item list-group-item-success'> <i class="fa fa-info-circle"></i> Click on the Event to Edit Event.</li>
<li class='list-group-item list-group-item-primary'> <i class="fa fa-info-circle"></i> Resize Event to Update Event.</li>
<li class='list-group-item list-group-item-warning'> <i class="fa fa-info-circle"></i> Move the Event to Update Event.</li>
<li class='list-group-item list-group-item-danger'> <i class="fa fa-info-circle"></i> Right Click on the Event to Delete.</li>
</ol>
</div>
</div>
</div>
</div>
<div class="col-md-8">
<div id="calendar"></div>
</div>
</div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<script src="fullcalendar/fullcalendar.min.js"></script>
</html>
<script>
$(document).ready(function($) {
$("#b").click(function(event) {
/* Act on the event */
$( "#how" ).toggle( "slide", { direction: "up" }, 1000);
});
});
</script>
<script>
$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
theme: true,
themeSystem:'bootstrap4',
height:500,
editable:true,
eventLimit: true,
header: {
left: 'prevYear,prev,next,nextYear today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listWeek'
},
customButtons: {
ForwardButton: {
icon: "right-single-arrow",
},
BackwardButton: {
icon: "left-single-arrow",
}
},
events: 'action.php',
selectable:true,
selectHelper:true,
select: function(startDate, endDate, allDay)
{
var title = prompt("Enter Event Title");
if(title){
var start = startDate.format();
var end = endDate.format();
var color = $("#color").val();
$.ajax({
url:"crud.php",
type:"POST",
data:{title:title, start:start, end:end,color:color, insert:'0k'},
success:function()
{
calendar.fullCalendar('refetchEvents');
}
})
}
},
editable:true,
eventResize:function(event)
{
var start= moment(event.start).format('YYYY/MM/DD');
var end= moment(event.end).format('YYYY/MM/DD');
var title = event.title;
var id = event.id;
var color = $("#color").val();
$.ajax({
url:"crud.php",
type:"POST",
data:{title:title, start:start, end:end, id:id, update:'ok'},
success:function(){
calendar.fullCalendar('refetchEvents');
}
})
},
eventDrop:function(event)
{
var start= moment(event.start).format('YYYY/MM/DD');
var end= moment(event.end).format('YYYY/MM/DD');
var title = event.title;
var id = event.id;
var color = $("#color").val();
$.ajax({
url:"crud.php",
type:"POST",
data:{title:title, start:start, end:end, id:id, update:'ok'},
success:function()
{
calendar.fullCalendar('refetchEvents');
}
});
},
eventClick:function(event)
{
var start = moment(event.start).format('YYYY/MM/DD');
var end = moment(event.end).format('YYYY/MM/DD');
var id = event.id;
var color = $("#color").val();
var title = prompt("Enter New Event Title");
if(title){
$.ajax({
url:"crud.php",
type:"POST",
data:{title:title, start:start, end:end, id:id,color:color, update:'ok'},
success:function()
{
calendar.fullCalendar('refetchEvents');
}
});
}
},
droppable : true,
drop: function(date){
var originalEventObject = $(this).data('eventObject');
var copiedEventObject = $.extend({}, originalEventObject);
var title = copiedEventObject.title;
copiedEventObject.backgroundColor = $(this).css('background-color');
var color = copiedEventObject.backgroundColor;
$.ajax({
url:"crud.php",
type:"POST",
data:{title:title, start:date.format(),color:color, insert:'0k'},
success:function()
{
calendar.fullCalendar('refetchEvents');
}
})
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove()
var id = $(this).attr('tanboe');
$.ajax({
url:"crud.php",
type:"POST",
data:{id:id, delete_event:'ok'},
success:function()
{
ele.remove();
}
})
}
},
eventRender: function (event, element) {
element.bind('mousedown', function (e) {
if (e.which == 3) {
if(confirm("Are you sure you want to remove it?"))
{
var id = event.id;
$.ajax({
url:"crud.php",
type:"POST",
data:{id:id, delete:'ok'},
success:function()
{
calendar.fullCalendar('refetchEvents');
}
})
}
}
});
}
});
});
</script>