forked from hoveychen/Sicily
/
courses.php
53 lines (48 loc) · 1.35 KB
/
courses.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
<?
require("navigation.php");
$p = tryget("p", 1);
$rs = new RecordSet($conn);
$query_str = "SELECT course_id, name, teacher, description FROM courses WHERE avail = 1 ";
$count_str = "SELECT count(*) FROM courses WHERE avail = 1";
$rs->nPageSize = 20;
$rs->PageCount($count_str);
$rs->SetPage($p);
$query_str .= "ORDER BY course_id DESC";
$rs->dpQuery($query_str);
$now = time();
?>
<h1><?= _("Current Courses") ?></h1>
<table class="ui-widget tblcontainer ui-widget-content ui-corner-all" width="100%">
<thead >
<tr class="ui-widget-header">
<th width="100"><?= _("ID") ?></th>
<th width="300"><?= _("Name") ?></th>
<th width="300"><?= _("Teacher") ?></th>
<th width="100"><?= _("Registrant No.") ?></th>
<th> <?= _("Status") ?> </th>
</tr>
</thead>
<tbody>
<?
while ($rs->MoveNext()) {
$course_id = $rs->Fields["course_id"];
$name = htmlspecialchars($rs->Fields["name"]);
$teacher = htmlspecialchars($rs->Fields["teacher"]);
?>
<tr>
<td> <?= $course_id ?> </td>
<td> <a href="course_detail.php?course_id=<?= $course_id ?>"><?= $name ?></a> </td>
<td> <?= $teacher ?> </td>
<td> <?= get_course_reg_num($course_id) ?> </td>
<td> Available
</td>
</tr>
<?
}
?>
</tbody>
</table>
<?
echo $rs->Navigate();
require("footer.php");
?>