/
home
/
techb158
/
workloadmatch.com
/
workloadmatch.com
/
Manager
/
/home/techb158/workloadmatch.com/workloadmatch.com/Manager
mkdir
upload
Name
Size
Mode
Actions
core/
-
0755
rm
css/
-
0755
rm
data/
-
0755
rm
fonts/
-
0755
rm
Inc/
-
0755
rm
js/
-
0755
rm
php/
-
0755
rm
accesscontrol.php
16039
0644
edit
dl
rm
AddClient.php
3930
0644
edit
dl
rm
addcourse.php
17736
0644
edit
dl
rm
addcoursesession.php
20528
0644
edit
dl
rm
addcoursetime.php
17305
0644
edit
dl
rm
addgroup - Copy.php
21212
0644
edit
dl
rm
addgroup.php
22999
0644
edit
dl
rm
addgroup1.php
20667
0644
edit
dl
rm
addholiday.php
18019
0644
edit
dl
rm
addmanager.php
18765
0644
edit
dl
rm
addremediation.php
17877
0644
edit
dl
rm
addretake.php
21914
0644
edit
dl
rm
adduser.php
30079
0644
edit
dl
rm
adduser1.php
23527
0644
edit
dl
rm
Add_Course_Session.php
6529
0644
edit
dl
rm
add_event.php
1960
0644
edit
dl
rm
Add_Teacher_Unavailability.php
1746
0644
edit
dl
rm
adminreports.php
16219
0644
edit
dl
rm
AI_Generate_Schedule - Copy.php
12217
0644
edit
dl
rm
AI_Generate_Schedule.php
10731
0644
edit
dl
rm
ajax_course_group_Backup.php
17270
0644
edit
dl
rm
ajax_course_group_Backup_1.php
18742
0644
edit
dl
rm
ajax_fetch_schedule.php
3760
0644
edit
dl
rm
ajax_get_group_slots.php
872
0644
edit
dl
rm
ajax_replace_saturday -Completed.php
18739
0644
edit
dl
rm
ajax_replace_saturday - Copy (2).php
18739
0644
edit
dl
rm
ajax_replace_saturday - Copy (3).php
26554
0644
edit
dl
rm
ajax_replace_saturday - Copy (4).php
26615
0644
edit
dl
rm
ajax_replace_saturday - Copy (5).php
28374
0644
edit
dl
rm
ajax_replace_saturday - Copy.php
13452
0644
edit
dl
rm
ajax_replace_saturday - Good.php
17270
0644
edit
dl
rm
ajax_replace_saturday.php
30779
0644
edit
dl
rm
ajax_swap_courses.php
4279
0644
edit
dl
rm
assign_course_group-BackUp.php
21331
0644
edit
dl
rm
assign_course_group - Copy (BackUp).php
18315
0644
edit
dl
rm
assign_course_group - Copy.php
21318
0644
edit
dl
rm
assign_course_group.php
18315
0644
edit
dl
rm
assign_course_group1.php
20962
0644
edit
dl
rm
Assign_Course_Report.php
1375
0644
edit
dl
rm
assign_teacher_manual-1.php
21095
0644
edit
dl
rm
assign_teacher_manual - Copy (2).php
22328
0644
edit
dl
rm
assign_teacher_manual - Copy.php
22388
0644
edit
dl
rm
assign_teacher_manual-Not work.php
20585
0644
edit
dl
rm
assign_teacher_manual.php
22328
0644
edit
dl
rm
assign_teacher_manual_force_conflicts.php
22359
0644
edit
dl
rm
availableteacherreport.php
13718
0644
edit
dl
rm
Available_Teacher_Report - Copy.php
2236
0644
edit
dl
rm
Available_Teacher_Report.php
7691
0644
edit
dl
rm
brokerreports.php
16318
0644
edit
dl
rm
calendar - Copy (2).php
16891
0644
edit
dl
rm
calendar - Copy.php
23193
0644
edit
dl
rm
calendar.php
30653
0644
edit
dl
rm
changestatus.php
865
0644
edit
dl
rm
Check_if_Teacher_Report.php
1587
0644
edit
dl
rm
complete_schedule_report_by_teacher.php
19312
0644
edit
dl
rm
courseflagtime.php
3411
0644
edit
dl
rm
Create_Group_Schedule_Algorithm.php
3828
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (2).php
41412
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (3).php
46352
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (4).php
53569
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (5).php
67956
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (6).php
71134
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (7).php
72529
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (8).php
73084
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (9).php
73577
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (10).php
76505
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (11).php
76764
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (12).php
86324
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (13).php
83133
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (14).php
87274
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (get info only).php
69747
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy (with 2 course 2nd SPECIAL ).php
82314
0644
edit
dl
rm
Create_Schedule_Algorithm - Copy.php
40581
0644
edit
dl
rm
Create_Schedule_Algorithm.php
88276
0644
edit
dl
rm
Create_Schedule_Algorithm_1.php
41412
0644
edit
dl
rm
Create_Schedule_Algorithm_2.php
76505
0644
edit
dl
rm
Create_Schedule_Algorithm_2_combined.php
89764
0644
edit
dl
rm
Create_Schedule_Algorithm_2_combined_both_slots.php
91932
0644
edit
dl
rm
Create_Schedule_Algorithm_2_fixed.php
76829
0644
edit
dl
rm
Create_Schedule_Algorithm_3.php
87274
0644
edit
dl
rm
Create_Schedule_Algorithm_4.php
87274
0644
edit
dl
rm
dashboard-BackUp.php
18806
0644
edit
dl
rm
dashboard.php
22507
0644
edit
dl
rm
deleteschedulefromgroup.php
16819
0644
edit
dl
rm
delete_course.php
580
0644
edit
dl
rm
delete_course_from_teacher.php
4990
0644
edit
dl
rm
delete_course_from_teacher_backup.php
3094
0644
edit
dl
rm
delete_event.php
1212
0644
edit
dl
rm
delete_group.php
1858
0644
edit
dl
rm
delete_holiday.php
715
0644
edit
dl
rm
delete_retake.php
1276
0644
edit
dl
rm
delete_schedule_from_group-1.php
1870
0644
edit
dl
rm
delete_schedule_from_group.php
1850
0644
edit
dl
rm
delete_teacher_level.php
798
0644
edit
dl
rm
delete_teacher_unavailability.php
1347
0644
edit
dl
rm
delete_timeslot.php
597
0644
edit
dl
rm
display_schedule-1.php
18846
0644
edit
dl
rm
display_schedule.php
18846
0644
edit
dl
rm
do_remove_saturday.php
6170
0644
edit
dl
rm
edit_event.php
1612
0644
edit
dl
rm
error_log
74070
0644
edit
dl
rm
examschedulereport.php
16267
0644
edit
dl
rm
Exam_Schedule_Report.php
2677
0644
edit
dl
rm
export_absences.php
1221
0644
edit
dl
rm
fetch_all_scheduled_courses.php
6318
0644
edit
dl
rm
fetch_courses - BackUp.php
9711
0644
edit
dl
rm
fetch_courses - Copy.php
7719
0644
edit
dl
rm
fetch_courses.php
9167
0644
edit
dl
rm
fetch_courses_for_program.php
788
0644
edit
dl
rm
fetch_courses_for_program_by_schedule - Copy.php
2297
0644
edit
dl
rm
fetch_courses_for_program_by_schedule.php
3935
0644
edit
dl
rm
fetch_courses_teacher_preference.php
3852
0644
edit
dl
rm
fetch_course_for_added_group.php
897
0644
edit
dl
rm
fetch_course_hours.php
691
0644
edit
dl
rm
fetch_disabled_dates.php
518
0644
edit
dl
rm
fetch_events.php
975
0644
edit
dl
rm
fetch_exist_dates.php
1099
0644
edit
dl
rm
fetch_groups_exist_in_schedule.php
956
0644
edit
dl
rm
fetch_groups_for_program.php
843
0644
edit
dl
rm
fetch_group_timeslot.php
847
0644
edit
dl
rm
fetch_reserve_courses.php
7429
0644
edit
dl
rm
fetch_retake_courses.php
923
0644
edit
dl
rm
fetch_scheduled_courses.php
2178
0644
edit
dl
rm
fetch_schedule_report_by_group.php
5440
0644
edit
dl
rm
fetch_teachers_by_group.php
4421
0644
edit
dl
rm
fetch_teachers_by_program.php
1821
0644
edit
dl
rm
fetch_teachers_for_group.php
3170
0644
edit
dl
rm
fetch_teacher_assignment.php
24776
0644
edit
dl
rm
fetch_teacher_by_course.php
3880
0644
edit
dl
rm
fetch_teacher_conflicts.php
5682
0644
edit
dl
rm
fetch_teacher_conflicts_only.php
7665
0644
edit
dl
rm
fetch_teacher_conflicts_only_force_conflicts.php
7114
0644
edit
dl
rm
fetch_teacher_conflicts_showonly.php
10447
0644
edit
dl
rm
fetch_teacher_load.php
1482
0644
edit
dl
rm
fetch_teacher_prefrence_courses_accounting.php
1606
0644
edit
dl
rm
find_replacement-1.php
16075
0644
edit
dl
rm
find_replacement.php
18161
0644
edit
dl
rm
followup.php
16160
0644
edit
dl
rm
Generate Group Schedule.php
16987
0644
edit
dl
rm
Generate Group Schedule 1.php
18121
0644
edit
dl
rm
generateschedule.php
15706
0644
edit
dl
rm
Generate_Schedule.php
33620
0644
edit
dl
rm
generate_schedule_handler.php
7095
0644
edit
dl
rm
Generate_Schedule_Script.php
29731
0644
edit
dl
rm
getlang.php
326
0644
edit
dl
rm
getrefer.php
4349
0644
edit
dl
rm
getstatus.php
1260
0644
edit
dl
rm
get_groups_by_program.php
608
0644
edit
dl
rm
get_schedule_ai-1.php
37755
0644
edit
dl
rm
get_schedule_ai - Copy.php
36459
0644
edit
dl
rm
get_schedule_ai.php
36855
0644
edit
dl
rm
get_schedule_report.php
2393
0644
edit
dl
rm
group_schedule_form - Copy.php
16994
0644
edit
dl
rm
group_schedule_form.php
16994
0644
edit
dl
rm
main-header-inc.php
1196
0644
edit
dl
rm
main-header.php
16671
0644
edit
dl
rm
managecategory.php
9233
0644
edit
dl
rm
managerreports.php
25056
0644
edit
dl
rm
Preference_Accounting.php
22503
0644
edit
dl
rm
profile.php
20680
0644
edit
dl
rm
reference_list.php
8207
0644
edit
dl
rm
remove_saturday_course.php
19503
0644
edit
dl
rm
report_absence.php
19287
0644
edit
dl
rm
report_absence_1.php
6160
0644
edit
dl
rm
reserve_course.php
18957
0644
edit
dl
rm
rewrite_ajax_replace_saturday.php
12800
0644
edit
dl
rm
rewrite_Create_Schedule_Algorithm.php
88318
0644
edit
dl
rm
rewrite_Create_Schedule_Algorithm_2.php
88900
0644
edit
dl
rm
save_schedule.php
2970
0644
edit
dl
rm
save_schedule_group_course.php
25367
0644
edit
dl
rm
schedulereportbygroup.php
17731
0644
edit
dl
rm
schedulereportbyteacher.php
19111
0644
edit
dl
rm
scheduleteacherbygroupreport - Copy.php
31986
0644
edit
dl
rm
scheduleteacherbygroupreport.php
36556
0644
edit
dl
rm
scheduleteacherreport.php
28150
0644
edit
dl
rm
schedule_report.php
17664
0644
edit
dl
rm
Schedule_Report_by_Group.php
3647
0644
edit
dl
rm
Schedule_Report_by_Teacher.php
92433
0644
edit
dl
rm
selectuser.php
1172
0644
edit
dl
rm
swapcourses.php
19469
0644
edit
dl
rm
teacher_preference.php
18182
0644
edit
dl
rm
teacher_preference_by_course.php
19244
0644
edit
dl
rm
teacher_unavailability.php
17835
0644
edit
dl
rm
test.php
13895
0644
edit
dl
rm
test1.php
21837
0644
edit
dl
rm
transfer_reference.php
27288
0644
edit
dl
rm
unassigncoursereport.php
16029
0644
edit
dl
rm
unassign_course.php
19011
0644
edit
dl
rm
Unassign_Course_Report.php
1697
0644
edit
dl
rm
unscheduledgroupreport.php
15675
0644
edit
dl
rm
Unscheduled_Group_Report.php
2007
0644
edit
dl
rm
updateclient.php
14765
0644
edit
dl
rm
updatecourse.php
21626
0644
edit
dl
rm
updatecoursesessionhours.php
18197
0644
edit
dl
rm
updatecoursetime.php
21831
0644
edit
dl
rm
updategroup - Copy.php
24534
0644
edit
dl
rm
updategroup.php
18001
0644
edit
dl
rm
updateholiday.php
22493
0644
edit
dl
rm
updateteacherlevel.php
24532
0644
edit
dl
rm
updateteacherunavailability.php
14184
0644
edit
dl
rm
UpdateUser.php
18214
0644
edit
dl
rm
Update_Course_Hours.php
2135
0644
edit
dl
rm
Update_Follow_Up.php
4618
0644
edit
dl
rm
update_reserve_course.php
1934
0644
edit
dl
rm
update_teacher_level
2508
0644
edit
dl
rm
update_teacher_level.php
2430
0644
edit
dl
rm
useraccesslist.php
12875
0644
edit
dl
rm
users.php
9049
0644
edit
dl
rm
view_swap_log.php
894
0644
edit
dl
rm
Edit:
/home/techb158/workloadmatch.com/workloadmatch.com/Manager/Preference_Accounting.php
(22503B)
<?php include_once '../includes/db_connect.php'; include_once '../includes/functions.php'; //include_once 'Inc/Update_Course_Preference.php'; sec_session_start(); $page = 'Teacher | Course Management System | Accounting'; addinfo($page, $mysqli); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>CMS | Accounting</title> <!-- Tell the browser to be responsive to screen width --> <link rel="icon" href="../dist/img/avatar.png" sizes="32x32" /> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css"> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"> <!-- Ionicons --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"> <!-- daterange picker --> <link rel="stylesheet" href="../plugins/daterangepicker/daterangepicker-bs3.css"> <!-- bootstrap datepicker --> <link rel="stylesheet" href="../plugins/datepicker/datepicker3.css"> <!-- iCheck for checkboxes and radio inputs --> <link rel="stylesheet" href="../plugins/iCheck/all.css"> <!-- Bootstrap Color Picker --> <link rel="stylesheet" href="../plugins/colorpicker/bootstrap-colorpicker.min.css"> <!-- Bootstrap time Picker --> <link rel="stylesheet" href="../plugins/timepicker/bootstrap-timepicker.min.css"> <!-- Select2 --> <link rel="stylesheet" href="../plugins/select2/select2.min.css"> <!-- Theme style --> <link rel="stylesheet" href="../dist/css/AdminLTE.min.css"> <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. --> <link rel="stylesheet" href="../dist/css/skins/skin-black-light.min.css"> <!-- DataTables --> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.4/css/buttons.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.4/css/buttons.dataTables.min.css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <style> .center { text-align: center; } .example-modal .modal { position: relative; top: auto; bottom: auto; right: auto; left: auto; display: block; z-index: 1; } .example-modal .modal { background: transparent !important; } .loading-icon { font-size: 20px; /* Increase the size */ margin-left: 5px; /* Add spacing from the button */ animation: spin 1s linear infinite; /* Optional: Add rotation animation */ } /* Spinning animation */ @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> // When teacher is selected, load courses for that teacher $("#Teacher_ID").change(function() { let teacherID = $(this).val(); alert(teacherID); if (teacherID !== "") { $.ajax({ url: "fetch_teacher_prefrence_courses_accounting", method: "POST", data: { Teacher_ID: teacherID }, success: function(html) { alert(html); // Update only the table body, not the entire table $("#example1 tbody").html(html); initCourseRowActions(); // Re-initialize button/checkbox events if needed } }); } else { $("#example1 tbody").empty(); } }); // Initialize row actions (buttons and checkboxes) function initCourseRowActions() { // (Repeat your button/checkbox logic here, see below) } // On page load, also init once $(function() { initCourseRowActions(); }); function savePreferences(i) { let teacherID = $("#Teacher_ID").val(); let course_id = $('#Course_ID' + i).val(); if (!$('#Course_ID' + i).is(':checked')) { alert("Please select the course before choosing a priority."); return; } let priority = null; if ($('#button1' + i).is(':focus')) { priority = $('#button1' + i).val(); } else if ($('#button2' + i).is(':focus')) { priority = $('#button2' + i).val(); } if (!priority) { alert("Please select a priority!"); return; } var formData = new FormData(); formData.append('action', 'save_preferences'); formData.append('teacher_id', teacherID); formData.append('course_id', course_id); formData.append('priority', priority); $.ajax({ url: 'save_teacher_preference', // Your handler type: 'POST', data: formData, processData: false, contentType: false, dataType: 'json', success: function(response) { if (response.status === 'success') { // Optionally refresh the course list $("#Teacher_ID").trigger('change'); } else { alert('Error: ' + response.message); } }, error: function(xhr, status, error) { alert('Error saving data: ' + error); } }); } function savePreferences(i) { var course_id = $('#Course_ID' + i).val(); if (!$('#Course_ID' + i).is(':checked')) { alert("Please select the course before choosing a priority."); return; } var priority = null; if ($('#button1' + i).is(':focus')) { priority = $('#button1' + i).val(); } else if ($('#button2' + i).is(':focus')) { priority = $('#button2' + i).val(); } if (!priority) { alert("Please select a priority!"); return; } var formData = new FormData(); // ✅ Use FormData for better handling formData.append('action', 'save_preferences'); formData.append('course_id', course_id); formData.append('priority', priority); console.log("Sending data:", Object.fromEntries(formData)); // ✅ Debug before sending $.ajax({ url: '<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>', type: 'POST', data: formData, processData: false, contentType: false, dataType: 'json', success: function(response) { if (response.status === 'success') { //alert('Data saved successfully!'); console.log(response); } else { alert('Error: ' + response.message); } }, error: function(xhr, status, error) { console.error("Error:", xhr.responseText); alert('Error saving data: ' + error); } }); } </script> <script> document.addEventListener("DOMContentLoaded", function () { const checkboxes = document.querySelectorAll("input[type='checkbox'][name='Course_ID[]']"); checkboxes.forEach((checkbox, index) => { const button1 = document.getElementById("button1" + (index + 1)); const button2 = document.getElementById("button2" + (index + 1)); // Disable buttons initially button1.disabled = true; button2.disabled = true; // Add event listener to checkboxes checkbox.addEventListener("change", function () { if (this.checked) { button1.disabled = false; button2.disabled = false; } else { button1.disabled = true; button2.disabled = true; // Send AJAX request to remove preference when unchecked $.ajax({ url: '<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>', type: 'POST', data: { action: 'remove_preference', course_id: this.value }, dataType: 'json', success: function (response) { if (response.status === 'success') { alert('Preference removed successfully!'); } else { alert('Error: ' + response.message); } }, error: function (xhr, status, error) { alert('Error removing preference: ' + error); } }); } }); }); }); </script> <script> function deleteGroupRow(button, courseID) { if (confirm("Are you sure you want to delete this course?")) { $.ajax({ url: '<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>', type: 'POST', data: { action: 'remove_preference', course_id: courseID }, dataType: 'json', success: function (response) { if (response.status === 'success') { // Remove the row from the table var row = button.closest("tr"); row.parentNode.removeChild(row); alert('Preference removed successfully!'); } else { alert('Error: ' + response.message); } }, error: function (xhr, status, error) { alert('Error removing preference: ' + error); } }); } } </script> </head> <body class="hold-transition skin-black-light sidebar-mini"> <?php if (login_check($mysqli) == true) : ?> <?php if (!empty($error_msg)) { echo $error_msg; } if (isset($_GET['error'])) { $mesg= $_GET['error']; echo "<div class=\"alert alert-success\"><strong>Notification!</strong> ".$mesg."</div>"; } include'main-header-inc.php'; //$user_n=$_SESSION['user_id']; ?> <div class="wrapper"> <?php include'main-header.php';?> <div class="content-wrapper"> <section class="content-header"> <h1> <?php echo LANG_VALUE_310; ?> <small><?php echo LANG_VALUE_315; ?></small> </h1> <ol class="breadcrumb"> <li><a href="index.php"><i class="fa fa-dashboard"></i> <?php echo LANG_VALUE_167; ?></a></li> <li class="active"><?php echo LANG_VALUE_310; ?></li> </ol> </section> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="nav-tabs-custom"> <ul class="nav nav-tabs"> <li class="active"><a href="#activity" data-toggle="tab"> <?php echo LANG_VALUE_315; ?></a></li> <li><a href="#Table" data-toggle="tab"><?php echo LANG_VALUE_290; ?></a></li> </ul> <div class="tab-content"> <div class="active tab-pane" id="activity"> <div class="box"> <div class="alert alert-warning alert-dismissible"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <h4><i class="icon fa fa-warning"></i> <?php echo LANG_VALUE_291; ?></h4> Once you select your course and choose <b>First or Second</b> as your priority, it will be saved automatically. </div> <div class="box-header"> <h3 class="box-title"><?php echo LANG_VALUE_320; ?></h3> </div> <div class="box-body"> <form class="form-horizontal" id="registration_form" name="registration_form"> <div class="form-group"> <div class="text-center mt-6"> <label for="Teacher_ID" class="col-sm-2 control-label"><?php echo LANG_VALUE_323; ?></label> <div class="col-sm-4"> <select class="form-control select2" name="Teacher_ID" id="Teacher_ID"> <option value=""><?php echo LANG_VALUE_323; ?></option> <?php $queryPrograms = "SELECT Teacher_ID, First_Name, Last_Name FROM Teacher_Profile"; $resultPrograms = $mysqli->query($queryPrograms); while ($program = $resultPrograms->fetch_assoc()) { echo "<option value='".$program["Teacher_ID"]."'>".$program["First_Name"]. ' ' .$program["Last_Name"]."</option>"; } ?> </select> </div> </div> </div> <div class="box-body table-responsive no-padding"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th style="width: 10px"><?php echo LANG_VALUE_250; ?></th> <th><?php echo LANG_VALUE_304; ?></th> <th class="center"><?php echo LANG_VALUE_316; ?></th> </tr> </thead> <tbody> <!-- AJAX loads course list here --> </tbody> </table> </div> </form> </div> <!-- /.box-body --> </div> </div> <div class="tab-pane" id="Table"> <div class="box box-primary"> <!-- /.box-header --> <div class="box-body"> <div class="row"> <div class="col-xs-12"> <div class="box"> <!-- /.box-header --> <div class="box-body table-responsive no-padding"> <table id="example3" class="table table-bordered table-striped"> <thead> <tr> <th><?php echo LANG_VALUE_304; ?></th> <th><?php echo LANG_VALUE_316; ?></th> <th><?php echo LANG_VALUE_82; ?></th> </tr> </thead> <tbody> <?php // SQL query with JOINs to get Course_Name and Priority $querye = " SELECT tcp.T_C_P_ID, tcp.Teacher_ID, tcp.Program_ID, tcp.Course_ID, tcp.Priority, c.Course_Name FROM Teacher_Course_Preferences tcp JOIN Courses c ON tcp.Course_ID = c.Course_ID WHERE tcp.Teacher_ID='".$user_n."' AND tcp.Program_ID = 1 ORDER BY c.Course_ID"; $resulte = $mysqli->query($querye); while ($rowe = $resulte->fetch_assoc()) { ?> <tr> <td><?php echo $rowe["Course_Name"]; ?></td> <td><?php if($rowe["Priority"] == 1) { echo LANG_VALUE_317; }else if($rowe["Priority"] == 2) { echo LANG_VALUE_318; } ?></td> <td class="center"> <div class="form-group"> <div class="btn-group"> <button type="button" class="btn btn-block btn-danger" onclick="deleteGroupRow(this, <?php echo $rowe['Course_ID']; ?>)"> Delete </button> </div> </div> </td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th><?php echo LANG_VALUE_304; ?></th> <th><?php echo LANG_VALUE_316; ?></th> <th><?php echo LANG_VALUE_82; ?></th> </tr> </tfoot> </table> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> </div> </div> </div> </div> </div> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </section> </div> <!-- /.content-wrapper --> <?php include'../footer.php';?> </div> <!-- ./wrapper --> <?php else : ?> <?php include '../authorized.php';?> <?php endif; ?> <!-- jQuery 2.2.0 --> <script src="../plugins/jQuery/jQuery-2.2.0.min.js"></script> <!-- Bootstrap 3.3.6 --> <script src="../bootstrap/js/bootstrap.min.js"></script> <!-- DataTables --> <script src="../plugins/datatables/jquery.dataTables.min.js"></script> <script src="../plugins/datatables/dataTables.bootstrap.min.js"></script> <!-- SlimScroll --> <script src="../plugins/slimScroll/jquery.slimscroll.min.js"></script> <!-- FastClick --> <script src="../plugins/fastclick/fastclick.js"></script> <!-- AdminLTE App --> <script src="../dist/js/app.min.js"></script> <!-- AdminLTE for demo purposes --> <script src="../dist/js/demo.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.4/js/buttons.flash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script> <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script> <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.2.4/js/buttons.print.min.js"></script> <script> document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll("input[type='checkbox'][name='Course_ID[]']").forEach((checkbox) => { const id = checkbox.id.replace("Course_ID", ""); // Extract numeric part const button1 = document.getElementById("button1" + id); const button2 = document.getElementById("button2" + id); const loading1 = document.getElementById("loading1" + id); const loading2 = document.getElementById("loading2" + id); // Initialize buttons based on checked state button1.disabled = !checkbox.checked; button2.disabled = !checkbox.checked; // Enable/Disable buttons when checkbox changes checkbox.addEventListener("change", function () { button1.disabled = !this.checked; button2.disabled = !this.checked; }); // Add click event to both buttons to show the loading icon button1.addEventListener("click", function () { showLoading(loading1); }); button2.addEventListener("click", function () { showLoading(loading2); }); }); }); // Function to show and hide loading icon function showLoading(loadingElement) { loadingElement.style.display = "inline-block"; // Show the loading icon setTimeout(() => { loadingElement.style.display = "none"; // Hide after 2 seconds }, 2000); } </script> <script> var table = $("#example3").DataTable({ destroy: true, // Allow reinitialization dom: "Bfrtip", buttons: ["copy", "csv", "excel", "pdf", "print"], paging: false, // 🚀 Disable pagination searching: false, // 🔍 Disable search (optional) ordering: false // 📌 Disable sorting (optional) }); </script> <script> $(document).ready(function() { $('#example2').DataTable( { dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ] } ); } ); </script> <script> $(function () { $('#example1').dataTable({ paging: false // 🚀 Disable pagination }); $("#example2").DataTable(); $('#example4').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": false }); }); </script> <script> $(function () { //Initialize Select2 Elements $(".select2").select2(); //Datemask dd/mm/yyyy $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); //Datemask2 mm/dd/yyyy $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); //Money Euro $("[data-mask]").inputmask(); //Date range picker $('#reservation').daterangepicker(); //Date range picker with time picker $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); //Date range as a button $('#daterange-btn').daterangepicker( { ranges: { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] }, startDate: moment().subtract(29, 'days'), endDate: moment() }, function (start, end) { $('#daterange-btn span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); } ); //Date picker $('#datepicker').datepicker({ autoclose: true }); //iCheck for checkbox and radio inputs $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({ checkboxClass: 'icheckbox_minimal-blue', radioClass: 'iradio_minimal-blue' }); //Red color scheme for iCheck $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({ checkboxClass: 'icheckbox_minimal-red', radioClass: 'iradio_minimal-red' }); //Flat red color scheme for iCheck $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({ checkboxClass: 'icheckbox_flat-green', radioClass: 'iradio_flat-green' }); //Colorpicker $(".my-colorpicker1").colorpicker(); //color picker with addon $(".my-colorpicker2").colorpicker(); //Timepicker $(".timepicker").timepicker({ showInputs: false }); }); </script> </body> </html>
Save
cmd:
run