-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathclass_calendar_script.php
55 lines (44 loc) · 2.02 KB
/
class_calendar_script.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
<script>
$(function() {
// Easy pie charts
var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,basicWeek,basicDay'
},
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
editable: true,
// US Holidays
events:
[
<?php $event_query = mysql_query("select * from event where teacher_class_id = '$get_id' or teacher_class_id = '' ")or die(mysql_error());
while($event_row = mysql_fetch_array($event_query)){
?>
{
title : '<?php echo $event_row['event_title']; ?> ',
start : '<?php echo $event_row['date_start']; ?>',
end : '<?php echo $event_row['date_end']; ?>'
},
<?php } ?>
]
});
});
</script>