276 lines
10 KiB
PHP
276 lines
10 KiB
PHP
</div>
|
|
<?php
|
|
include("inc/footer.php");
|
|
?>
|
|
|
|
<?php
|
|
//include required scripts
|
|
include("inc/scripts.php");
|
|
|
|
?>
|
|
|
|
<!-- PAGE RELATED PLUGIN(S)
|
|
<!-- PAGE RELATED PLUGIN(S) -->
|
|
<script src="<?php echo ASSETS_URL; ?>/js/plugin/jquery-form/jquery-form.min.js"></script>
|
|
|
|
<!-- Full Calendar -->
|
|
<script src="<?php echo ASSETS_URL; ?>/js/plugin/moment/moment.min.js"></script>
|
|
<script src="<?php echo ASSETS_URL; ?>/js/plugin/fullcalendar/fullcalendar.min.js"></script>
|
|
|
|
!-- END MAIN PANEL -->
|
|
<!-- ==========================CONTENT ENDS HERE ========================== -->
|
|
|
|
<script src="<?php echo ASSETS_URL; ?>/js/plugin/moment/moment.min.js"></script>
|
|
<script src="<?php echo ASSETS_URL; ?>/js/plugin/fullcalendar/fullcalendar.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
// DO NOT REMOVE : GLOBAL FUNCTIONS!
|
|
|
|
$(document).ready(function() {
|
|
|
|
pageSetUp();
|
|
|
|
|
|
"use strict";
|
|
|
|
var date = new Date();
|
|
var d = date.getDate();
|
|
var m = date.getMonth();
|
|
var y = date.getFullYear();
|
|
var mem_events=[];
|
|
var hdr = {
|
|
left: 'title',
|
|
center: 'month,agendaWeek,agendaDay',
|
|
right: 'prev,today,next'
|
|
};
|
|
|
|
var mem_select_1 = <?php echo $this->Config_model->conf_getFiltreData($this->session->id,'calendrier','mem_select_1',0,0); ?>;
|
|
var mem_select_2 = <?php echo $this->Config_model->conf_getFiltreData($this->session->id,'calendrier','mem_select_2',0,0); ?>;
|
|
var mem_select_3 = <?php echo $this->Config_model->conf_getFiltreData($this->session->id,'calendrier','mem_select_3',0,0); ?>;
|
|
|
|
$(".filtre_1").on("change", function(){
|
|
|
|
var optionSelected = $("option:selected", this);
|
|
mem_select_1 = this.value;
|
|
|
|
update_filtre();
|
|
});
|
|
|
|
$(".filtre_2").on("click", function(){
|
|
// var optionSelected = $("option:selected", this);
|
|
//mem_select_2 = this.value;
|
|
mem_select_2 = $("input[name='filtre_2']:checked").val();
|
|
|
|
|
|
update_filtre();
|
|
});
|
|
$(".filtre_3").on("click", function(){
|
|
// var optionSelected = $("option:selected", this);
|
|
//mem_select_2 = this.value;
|
|
mem_select_3 = $("input[name='filtre_3']:checked").val();
|
|
|
|
|
|
update_filtre();
|
|
});
|
|
var addEvent = function (title, priority, description, icon) {
|
|
title = title.length === 0 ? "Untitled Event" : title;
|
|
description = description.length === 0 ? "No Description" : description;
|
|
icon = icon.length === 0 ? " " : icon;
|
|
priority = priority.length === 0 ? "label label-default" : priority;
|
|
|
|
var html = $('<li><span class="' + priority + '" data-description="' + description + '" data-icon="' +
|
|
icon + '">' + title + '</span></li>').prependTo('ul#external-events').hide().fadeIn();
|
|
|
|
$("#event-container").effect("highlight", 800);
|
|
|
|
initDrag(html);
|
|
};
|
|
|
|
|
|
|
|
/* initialize the calendar
|
|
-----------------------------------------------------------------*/
|
|
calendrier();
|
|
function calendrier(){
|
|
|
|
|
|
//$('#calendar').fullCalendar('removeEvents');
|
|
|
|
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/Home/returnparjour/'+mem_select_1+'/'+mem_select_2+'/'+mem_select_3,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
console.log(responseData.taches);
|
|
var events = [];
|
|
$.each(responseData.taches, function(idx, e) {
|
|
events.push({
|
|
start: e.start,
|
|
title: e.qte+' Tache(s)',
|
|
details: e.details
|
|
});
|
|
});
|
|
console.log(responseData.projets_annule);
|
|
$.each(responseData.projets_annule, function(idx, e) {
|
|
events.push({
|
|
start: e.start,
|
|
title: e.qte+' Annulation(s)',
|
|
backgroundColor: 'red',
|
|
details: e.details
|
|
});
|
|
});
|
|
$.each(responseData.projets_conf, function(idx, e) {
|
|
events.push({
|
|
start: e.start,
|
|
title: e.qte+' Confirmation(s)',
|
|
backgroundColor: 'green',
|
|
details: e.details
|
|
});
|
|
});
|
|
$.each(responseData.projets_debut, function(idx, e) {
|
|
events.push({
|
|
start: e.start,
|
|
title: e.qte+' Départ(s)',
|
|
backgroundColor: '#c653c6',
|
|
details: e.details
|
|
});
|
|
});
|
|
$.each(responseData.projets_dossard, function(idx, e) {
|
|
events.push({
|
|
start: e.start,
|
|
title: e.qte+' Dossard(s)',
|
|
backgroundColor: '#c653c6',
|
|
details: e.details
|
|
});
|
|
});
|
|
console.log(events);
|
|
$('#calendar').fullCalendar({
|
|
eventClick:function(event, jsEvent, view) {
|
|
$('#modalTitle').html(event.title);
|
|
$('#modalBody').html(event.details);
|
|
$('#eventUrl').attr('href',event.url);
|
|
$('#calendarModal').modal();
|
|
},
|
|
header: hdr,
|
|
contentHeight: 555,
|
|
editable: false,
|
|
droppable: false, // 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();
|
|
}
|
|
|
|
},
|
|
|
|
select: function (start, end, allDay) {
|
|
var title = prompt('Event Title:');
|
|
if (title) {
|
|
calendar.fullCalendar('renderEvent', {
|
|
title: title,
|
|
start: start,
|
|
end: end,
|
|
allDay: allDay
|
|
}, true // make the event "stick"
|
|
);
|
|
}
|
|
calendar.fullCalendar('unselect');
|
|
},
|
|
|
|
events: events,
|
|
|
|
eventRender: function (event, element, icon) {
|
|
if (!event.description == "") {
|
|
element.find('.fc-title').append("<br/><span class='ultra-light'>" + event.description +
|
|
"</span>");
|
|
}
|
|
if (!event.icon == "") {
|
|
element.find('.fc-title').append("<i class='air air-top-right fa " + event.icon +
|
|
" '></i>");
|
|
}
|
|
},
|
|
|
|
windowResize: function (event, ui) {
|
|
$('#calendar').fullCalendar('render');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// console.log(memevents);
|
|
|
|
}
|
|
function update_filtre(){
|
|
|
|
//alert('<?=base_url()?>index.php/Home/update_filtre/'+mem_select_1+'/'+mem_select_2+'/'+mem_select_3);
|
|
$.ajax({
|
|
url: '<?=base_url()?>index.php/Home/update_filtre/'+mem_select_1+'/'+mem_select_2+'/'+mem_select_3,
|
|
type: 'get',
|
|
dataType: 'json',
|
|
success: function(responseData){
|
|
location.reload();
|
|
}
|
|
});
|
|
|
|
// console.log(memevents);
|
|
|
|
}
|
|
|
|
|
|
/* hide default buttons */
|
|
$('.fc-right, .fc-center').hide();
|
|
|
|
|
|
$('#calendar-buttons #btn-prev').click(function () {
|
|
$('.fc-prev-button').click();
|
|
return false;
|
|
});
|
|
|
|
$('#calendar-buttons #btn-next').click(function () {
|
|
$('.fc-next-button').click();
|
|
return false;
|
|
});
|
|
|
|
$('#calendar-buttons #btn-today').click(function () {
|
|
$('.fc-today-button').click();
|
|
return false;
|
|
});
|
|
|
|
$('#mt').click(function () {
|
|
$('#calendar').fullCalendar('changeView', 'month');
|
|
});
|
|
|
|
$('#ag').click(function () {
|
|
$('#calendar').fullCalendar('changeView', 'agendaWeek');
|
|
});
|
|
|
|
$('#td').click(function () {
|
|
$('#calendar').fullCalendar('changeView', 'agendaDay');
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|
|
<?php
|
|
//include footer
|
|
include("inc/google-analytics.php");
|
|
?>
|