Admin.php: remove superfluous if statement.

Bug430-Eden2
Lan Hui 2023-08-19 20:49:33 +08:00
parent ec0d73db52
commit 12239d9a29
1 changed files with 4 additions and 3 deletions

View File

@ -170,11 +170,11 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
<th>TAs</th>
<th>Assign a new TA </th>
</tr>
<?php
$user_id = $_SESSION['user_id'];
$result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `TA_User_ID`, `Course_Code`, `Full_Name` FROM courses_table INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID WHERE User_ID=$user_id ORDER BY Academic_Year DESC;");
if (mysqli_num_rows($result) == 0) {
} else {
if (mysqli_num_rows($result) != 0) {
$counter = 0;
while ($row = mysqli_fetch_assoc($result)) {
$name = $row['Course_Name'];
@ -208,7 +208,8 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <button class='btn btn-outline-secondary btn-sm' type='submit' id='assign_btn_$counter'>assign</button></form> </td></tr>
";
}
} ?>
}
?>
</table>