modifié : SRC/public/js/ListeOeuvre.js
This commit is contained in:
		@@ -79,19 +79,31 @@ $('#search_button, #previous, #next').click(function(event) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $('#oeuvreRes').empty();
 | 
					    $('#oeuvreRes').empty();
 | 
				
			||||||
    dataSend = { 
 | 
					    dataSend = "_token = $('#_tokenRes').val(),"
 | 
				
			||||||
                _token : $('#_tokenRes').val(),
 | 
					                +"auteur = ('#auteur').val(),"
 | 
				
			||||||
                auteur: $('#auteur').val(),
 | 
					                +"designation = $('#designation').val(),"
 | 
				
			||||||
                designation: $('#designation').val(),
 | 
					                +"matiere = $('#matiere').val(),"
 | 
				
			||||||
                matiere: $('#matiere').val(),
 | 
					                +"domaine = $('#domaine').val(),"
 | 
				
			||||||
                domaine: $('#domaine').val(),
 | 
					                +"technique = $('#technique').val(),"
 | 
				
			||||||
                technique: $('#technique').val(),
 | 
					                +"debut = $('#debut').val(),"
 | 
				
			||||||
                debut: $('#debut').val(),
 | 
					                +"fin = $('#fin').val()";
 | 
				
			||||||
                fin: $('#fin').val()
 | 
					
 | 
				
			||||||
            };
 | 
					    var r = new XMLHttpRequest(); 
 | 
				
			||||||
    $.post(url,
 | 
					    r.open("POST", url, true); 
 | 
				
			||||||
        dataSend,
 | 
					    r.onreadystatechange = function () { 
 | 
				
			||||||
        function( data ) {
 | 
					        if (r.readyState != 4 || r.status != 200) 
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            $("#oeuvreRes").append('<div class="alert alert-danger">'
 | 
				
			||||||
 | 
					            +'<strong>Oouups!</strong> Il y a un problème.<br><br>'
 | 
				
			||||||
 | 
					            +'<ul>'
 | 
				
			||||||
 | 
					            +'<li>Erreur lors de la récupération</li>'
 | 
				
			||||||
 | 
					            +'</ul>'
 | 
				
			||||||
 | 
					            +'</div>'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            return; 
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        data = r.responseText; 
 | 
				
			||||||
        if (data.length == 0 )
 | 
					        if (data.length == 0 )
 | 
				
			||||||
                $("#oeuvreRes").append("Aucune Oeuvre Trouvé..");
 | 
					                $("#oeuvreRes").append("Aucune Oeuvre Trouvé..");
 | 
				
			||||||
            data.data.forEach( function(el) {
 | 
					            data.data.forEach( function(el) {
 | 
				
			||||||
@@ -115,17 +127,8 @@ $('#search_button, #previous, #next').click(function(event) {
 | 
				
			|||||||
                $("#next").parent().removeClass('disabled');
 | 
					                $("#next").parent().removeClass('disabled');
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }, "json" )
 | 
					    }; 
 | 
				
			||||||
    
 | 
					    r.send(dataSend);
 | 
				
			||||||
    .fail(function() {
 | 
					 | 
				
			||||||
        $("#oeuvreRes").append('<div class="alert alert-danger">'
 | 
					 | 
				
			||||||
        +'<strong>Oouups!</strong> Il y a un problème.<br><br>'
 | 
					 | 
				
			||||||
        +'<ul>'
 | 
					 | 
				
			||||||
        +'<li>Erreur lors de la récupération</li>'
 | 
					 | 
				
			||||||
        +'</ul>'
 | 
					 | 
				
			||||||
        +'</div>'
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user