1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
/**fonction qui récupére et affecte une valeur a une variable selon l'onglet choisi***/
$(function(){
$('#tabs').tabs({
select: function(event, ui) {
var theSelectedTab = ui.index;
var typerapport ='';
if (theSelectedTab == 0) {
//alert("0");
typerapport = 'combine';
}
else if (theSelectedTab == 1) {
alert("1");
typerapport = 'faitiere';
}
}
});
});
/**fonction ajax qui renvoi la valeur au fichier php**/
function sauvegarder(elt) {
var ajaxRequest; // The variable that makes Ajax possible!
/*if(!confirm("Etes-vous sûr de vouloir ajouter ce rapport?")) {
elt.checked = false;
return false;
}*/
try {
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e) {
// Internet Explorer Browsers
try {
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function() {
if(ajaxRequest.readyState == 4) {
document.location.reload(true);
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.value = ajaxRequest.responseText;
}
}
var queryString = "?rapport=" + elt.value + "&NumAgrement=" + document.getElementById("numAgrement").value +"&TypeRap=" + typerapport ;
ajaxRequest.open("GET", "insertion-rapport-reseau.php" + queryString, true);
ajaxRequest.send(null);
elt.disabled = true;
var raportselect = document.getElementById("raportselect").value;
document.getElementById("raportselect").value = parseInt(raportselect) + 1;
} |
Partager