0

我正在使用 fullCalendar 并且它可以工作..直到现在..

我正在使用 Firefox,我看到我的脚本发送到日历的请求是fullCalendar.html并且没有event.php?start=....

这是我的配置脚本:

$(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"
  });
});

这是我的 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);
?>

有人可以告诉我有什么问题吗?谢谢!

4

1 回答 1

0

已解决:您必须在调用日历的页面头部包含脚本。

<head>
  <link rel="stylesheet" type="text/css" href="fullCalendar/css/fullcalendar.css" />        
  <link rel="stylesheet" type="text/css" href="fullCalendar/css/jquery.alerts.css" />
  <link rel='stylesheet' type='text/css' href='fullCalendar/css/fullcalendar.print.css' media='print' />
  <script type="text/javascript" src="fullCalendar/js/fullcalendar.js"></script>
  <script type="text/javascript" src="fullCalendar/js/jquery.alerts.js"></script>           
  <script type="text/javascript" src="fullCalendar/js/myScript.js"></script>
 </head>

<div id="calendar"></div>
于 2013-01-18T10:38:35.260 回答