Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.138.105.128
Current Path : /var/www/oasis/js/ |
| Current File : /var/www/oasis/js/CIEAttendanceNotEligible.js |
function callCIEAttendanceNotEligible() {
$("#page_main_div").load("../html_modules/CIEAttendanceNotEligible.html", {
function() {
document.getElementById("display_module_name").innerHTML =
"CIE Attendance Not Eligible";
document.getElementById("module_name_for_save").value =
"CIE Attendance Not Eligible";
getDefaultHeadFooterLinks("CIE Attendance Not Eligible");
getDegree();
},
});
}
var selectedDegreesArray = [];
function getDegree() {
$.ajax({
type: "GET",
url: $host_url + "cieattndnoteligibleDegree",
success: function (response) {
var res = JSON.parse(response);
console.log(res, "vikkkkkk");
if (res.error_code == -1) {
alert(res.data.result);
return;
} else {
document.getElementById("degree").options.length = 0;
var option = `<option value=''>---Select---</option>
<option value='All'>All</option>`;
for (i = 0; i < res.data.length; i++) {
option += `<option value='${res.data[i].fdegree}'>${res.data[i].fdegree} - ${res.data[i].fdescpn}</option>`;
}
document.getElementById("degree").innerHTML = option;
$("#degree").val("All");
handleExamDate();
// Event listener to capture selected degrees and add to the array
$("#degree").on("change", function () {
selectedDegreesArray = $("#degree").val() || [];
// console.log("Selected Degrees: ", selectedDegreesArray);
});
}
},
});
}
// function handleExamDate() {
// var selectedDegrees = [];
// var selectElement = document.getElementById("degree");
// for (var i = 0; i < selectElement.options.length; i++) {
// var option = selectElement.options[i];
// if (option.selected) {
// selectedDegrees.push(option.value);
// }
// }
// var commaSeparatedDegrees = selectedDegrees.join(", ");
// console.log(commaSeparatedDegrees,"vvvvv");
// $.ajax({
// type: "GET",
// data: {
// degree: commaSeparatedDegrees,
// },
// url: $host_url + "cieattndnoteligibleExmDate",
// success: function (res) {
// var response = JSON.parse(res);
// if (res.error_code == -1) {
// alert(res.data);
// return;
// } else {
// var option = `<option value=''>---Select---</option>`;
// for (i = 0; i < response.data.length; i++) {
// option += `<option value='${response.data[i].fexamdate}'>${response.data[i].fexamdate}</option>`;
// }
// document.getElementById("date").innerHTML = option;
// }
// },
// });
// }
function handleExamDate() {
var selectedDegree = [];
var selectElement = document.getElementById("degree");
for (var i = 0; i < selectElement.options.length; i++) {
var option = selectElement.options[i];
if (option.selected) {
selectedDegree.push(option.value);
}
}
var commaSeparatedDegree = selectedDegree.join(", ");
// var date= document.getElementById("date").value;
$.ajax({
type: "GET",
data: {
degree: commaSeparatedDegree,
// date:date
},
url: $host_url + "cieattndnoteligibleSem",
success: function (res) {
var response = JSON.parse(res);
console.log(response);
if (response.error_code == -1) {
console.log("");
return;
} else {
var option = `<option value=''>---Select---</option>`;
for (i = 0; i < response.data.length; i++) {
option += `<option value='${response.data[i].fexamno}'>${response.data[i].fexamno} - ${response.data[i].fexamname}</option>`;
}
document.getElementById("semesterr").innerHTML = option;
}
},
});
}
function CieAttndEligiblityPdfReport() {
var selectedDegree = [];
var selectElement = document.getElementById("degree");
for (var i = 0; i < selectElement.options.length; i++) {
var option = selectElement.options[i];
if (option.selected) {
selectedDegree.push(option.value);
}
}
var commaSeparatedDegree = selectedDegree.join(", ");
// var date= document.getElementById("date").value;
var sem = document.getElementById("semesterr").value;
if (commaSeparatedDegree == "") {
alert("Select Degree");
return;
}
// if (date == "") {
// alert("Please select Exam Date");
// return;
// }
if (sem == "") {
alert("Select Semester");
return;
}
window.open(
$host_url +
"genrteCieAttndEligblityPdfReport" +
"°ree=" +
commaSeparatedDegree +
"&sem=" +
sem
// +
// "&date=" +
// date
);
}
// function getDegree() {
// $.ajax({
// type: "GET",
// url: $host_url + "degreeReportcie",
// success: function (response) {
// var res = JSON.parse(response);
// console.log(res.data, "vikkkkkk");
// if (res.error_code == -1) {
// alert(res.data.result);
// return;
// } else {
// document.getElementById("degree").option.length = 0;
// var option = `<option value=''>---Select---</option>
// <option value='All'>All</option>`;
// for (i = 0; i < res.data.result.length; i++) {
// option += `<option value='${res.data.result[i].FDEGREE}'>${res.data.result[i].FDEGREE} - ${res.data.result[i].FDESCPN}</option>`;
// }
// document.getElementById("degree").innerHTML = option;
// var option1 = `<option value=''>---Select---</option>
// <option value='All'>All</option>`;
// for (i = 0; i < res.data.result1.length; i++) {
// option1 += `<option value='${res.data.result1[i].fsubname}'>${res.data.result1[i].fsubname}</option>`;
// }
// document.getElementById("subjectt").innerHTML = option1;
// }
// },
// });
// }
function updateSelectedDegrees() {
var selectedDegrees = [];
var selectElement = document.getElementById("degree");
for (var i = 0; i < selectElement.options.length; i++) {
var option = selectElement.options[i];
if (option.selected) {
selectedDegrees.push(option.value);
}
}
// Update the array with comma-separated values
var commaSeparatedDegrees = selectedDegrees.join(", ");
// Now, 'commaSeparatedDegrees' contains the selected degree values with comma separator
console.log(commaSeparatedDegrees);
}
function generateCIEpendingList() {
var semester = document.getElementById("semesterr").value;
var selectedSubjecttArray = $("#subjectt").val() || [];
var event = JSON.stringify(selectedSubjecttArray);
var selectedDegreesArray = $("#degree").val() || [];
var degree = JSON.stringify(selectedDegreesArray);
console.log(event, "ssss");
window.open(
$host_url +
"generteCIEpendListReport" +
"°ree=" +
degree +
"&semesterr=" +
semester +
"&subjectt=" +
event
);
}
function ClearCieAttndEligiblity() {
$("#degree").val("");
$("#date").val("");
$("#semesterr").val("");
// $("#degree").empty();
// // Add default and "All" options
// $("#degree").append(`<option value=''>---Select---</option>
// <option value='All'>All</option>`);
// // Reset the selectedDegreesArray
// selectedDegreesArray = [];
// // Optional: Trigger change event if you want to handle it elsewhere
// $("#degree").trigger("change");
}
|