Created
August 18, 2017 16:10
-
-
Save unoframille/d75f7b289a184e2fdeb662bf2cf0888b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkAvailability() { | |
var dataLezione = $("#dateTime").val(); | |
var start = $('#oraInizio').val(); | |
var end = $("#oraFine").val(); | |
$.post("ajax/stanze/availability.php", { | |
'start': dataLezione + ' ' + start, | |
'end': dataLezione + ' ' + end | |
}).done(function(json) { | |
var result = jQuery.parseJSON(json); | |
$('.select option').attr('disabled', false); | |
$.each(result, function(index, value){ | |
console.log('stanza ' + value.id_stanza + ' -- insegnante ' + value.id_insegnante) | |
$('#select-room-'+value.id_stanza).attr('disabled', 'disabled'); | |
$('#select-teacher-'+value.id_insegnante).attr('disabled', 'disabled'); | |
}); | |
$('#nuovo-stanza-lezione').select2('destroy').select2().val('').change();; | |
$('#nuovo-insegnante-lezione').select2('destroy').select2().val('').change();; | |
console.log('--------'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment