Submissions.php: better display course groups.
parent
32b1e81500
commit
5ac8062175
|
@ -369,44 +369,45 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Remarking'");
|
|||
|
||||
<div id="menu4" class="tab-pane"><br>
|
||||
|
||||
<h3>Course groups</h3>
|
||||
|
||||
<hr>
|
||||
<div class="col-md-7">
|
||||
<?php
|
||||
|
||||
$result = mysqli_query($con, " SELECT `Course_Group_id`, `Group_Name`, `Group_Leader`, `Course_id`,users_table.Full_Name
|
||||
FROM `course_groups_table`
|
||||
INNER JOIN users_table on users_table.Student_ID=course_groups_table.Group_Leader
|
||||
WHERE Course_id=$c_id");
|
||||
|
||||
$result = mysqli_query($con, "SELECT Course_Group_id, Group_Name, Group_Leader, Course_id, users_table.Full_Name
|
||||
FROM course_groups_table
|
||||
INNER JOIN users_table ON users_table.Student_ID=course_groups_table.Group_Leader
|
||||
WHERE Course_id=$c_id");
|
||||
if (mysqli_num_rows($result) == 0) {
|
||||
echo "No student groups.";
|
||||
} else {
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$name = $row['Group_Name'];
|
||||
$leader = $row['Full_Name'] . " (" . $row['Group_Leader'] . ")";
|
||||
$leader_student_no = $row['Group_Leader'];
|
||||
$id = $row['Course_Group_id'];
|
||||
|
||||
echo "<ul class='list-group'>$name, Leader: $leader";
|
||||
echo "<ul class='list-group'>";
|
||||
echo " <li class='list-group-item disabled'>Group $name</li>";
|
||||
|
||||
$rs2 = mysqli_query($con, "SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID,
|
||||
course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table`
|
||||
INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
|
||||
where course_group_members_table.Course_Group_id=$id");
|
||||
$rs2 = mysqli_query($con, "SELECT ID, Course_Group_id, course_group_members_table.Student_ID, course_group_members_table.Status, users_table.Full_Name
|
||||
FROM course_group_members_table
|
||||
INNER JOIN users_table ON users_table.Student_ID=course_group_members_table.Student_ID
|
||||
WHERE course_group_members_table.Course_Group_id=$id");
|
||||
|
||||
while ($row = mysqli_fetch_assoc($rs2)) {
|
||||
$name = $row['Full_Name'];
|
||||
$id = $row['Course_Group_id'];
|
||||
$status = $row['Status'];
|
||||
$Student_ID = $row['Student_ID'];
|
||||
|
||||
if ($leader_student_no == $Student_ID) {
|
||||
echo "<li class='list-group-item'>$name ($Student_ID) - $status - Leader</li>";
|
||||
} else {
|
||||
echo "<li class='list-group-item'>$name ($Student_ID) - $status</li>";
|
||||
}
|
||||
}
|
||||
echo "</ul><br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue