forked from clee231/Flourish-Conference-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule_json.php
executable file
·47 lines (39 loc) · 1.1 KB
/
schedule_json.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
define('SITE_PATH', './');
define('HACKFREE', 1);
//// INCLUDE INFO
include (SITE_PATH."common.php");
$stmt = $db->stmt_init();
$sql = "SELECT x.id,x.talkTitle,x.talkDescription,x.start_time,x.end_time,x.location,x.speaker,y.name FROM ". TALKS_TABLE ." x, ". SPEAKER_TABLE ." y WHERE x.speaker = y.id ORDER BY start_time ASC";
if ( $stmt->prepare($sql) )
{
$stmt->execute();
$result = $stmt->get_result();
//check for same time talks
while ( $row = $result->fetch_assoc())
{
if ( $row['name'] != "" )
{
$json[] = array (
'name' => $row['talkTitle'],
'room' => $row['location'],
'start' => date("m/d/Y H:i:s", $row['start_time']),
'end' => date("m/d/Y H:i:s", $row['end_time']),
'authors' => $row['name'],
'contact' => "",
'released' => true,
'license' => "",
'description' => $row['talkDescription'],
'conf_key' => $row['id'],
'conf_url' => ROOT."/speakers_details.php?id=".$row['speaker'],
'tags' => "",
);
}
}
echo json_encode($json);
}
$stmt->close();
//We reached end, parse and end
include (SITE_PATH."footer.php");
//We're out of here.
?>