forked from clee231/Flourish-Conference-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule.php
executable file
·91 lines (72 loc) · 2.04 KB
/
schedule.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?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 AND start_time < 1333170000 ORDER BY start_time ASC";
if ( $stmt->prepare($sql) )
{
$stmt->execute();
$result = $stmt->get_result();
//check for same time talks
$current_hour = 0;
$current_minute = 0;
$i = 0;
$j = 0;
while ( $row = $result->fetch_assoc())
{
$hour = date("G", $row['start_time']);
$minute = date("i", $row['start_time']);
$row['start_time'] = date("g:i A", $row['start_time']);
$row['end_time'] = date("g:i A", $row['end_time']);
$row['hour'] = $hour;
if ( $hour != $current_hour || $minute != $current_minute )
{
$i++;
$j = 0;
}else{
$j++;
}
$talksFri[$i][$j] = $row;
$current_hour = $hour;
$current_minute = $minute;
}
}
$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 AND start_time >= 1333170000 ORDER BY start_time ASC";
if ( $stmt->prepare($sql) )
{
$stmt->execute();
$result = $stmt->get_result();
//check for same time talks
$current_hour = 0;
$current_minute = 0;
$i = 0;
$j = 0;
while ( $row = $result->fetch_assoc())
{
$hour = date("G", $row['start_time']);
$minute = date("i", $row['start_time']);
$row['start_time'] = date("g:i A", $row['start_time']);
$row['end_time'] = date("g:i A", $row['end_time']);
$row['hour'] = $hour;
if ( $hour != $current_hour || $minute != $current_minute )
{
$i++;
$j = 0;
}else{
$j++;
}
$talksSat[$i][$j] = $row;
$current_hour = $hour;
$current_minute = $minute;
}
}
$stmt->close();
$smarty->assign('talksFri', $talksFri);
$smarty->assign('talksSat', $talksSat);
//We reached end, parse and end
include (SITE_PATH."footer.php");
$smarty->display('schedule.tpl');
//We're out of here.
?>