Added classes menu for students with more than one class.
[Assignment-Trapper.git] / index.php
blobd886390c11a26bcca3661e7c1b86cd3f95671126
1 <?php
3 include_once("auth.php");
4 include_once("header.php");
5 include_once("time.php");
7 // files that have been line commented by faculty
8 $sql = 'select sched_id, title, type_name, chapter, section_id, ava_date, due_date, graded, NOW()-due_date as due, NOW()-ava_date as ava from schedule, types where (schedule.assign_type = types.assign_type) and sched_id = ANY (select sub_id from comments where fac_id is NOT NULL and user_id = '.$user_id.' group by sub_id) order by due_date desc, ava_date desc, title desc, chapter desc, section_id desc';
10 //echo $sql;
12 $result = mysql_query($sql);
14 if (!$result) { die("SQL ERROR"); }
15 $html = "";
16 while($row = mysql_fetch_array($result))
18 $html .= '<tr><td>'.$row['sched_id'].'</td>';
19 //$html .= '<tr><td>'.$row[10].'</td>';
21 // assignment open?
22 if($row['due'] > 0 || $row['ava'] < 0) { $html .= "<td><img src=gfx/bullet_delete.png>"; } else { $html .= "<td><img src=gfx/bullet_add.png>"; }
24 // assignment graded?
25 if($row['graded']) { $html .= "<img src=gfx/bullet_disk.png>"; } else { $html .= "<img src=gfx/bullet_wrench.png>"; }
27 $html .= '<img src=gfx/email.png></td>';
29 $html .= '<td><a href="detail_root.php?sched='.$row['sched_id'].'">'.$row['title'].'</a></td><td>'.$row['type_name'].'</td><td>'.$row['chapter'].'</td>';
31 $html .= '<td>'.$row['section_id'].'</td><td>'.$row['ava_date'].'</td><td>'.$row['due_date'].'</td>';
33 $html .= '<td>'.absHumanTiming($row['due_date']).'</td>';
35 //if($role==0) { $html .= '<td><a href="assignment_add.php?sched='.$row[7].'&action=edit">Edit</a></td>'; }
37 $html .= '</tr>';
40 // list of assignments with comments by faculty.
42 //$sql = "";
44 // list of recently graded assignments - most recent first
45 $sql = "select sched_id, title, chapter, section_id from schedule where graded = 1 and class_id =2 order by due_date, ava_date, title, chapter, section_id;";
49 <h3>Recent Assignment Comments</h3>
51 <table class="gridtable">
52 <tr>
53 <th>#</th><th>Status</th><th>Title</th><th>Type</th><th>Chapter</th><th>Section</th><th>Avalaible Date</th><th>Due Date</th><th>Human Time</th>
54 <?php if($role==0) { echo '<th>Update</th>'; } ?>
55 </tr>
56 <?php echo $html; ?>
57 </table>