Я пытаюсь использовать полнофункциональный календарь календаря jQuery для FullCalendars для моего приложения, но у меня возникают проблемы с созданием событий в моем календаре с SQL Server.Интеграция полного календаря с SQL Server
Heres мой код: Первый JS
$(document).ready(function() {
var date = new Date();
var day = date.getDate();
var month = date.getMonth();
var year = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true,
eventLimit: true,
eventsources: 'events.php'
});
});
Второй events.php файл
<?php
$serverName = "ADMIN-PC\SQLEXPRESS"; //serverName\instanceName
$connectionInfo = array("Database"=>"testing", "UID"=>"sa", "PWD"=>"password");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if($conn) {
echo "Connection established.<br />";
} else {
echo "Connection could not be established.<br />";
die(print_r(sqlsrv_errors(), true));
}
$sql = "SELECT id, custcode, title, description, datetime, status
FROM dbo.calls";
$stmt=sqlsrv_query($conn, $sql);
// Initializes a container array for all of the calendar events
$jsonArray = array();
while($row = sqlsrv_fetch_array($stmt))) {
$custcode = $row['custcode'];
$date = $row['datetime'];
// Stores each database record to an array
$buildjson = array('title' => "$custcode", 'start' => "$date", 'allday' => false);
// Adds each array into the container array
array_push($jsonArray, $buildjson);
}
// Output the json formatted data so that the jQuery call can read it
echo json_encode($jsonArray);
?>
На данный момент я не получаю каких-либо событий, ни ошибок! ПОМОГИТЕ!!!
Спасибо всем :)
что выход events.php? – Bulat
@Bulat ничто в данный момент, это вызвано моими js, а затем выведенным в div на странице html. –
Каков вывод страницы, когда вы нажмете ее прямо? – Bulat