/home/techb158/workloadmatch.com/Manager
Edit: /home/techb158/workloadmatch.com/Manager/fetch_schedule_report_by_group.php (5554B)
prepare($query);
$stmt->bind_param("i", $programID);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
$courseID = $row["Course_ID"];
// Check if the combination of Program_ID, Course_ID, and Group_ID exists in course_group_schedule
$checkStmt = $mysqli->prepare("SELECT COUNT(*) FROM course_group_schedule WHERE Program_ID = ? AND Course_ID = ? AND Group_ID = ?");
$checkStmt->bind_param('iii', $programID, $courseID, $groupID);
$checkStmt->execute();
$checkStmt->bind_result($count);
$checkStmt->fetch();
$checkStmt->close();
// If combination exists in course_group_schedule
if ($count > 0) {
// Fetch additional schedule details for this combination
$fetchStmt = $mysqli->prepare("SELECT Time_Slot_ID, Reserve_Course, Time_Slot, Start_Date, End_Date, Start_Time, End_Time FROM course_group_schedule WHERE Program_ID = ? AND Course_ID = ? AND Group_ID = ?");
$fetchStmt->bind_param('iii', $programID, $courseID, $groupID);
$fetchStmt->execute();
$fetchStmt->bind_result($Time_Slot_ID, $Reserve_Course, $Time_Slot, $Start_Date, $End_Date, $Start_Time, $End_Time);
$fetchStmt->fetch();
$fetchStmt->close();
// Assuming $Reserve_Course is a variable that holds the value (either 0 or 1)
$checkedReserve = (isset($Reserve_Course) && $Reserve_Course == 1) ? 'checked' : ''; // Set checked if $Reserve_Course is 1
echo "
|
|
{$row["Course_Name"]} |
|
|
|
";
} else {
// If the combination doesn't exist in course_group_schedule
echo "
|
|
{$row["Course_Name"]} |
|
|
|
";
}
}
$stmt->close();
$mysqli->close();
}
?>