-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspeaker_details.php
executable file
·48 lines (40 loc) · 1.16 KB
/
speaker_details.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
48
<?php
define('SITE_PATH', './');
define('HACKFREE', 1);
//// INCLUDE INFO
include (SITE_PATH."common.php");
$stmt = $db->stmt_init();
$sql = "SELECT id,name,bio,picture FROM ". SPEAKER_TABLE . " WHERE id = ?";
if ( $stmt->prepare($sql) )
{
$stmt->bind_param("i", $_GET['id']);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$speaker = $row;
$sql = "SELECT * FROM ". TALKS_TABLE ." WHERE speaker = ?";
if ( $stmt->prepare($sql) )
{
$stmt->bind_param("i", $speaker['id']);
$stmt->execute();
$result = $stmt->get_result();
while ( $row = $result->fetch_assoc())
{
$row['hour'] = date("H", $row['start_time']);
$row['minute'] = date("i", $row['start_time']);
$row['dayofweek'] = date("l", $row['start_time']);
$row['date'] = date("m/d/Y", $row['start_time']);
$row['start_time'] = date("g:i A", $row['start_time']);
$row['end_time'] = date("g:i A", $row['end_time']);
$talks[] = $row;
}
}
}
$stmt->close();
$smarty->assign('speaker', $speaker);
$smarty->assign('talks', $talks);
//We reached end, parse and end
include (SITE_PATH."footer.php");
$smarty->display('speaker_details.tpl');
//We're out of here.
?>