123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?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>
- <?php
- include($root . "/admin/header.php");
- ?>
- <main>
- <body>
- <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>
- </body>
- </html>
- </main>
- <?php
- include($root . "/admin/footer.php");
- ?>
|