-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcourses.php
More file actions
38 lines (31 loc) · 1.27 KB
/
courses.php
File metadata and controls
38 lines (31 loc) · 1.27 KB
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
<?
require('functionlib.php');
session_start();
if (!isset($_SESSION["studentKey"])) { redirect('index.php'); die(); }
if ($_SESSION["signupStage"] <> 9) { redirect('index.php'); die(); }
require('config.php');
printhead("p { margin: 0 0 1em 0; }");
startbody();
$logresult = write_log($_SESSION["username"] . " browsed courses");
printmenu_start();
?>
<p><strong>Browse Current Courses</strong></p>
<p>To open the discussion from one of your current courses, use the links under <strong>My Class Discussions</strong> on the left.</p>
<p>To read the public discussion from another course, click on that cousre.</p>
<p><strong>Current Courses:</strong></p>
<?
$query = "SELECT `classKey`,`classNumber`,`sectionNumber`,`courseTitle`,`instructor` FROM `classes` WHERE `sectionNumber` > 0 ORDER BY `classNumber`,`instructor`,`sectionNumber`";
$result = myquery($query);
echo '<table class="courseList">';
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td class="statnum">' . $row["classNumber"] . '</td>';
echo '<td>(' . $row["sectionNumber"] . ') <a href="course.php?id=' . $row["classKey"] . '">' . trim($row["courseTitle"]) . '</a></td>';
echo '<td class="inst">' . $row["instructor"] . '</td>';
echo '<tr>';
}
echo '</table>';
printmenu_end();
endbody();
mysql_close();
?>