diff --git a/Courses.php b/Courses.php index db8a856..6c62929 100644 --- a/Courses.php +++ b/Courses.php @@ -412,25 +412,22 @@ include 'Header.php'; INNER JOIN users_table ON users_table.Student_ID=course_students_table.Student_ID WHERE Lecturer_User_ID=$lecturer_id AND course_students_table.Status='Pending'"); - if(mysqli_num_rows($result)==0) - { - + if(mysqli_num_rows($result) == 0) { echo "<br> <i class='fa fa-info-circle'></i>No course-joining request so far for your courses<hr>"; - } else { while($row = mysqli_fetch_assoc($result)) { - $id=$row['ID']; + } else { + while ($row = mysqli_fetch_assoc($result)) { + $id = $row['ID']; + $name = $row['Course_Name']; + $code = $row['Course_Code']; + $faculty = $row['Faculty']; + $std_name = $row['Full_Name']; + $academic = $row['Academic_Year']; - $name=$row['Course_Name']; - $code=$row['Course_Code']; - $faculty=$row['Faculty']; - $std_name=$row['Full_Name']; - $academic=$row['Academic_Year']; - - echo "<div class='btn btn-default'> - $std_name is Requesting to join <br> [($code) - $name ] <br><a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=yes' class='btn btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > Accept </a> - <a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=no' class='btn btn-sm btn-danger' onclick=return confirm(\"are you sure to join this course?\")' > Decline </a> -</div>"; - - } + echo "<div class='btn btn-default'> + $std_name is Requesting to join <br> [($code) - $name ] <br> + <a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=yes' class='btn btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > Accept </a> <a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=no' class='btn btn-sm btn-danger' onclick=return confirm(\"are you sure to join this course?\")' > Decline </a> + </div>"; + } } ?>