Courses.php: better spacing and better variable name (academic -> academic_year)

Bug430-Eden2
Lan Hui 2023-09-08 19:36:42 +08:00
parent aa349a8d6c
commit 5683013655
1 changed files with 11 additions and 12 deletions

View File

@ -567,32 +567,31 @@ include 'Header.php';
INNER JOIN course_students_table ON course_students_table.Course_ID=courses_table.Course_ID
WHERE course_students_table.Student_ID=$student_id ORDER BY Academic_Year DESC, URL ASC");
if(mysqli_num_rows($result)==0)
{
if (mysqli_num_rows($result) == 0) {
echo "<i class='fa fa-exclamation-circle'></i> You are not enrolled in any Course";
} else {
while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$id=$row['Course_ID'];
$Status=$row['Status'];
$name = $row['Course_Name'];
$code = $row['Course_Code'];
$faculty = $row['Faculty'];
$lecturer = $row['Full_Name'];
$academic_year = $row['Academic_Year'];
$url = $row['URL'];
$id = $row['Course_ID'];
$Status = $row['Status'];
if($Status=="Joined")
{
echo "<a href='~\..\Course.php?url=$url'> <div class='btn btn-default' style='word-wrap:break-word'>
($code) - $name <br>($url) &nbsp;&nbsp;&nbsp; <i class='fa fa-check-circle'></i> $Status &nbsp;&nbsp;&nbsp;&nbsp;
<br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span></div></a>
<br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic_year &nbsp; Lecturer: $lecturer </span></div></a>
";
}
else
{
echo "<div class='btn btn-default'>
($code) - $name <i class='btn btn-sm btn-danger'> $Status</i>
<br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span></div>
<br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic_year &nbsp; Lecturer: $lecturer </span></div>
";
}
}