Submissions.php: simplify code logic.
parent
24af391961
commit
6200d6ab00
|
@ -61,45 +61,24 @@ echo "<div><a href='Courses.php?course=$url'> $header </a></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id");
|
$resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id");
|
||||||
while ($row = mysqli_fetch_assoc($resultx1)) {
|
$row = mysqli_fetch_assoc($resultx1);
|
||||||
$count_subs = $row['cnt'];
|
$count_subs = $row['cnt'];
|
||||||
}
|
|
||||||
|
|
||||||
$resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Marked'");
|
$resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Marked'");
|
||||||
if (mysqli_num_rows($resultx2) == 0) {
|
$row = mysqli_fetch_assoc($resultx2);
|
||||||
$count_marked = 0;
|
|
||||||
} else {
|
|
||||||
while ($row = mysqli_fetch_assoc($resultx2)) {
|
|
||||||
$count_marked = $row['cnt'];
|
$count_marked = $row['cnt'];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$resultx3 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Pending'");
|
$resultx3 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Pending'");
|
||||||
if (mysqli_num_rows($resultx3) == 0) {
|
$row = mysqli_fetch_assoc($resultx3);
|
||||||
$count_unmarked = 0;
|
|
||||||
} else {
|
|
||||||
while ($row = mysqli_fetch_assoc($resultx3)) {
|
|
||||||
$count_unmarked = $row['cnt'];
|
$count_unmarked = $row['cnt'];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$resultx4 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Remarking'");
|
$resultx4 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Remarking'");
|
||||||
if (mysqli_num_rows($resultx4) == 0) {
|
$row = mysqli_fetch_assoc($resultx4);
|
||||||
$count_remark = 0;
|
|
||||||
} else {
|
|
||||||
while ($row = mysqli_fetch_assoc($resultx4)) {
|
|
||||||
$count_remark = $row['cnt'];
|
$count_remark = $row['cnt'];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$resultx5 = mysqli_query($con, "SELECT COUNT(*) as cnt FROM course_groups_table WHERE Course_id=$c_id");
|
$resultx5 = mysqli_query($con, "SELECT COUNT(*) as cnt FROM course_groups_table WHERE Course_id=$c_id");
|
||||||
if (mysqli_num_rows($resultx5) == 0) {
|
$row = mysqli_fetch_assoc($resultx5);
|
||||||
$count_group = 0;
|
|
||||||
} else {
|
|
||||||
while ($row = mysqli_fetch_assoc($resultx5)) {
|
|
||||||
$count_group = $row['cnt'];
|
$count_group = $row['cnt'];
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue