22 lines
642 B
JavaScript
22 lines
642 B
JavaScript
$(document).ready(function(){
|
|
|
|
$('.rs').click(function(e){
|
|
e.preventDefault();
|
|
var item = $(this);
|
|
$.post(item.attr('href'),
|
|
function(data){ item.replaceWith('<b>'+data+'</b>'); }
|
|
);
|
|
});
|
|
|
|
$('select.changeEtat').change(function(e){
|
|
e.preventDefault();
|
|
var commandeEtat = $(this).val();
|
|
var commandeId = $(this).attr('name');
|
|
var commandeType = $('input[name=mode]').val();
|
|
var href = $(this).parent('form').attr('action');
|
|
$.post(href, { etat: commandeEtat, idCommande: commandeId, mode: commandeType}, function(data){
|
|
if (data==0){ alert("Une erreur s'est produite...Raffraichir la page!");}
|
|
});
|
|
});
|
|
|
|
}); |