I'm a HTML/CSS guy and know practically nothing about JavaScript/PHP.
We are currently developing a scheduling system using DayPilot linked with our Access production system. We're almost done (It works very well) and ready to license DayPilot however I've hit a snag.
Using the right click menu within the scheduler we want to add in a "Click to Open" menu item that will open a PDF stored as a link within the MySql DB as a field "URL"
I've tried, and tried... and tried Googling for a solution however I cannot find an answer.
Answer posted by Dan Letecky [DayPilot] 3 years ago.
1. First, you need to load the link from the database and store it as an additional property of the event data object. This can be done in the backend API endpoint that returns events. In most PHP examples, it is called backend_events.php.
<?php
require_once '_db.php';
$stmt = $db->prepare('SELECT * FROM events WHERE NOT ((end <= :start) OR (start >= :end))');
$stmt->bindParam(':start', $_GET['start']);
$stmt->bindParam(':end', $_GET['end']);
$stmt->execute();
$result = $stmt->fetchAll();
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'];
$e->resource = $row['resource_id'];
$e->url= $row['URL'];
$events[] = $e;
}
header('Content-Type: application/json');
echo json_encode($events);