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
|
$("#liste_activites").change(function()
{
$('#listec').empty();
var activiteValue=$('#liste_activites').find('option:selected').val();
$.post("<?= $this->Url->build(['controller'=>'Etudiants','action'=>'searchCours'])?>",
{
activite: activiteValue,
site: siteValue,
type: typeValue
},
function(data, status)
{
var obj = $.parseJSON(data);
$.each(obj, function(index, value)
{
$('.TableauCours').show();
$('.Reservation').show();
if ((value._matchingData.CoursTypes.quota_i_lp == value._matchingData.CoursTypes.quota_lp ) && (value._matchingData.CoursTypes.quota_i_lc < value._matchingData.CoursTypes.quota_lc )) {
$('#listec').append('<option value="' + value.id + '" selected="selected">' + value.libelle + ' , ' + value.jour +' , ' + value.heure_debut + ' à ' + value.heure_fin +' , ' + value.lieu_exercice.nom +' ------- LP : '+ value._matchingData.CoursTypes.quota_i_lp + '/' + value._matchingData.CoursTypes.quota_lp + ' ------- LC : '+value._matchingData.CoursTypes.quota_i_lc+ '/' + value._matchingData.CoursTypes.quota_lc+'</option>').css('background-color', 'orange');
}
if ((value._matchingData.CoursTypes.quota_i_lp < value._matchingData.CoursTypes.quota_lp ) && (value._matchingData.CoursTypes.quota_i_lc < value._matchingData.CoursTypes.quota_lc )) {
$('#listec').append('<option value="' + value.id + '" selected="selected">' + value.libelle + ' , ' + value.jour +' , ' + value.heure_debut + ' à ' + value.heure_fin +' , ' + value.lieu_exercice.nom +' ------- LP : '+ value._matchingData.CoursTypes.quota_i_lp + '/' + value._matchingData.CoursTypes.quota_lp + ' ------- LC : '+value._matchingData.CoursTypes.quota_i_lc+ '/' + value._matchingData.CoursTypes.quota_lc+'</option>').css('background-color', '#00FF00');
}
});
});
}); |
Partager