Admin.php: remove superfluous if statement.

Bug430-Eden2
Lan Hui 2023-08-19 20:53:12 +08:00
parent 12239d9a29
commit 93ba7d4389
1 changed files with 20 additions and 16 deletions

View File

@ -375,34 +375,38 @@ course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$use
}
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$id=$row['Course_ID'];
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
if(mysqli_num_rows($result) != 0)
{
while($row = mysqli_fetch_assoc($result)) {
$id=$row['Course_ID'];
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$resultTA = mysqli_query($con,"SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta`
$resultTA = mysqli_query($con,"SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta`
INNER JOIN users_table on users_table.User_ID=course_ta.TA
where course_ta.Course_ID=$id");
$ta="";
while($rowTA = mysqli_fetch_assoc($resultTA)) {
$ta=$ta." - ".$rowTA['TA_NAME'];
}
$ta="";
while($rowTA = mysqli_fetch_assoc($resultTA)) {
$ta=$ta." - ".$rowTA['TA_NAME'];
}
echo" <a href='~\..\Courses.php?course=$url'>
echo" <a href='~\..\Courses.php?course=$url'>
<div class='btn btn-default'>
($code) - $name
<p class='text-muted'><small> Faculty: $faculty &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year: $academic &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lecturer:$lecturer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TA:$ta </small></p>
</div>
</a>";
}}?>
}
}
?>
</div>
<div class="col-md-4">
<br>