This tutorial shows how to use the DayPilot Monthly Event Calendar for JavaScript with PHP.
It includes a sample PHP project:
The sample PHP project is available for download.
function loadEvents() { DayPilot.request("backend_events.php", function(result) { var data = eval("(" + result.responseText + ")"); dp.events.list = data; dp.update(); }); }
backend_events.php
<?php require_once '_db.php'; $result = $db->query('SELECT * FROM events'); class Event {} $events = array(); foreach($result as $row) { $e = new Event(); $e->id = $row['id']; $e->text = $row['name']; $e->start = $row['start']; $e->end = $row['end']; $events[] = $e; } echo json_encode($events); ?>