-
Notifications
You must be signed in to change notification settings - Fork 1
/
tutorial_detail.php
241 lines (193 loc) · 6.75 KB
/
tutorial_detail.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?php
session_start();
include_once "inc/markdown.php";
include('inc/db_conn.php');
$talk_id = $_GET['id'];
//===========================
// pull tutorial
//===========================
$sql_tutorial = "SELECT ";
$sql_tutorial .= "presenters.id AS presenter_id, ";
$sql_tutorial .= "talks.id AS talk_id, ";
$sql_tutorial .= "title, ";
$sql_tutorial .= "abstract, ";
$sql_tutorial .= "talks.description, ";
$sql_tutorial .= "outline, ";
$sql_tutorial .= "packages, ";
$sql_tutorial .= "documentation, ";
$sql_tutorial .= "track, ";
$sql_tutorial .= "released, ";
$sql_tutorial .= "license_type_id, ";
$sql_tutorial .= "video_link, ";
$sql_tutorial .= "tags, ";
$sql_tutorial .= "DATE_FORMAT(start_time, '%b') AS start_month, ";
$sql_tutorial .= "DATE_FORMAT(start_time, '%d') AS start_day, ";
$sql_tutorial .= "DATE_FORMAT(start_time, '%W') AS start_dow, ";
$sql_tutorial .= "DATE_FORMAT(start_time, '%H:%i %p') AS start_time, ";
$sql_tutorial .= "DATE_FORMAT(end_time, '%Y') AS end_year, ";
$sql_tutorial .= "DATE_FORMAT(end_time, '%c') AS end_month, ";
$sql_tutorial .= "DATE_FORMAT(end_time, '%d') AS end_day, ";
$sql_tutorial .= "DATE_FORMAT(end_time, '%H:%i %p') AS end_time, ";
$sql_tutorial .= "location_id, ";
$sql_tutorial .= "name ";
$sql_tutorial .= "FROM talks ";
$sql_tutorial .= "LEFT JOIN presenters_talks ";
$sql_tutorial .= "ON talk_id = talks.id ";
$sql_tutorial .= "LEFT JOIN presenters ";
$sql_tutorial .= "ON presenters_talks.presenter_id = presenters.id ";
$sql_tutorial .= "LEFT JOIN schedules ";
$sql_tutorial .= "ON schedules.talk_id = talks.id ";
$sql_tutorial .= "LEFT JOIN locations ";
$sql_tutorial .= "ON location_id = locations.id ";
$sql_tutorial .= "WHERE talks.id = \"$talk_id\"";
$total_tutorial = @mysql_query($sql_tutorial, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
while($row = mysql_fetch_array($total_tutorial))
{
$last_name = $row['last_name'];
$first_name = $row['first_name'];
$affiliation = $row['affiliation'];
$email = $row['email'];
$bio = $row['bio'];
$presenter_id = $row['presenter_id'];
$talk_id = $row['talk_id'];
$title = $row['title'];
$abstract = $row['abstract'];
$track = $row['track'];
$released = $row['released'];
$license_type_id = $row['license_type_id'];
$video_link = $row['video_link'];
$tags = $row['tags'];
$description = $row['description'];
$outline = $row['outline'];
$packages = $row['packages'];
$documentation = $row['documentation'];
$start_time = $row['start_time'];
$end_time = $row['end_time'];
$start_year_set = $row['start_year'];
$start_month_set = $row['start_month'];
$start_day_set = $row['start_day'];
$start_dow = $row['start_dow'];
$start_hour = $row['start_hour'];
$start_minute = $row['start_minute'];
$end_year_set = $row['end_year'];
$end_month_set = $row['end_month'];
$end_day_set = $row['end_day'];
$end_hour = $row['end_hour'];
$end_minute = $row['end_minute'];
$location = $row['location'];
$author_list[] = $row['presenter_id'];
$location = $row['name'];
}
//===========================
// pull presenters
//===========================
foreach ($author_list as $key =>$value)
{
$sql_presenters = "SELECT ";
$sql_presenters .= "last_name, ";
$sql_presenters .= "first_name, ";
$sql_presenters .= "affiliation, ";
$sql_presenters .= "email, ";
$sql_presenters .= "bio ";
$sql_presenters .= "FROM presenters ";
$sql_presenters .= "WHERE id = $value";
$total_presenters = @mysql_query($sql_presenters, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
while($row = mysql_fetch_array($total_presenters))
{
$last_name = $row['last_name'];
$first_name = $row['first_name'];
$affiliation = $row['affiliation'];
$bio = $row['bio'];
$display_authors .= "$first_name $last_name - $affiliation<br />";
$display_bios .= "<p>$first_name $last_name<br />$bio</p>";
}
}
//===========================
// pull videos
//===========================
$sql_video = "SELECT ";
$sql_video .= "part, ";
$sql_video .= "length, ";
$sql_video .= "title, ";
$sql_video .= "link ";
$sql_video .= "FROM videos ";
$sql_video .= "WHERE talk_id = \"$talk_id\" ";
$sql_video .= "ORDER BY part ASC";
$total_video = @mysql_query($sql_video, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
$count = 0;
do {
if ($row['title'] != '')
{
$display_videos .="
<div class=\"free_cell\" style=\"text-align: center; border-top: 1px solid #ccc; margin: 0 0.25em;\"><iframe width=\"100%\" src=\"//www.youtube.com/embed/" . $row['link'] . "\" frameborder=\"0\" allowfullscreen></iframe><br /><a href=\"http://www.youtube.com/watch?v=" . $row['link'] . "\">Part " . $row['part']. "</a><br />[" . $row['length']. "]</div>";
}
$count = $count + 1;
}
while ($row = mysql_fetch_array($total_video));
?>
<!DOCTYPE html>
<html>
<?php $thisPage="Tutorials"; ?>
<head>
<?php @ require_once ("inc/header.php"); ?>
<link rel="shortcut icon" href="http://conference.scipy.org/scipy2013/favicon.ico" />
</head>
<body>
<div id="container">
<?php include('inc/page_headers.php') ?>
<section id="sidebar">
<?php include("inc/sponsors.php") ?>
</section>
<section id="main-content">
<div class="cell, schedule_info">
<?php echo "$start_dow" ?><br />
<div class="icon_date" style="margin: 0 auto;"><?php echo $start_month_set ?><br /><span class="icon_date_day"><?php echo $start_day_set ?></span></div>
<?php echo "$start_time" ?><br />
<?php echo "$end_time" ?><br />
Room: <a href="location_floor_map.php"><?php echo $location ?></a>
</div>
<div style="background: #eee; border: 1px solid #ccc; font-size: 0.75em; width: 40em; padding: 0.25em 0.75em; margin: 0 0 1em 0;">
<img src="img/note.png" align="left" /><p>To get the most out of the tutorials, you will need to have the correct software installed and running. Specific requirements for each tutorial are specified in the detailed description for each tutorial. But it's best to start with one of the <a href="http://www.scipy.org/install.html" style="text-decoration: underline;">scientific Python distributions</a> to ensure an environment that includes most of the packages you'll need.</p>
</div>
<h1><?php echo $title ?></h1>
<p><?php echo $display_authors ?></p>
<hr />
<section id="tutorial-content">
<?php
if ($display_videos != "")
{
if ($count > 1)
{
echo "<h3>Videos</h3> <div class=\"row\">";
}
else
{
echo "<h3>Video</h3> <div class=\"row\">";
}
echo $display_videos;
echo "</div>";
}
?>
<h3>Bio(s)</h3>
<?php echo $display_bios ?>
<hr />
<h3>Description</h3>
<?php echo Markdown($description) ?>
<hr />
<h3>Outline</h3>
<?php echo Markdown($outline) ?>
<hr />
<h3>Required Packages</h3>
<?php echo Markdown($packages) ?>
<hr />
<h3>Documentation</h3>
<?php echo Markdown($documentation) ?>
</section>
</section>
<div style="clear: both;"></div>
<footer id="page_footer">
<?php include('inc/page_footer.php') ?>
</footer>
</div>
</body>
</html>