1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- $root = $_SERVER['DOCUMENT_ROOT'];
- include($root . "/util/session.php");//checks that the user is logged in
- include($root . "/util/privilege_check.php");
- checkPrivilege("admin");
- $degreeID=mysqli_real_escape_string($db,$_GET['degreeID']);
- $query = "SELECT * FROM subjects where degreeID='$degreeID'";
- $result = mysqli_query($db,$query);
- if(mysqli_num_rows($result) < 1){
- header("Location: /admin/admin.php?msg=No Subjects");
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Subject List</title>
- <link rel="stylesheet" type="text/css" href="adminStyle.css">
- <link rel="stylesheet" type="text/css" href="tableStyle.css">
- </head>
- <body>
- <?php
- include($root . "/admin/header.php");
- ?>
- <li><a href="/admin/degreeList.php">Back</a></li>
- <table border="1px" id="users">
- <thead>
- <tr>
- <th>Actions</th>
- <th>Subject ID</th>
- <th>Name</th>
- <th>Description</th>
- <th>Coordinator</th>
- </tr>
- </thead>
- <tbody>
- <?php //ugly php + html hybrid code that does stuff
- while($row=mysqli_fetch_assoc($result)){?>
- <tr>
- <td>
- <a href="/admin/subjectMod.php?subjectID=<?php echo $row['subjectID']?>&°reeID=<?php echo $row['degreeID']?>">Modify</a>
- <a href="/admin/subjectDel.php?subjectID=<?php echo $row['subjectID']?>&°reeID=<?php echo $row['degreeID']?>">Delete</a>
- <a href="/admin/subjectsStudentsList.php?subjectID=<?php echo $row['subjectID']?>&°reeID=<?php echo $row['degreeID']?>">List students</a>
- </td>
- <td><?php echo $row['subjectID']; ?>
- </td>
- <td><?php echo $row['subjectName']; ?></td>
- <td><?php echo $row['description']; ?></td>
- <td><?php echo $row['coordinatorID']; ?></td>
- </tr>
- <?php }?>
- </tbody>
- </table>
- <?php
- include($root . "/admin/footer.php");
- ?>
- </body>
- </html>
|