/home/techb158/workloadmatch.com/Master
Edit: /home/techb158/workloadmatch.com/Master/fetch_teacher_prefrence_courses.php (1887B)
Select a teacher | '; exit; }
$query = "SELECT c.Course_ID, c.Course_Name,
(SELECT tcp.Priority FROM teacher_course_preferences tcp WHERE tcp.Teacher_ID = ? AND tcp.Course_ID = c.Course_ID AND tcp.Program_ID = ?) as Priority
FROM Courses c WHERE c.Program_ID = ? ORDER BY c.Course_ID";
$stmt = $mysqli->prepare($query);
$stmt->bind_param('iii', $teacherID, $programID, $programID);
$stmt->execute();
$res = $stmt->get_result();
$i = 1;
$html = '';
while ($row = $res->fetch_assoc()) {
$checked = $row['Priority'] ? 'checked' : '';
$disabled = $row['Priority'] ? '' : 'disabled';
$firstSel = $row['Priority'] == 1 ? 'btn-primary' : 'btn-default';
$secondSel = $row['Priority'] == 2 ? 'btn-primary' : 'btn-default';
$html .= '
|
'.htmlspecialchars($row["Course_Name"]).' |
|
';
$i++;
}
echo $html;
?>