
Problem s ukladanim do db
Dobrý den chtěl jsem sporvoznit v admin panelu calendar ale mam problem...nepovede se mi to ulozit do db kod je nasledujici
var calendar = $('#calendar').fullCalendar({
header: h,
editable: true,
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;
copiedEventObject.className = $(this).attr("data-class");
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
$.ajax({
type: "POST",
url: "http://bshop.hys.cz/try/add_events.php",
data: {},
contentType: "application/json",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
calendarStoredEvents = $.map(msg.d, function (item) {
return {
title: item.EventTitle,
start: item.start,
id: item.EventID,
className: item.EventclassName
};
});
initializeCalendar(calendarStoredEvents);
}
});
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
events: "http://localhost/try/events.php",
Tendle kod jsem se dopsal. ale neuklada do db vi nekdo jak an to prosim?
$.ajax({
type: "POST",
url: "http://local/try/add_events.php",
data: {},
contentType: "application/json",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
calendarStoredEvents = $.map(msg.d, function (item) {
return {
title: item.EventTitle,
start: item.start,
id: item.EventID,
className: item.EventclassName
};
});
initializeCalendar(calendarStoredEvents);
}
});