2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
// JS Ajax code for SignaleAbsenceGrSemestre
|
|
|
|
// Contributed by YLB
|
|
|
|
|
2021-02-19 00:13:47 +01:00
|
|
|
function ajaxFunction(mod, etudid, dat) {
|
2020-09-26 16:19:37 +02:00
|
|
|
var ajaxRequest; // The variable that makes Ajax possible!
|
2021-02-19 00:13:47 +01:00
|
|
|
|
|
|
|
try {
|
2020-09-26 16:19:37 +02:00
|
|
|
// Opera 8.0+, Firefox, Safari
|
|
|
|
ajaxRequest = new XMLHttpRequest();
|
2021-02-19 00:13:47 +01:00
|
|
|
} catch (e) {
|
2020-09-26 16:19:37 +02:00
|
|
|
// Internet Explorer Browsers
|
2021-02-19 00:13:47 +01:00
|
|
|
try {
|
2020-09-26 16:19:37 +02:00
|
|
|
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
|
|
|
|
} catch (e) {
|
2021-02-19 00:13:47 +01:00
|
|
|
try {
|
2020-09-26 16:19:37 +02:00
|
|
|
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
|
2021-02-19 00:13:47 +01:00
|
|
|
} catch (e) {
|
2020-09-26 16:19:37 +02:00
|
|
|
// Something went wrong
|
|
|
|
alert("Your browser broke!");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Create a function that will receive data sent from the server
|
2021-02-19 00:13:47 +01:00
|
|
|
ajaxRequest.onreadystatechange = function () {
|
|
|
|
if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
|
|
|
|
document.getElementById("AjaxDiv").innerHTML = ajaxRequest.responseText;
|
2020-09-26 16:19:37 +02:00
|
|
|
}
|
|
|
|
}
|
2021-06-25 18:25:46 +02:00
|
|
|
ajaxRequest.open("POST", SCO_URL + "/Absences/doSignaleAbsenceGrSemestre", true);
|
2021-02-19 00:13:47 +01:00
|
|
|
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
2021-02-26 13:54:16 +01:00
|
|
|
var oSelectOne = $("#abs_form")[0].elements["moduleimpl_id"];
|
|
|
|
var index = oSelectOne.selectedIndex;
|
|
|
|
var modul_id = oSelectOne.options[index].value;
|
2020-09-26 16:19:37 +02:00
|
|
|
if (mod == 'add') {
|
2021-02-19 00:13:47 +01:00
|
|
|
ajaxRequest.send("reply=0&moduleimpl_id=" + modul_id + "&abslist:list=" + etudid + ":" + dat);
|
2020-09-26 16:19:37 +02:00
|
|
|
}
|
|
|
|
if (mod == 'remove') {
|
2021-02-19 00:13:47 +01:00
|
|
|
ajaxRequest.send("reply=0&moduleimpl_id=" + modul_id + "&etudids=" + etudid + "&dates=" + dat);
|
2020-09-26 16:19:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-19 00:13:47 +01:00
|
|
|
// -----
|
|
|
|
function change_moduleimpl(url) {
|
2021-05-01 20:09:09 +02:00
|
|
|
document.location = url + '&moduleimpl_id=' + document.getElementById('moduleimpl_id').value;
|
2021-02-19 00:13:47 +01:00
|
|
|
}
|