Created management page for administrators.
[Assignment-Trapper.git] / index.php
blobb9bd78914bc619b386ae8263cb8a6180b92101c8
1 <?php
3 include_once("auth.php");
5 $html = "";
7 $user_id = mysql_real_escape_string($user_id);
9 $sql = 'select distinct class.class_id, class_name, class_section, class_location, class_instructor from enrollment, class, users where (users.user_id = enrollment.user_id) and (enrollment.class_id = class.class_id) and enrollment.user_id = '.$user_id;
11 $result = mysql_query($sql);
13 if (!$result) { die("SQL ERROR"); }
15 while($row = mysql_fetch_row($result))
17 //$html .= '<tr><td><a href=assignment.php?class='.$row[0].'>'.$row[1].'</a></td><td>'.$row[2].'</td>';
18 //$html .= '<td>'.$row[3].'</td><td>'.$row[4].'</td></tr>';
20 $html .= '<div class="class_block">';
21 $html .= '<h3><img src=gfx/house.png><a href=assignment.php?class='.$row[0].'>'.$row[1].'</a></h3>';
22 $html .= '<table><tr><td>Section:</td><td>'.$row[2].'</td></tr>';
23 $html .= '<tr><td>Location:</td><td>'.$row[3].'</td></tr>';
24 $html .= '<tr><td>Instructor:</td><td>'.$row[4].'</td></tr>';
25 $html .= '</table></div>';
28 echo $html;