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
|
|
|
}
|
|
|
|
}
|
|
|
|
ajaxRequest.open("POST", "doSignaleAbsenceGrSemestre", true);
|
2021-02-19 00:13:47 +01:00
|
|
|
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
oForm = document.forms[1];
|
2020-09-26 16:19:37 +02:00
|
|
|
oSelectOne = oForm.elements["moduleimpl_id"];
|
|
|
|
index = oSelectOne.selectedIndex;
|
2021-02-19 00:13:47 +01:00
|
|
|
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) {
|
|
|
|
document.location = url + '&moduleimpl_id=' + document.getElementById('moduleimpl_id').value;
|
|
|
|
}
|