I’m using fullCalendar and it works..until now..
I’m using firefox and I see that the request that my script send to the calendar is fullCalendar.htmland noevent.php?start=....
Here is my configuration script:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
firstDay:1,
defaultEventMinutes: 30, //default slot 30 minuti
axisFormat: 'HH:mm', //assi in agenda
timeFormat: 'HH:mm', //formato eventi
events: "fullCalendar/event.php"
});
});
And this is my event.php:
<?
include("../database/config.php");
if(isset($_GET["start"])){
$data = date("Y-m-d", $_GET["start"]); //date("Y-m-d 00:00:00");
}else{
$data = date("Y-m-d");
}
$data = $data." 00:00:00";
$query = "SELECT * FROM calendario WHERE 'start' > '$data'";
$result = mysql_query($query, $db);
if ($result==FALSE) die("Errore nella composizione della query");
while ($row = mysql_fetch_array($result)){
$id = $row['id'];
$titolo = $row['titolo'];
$start = $row['start'];
$end = $row['end'];
$descr = $row['descr'];
$allDay = $row['allDay'];
if ($allDay == "1"){
$events[] = array(
'id' => "$id",
'title' => "$titolo",
'start' => "$start",
'end' => "$end",
'allDay' => true,
'descr' => "$descr"
);
}else{
$events[] = array(
'id' => "$id",
'title' => "$titolo",
'start' => "$start",
'end' => "$end",
'allDay' => false,
'descr' => "$descr"
);
}
}
echo json_encode($events);
?>
Can somebody tell me what’s wrong?
Thanks!
RESOLVED:
You MUST include the script in the head of the page that call the calendar..