| Autor | Zpráva | ||
|---|---|---|---|
| Pepino11 Profil * |
#1 · Zasláno: 9. 2. 2014, 11:10:45 · Upravil/a: Pepino11
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://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);
}
});Pepino11: Má ta bý url: "http://bshop.hys.cz/try/add_event.php", |
||
| Lamicz Profil |
#2 · Zasláno: 9. 2. 2014, 14:52:22
IMHO jsou data v POST prázdná -
data: {}. Si to v tom add_events.php vypiš - var_dump($_POST);
|
||
| Pepino11 Profil * |
#3 · Zasláno: 9. 2. 2014, 16:23:23 · Upravil/a: Pepino11
Lamicz:
$start=var_dump($_POST['start']); takle? Lamicz: Neprijsou zadny data...jen pradzny if($_POST['title']=="")
{
$title="nejde";
}
else
{
$title=$_POST['title'];
} |
||
|
Časová prodleva: 12 let
|
|||
0