57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
$(document).ready(function()
|
|
{
|
|
$('a#xls').live('click', function(e){
|
|
e.preventDefault();
|
|
var objet = $(this).parent();
|
|
objet.html('Construction du fichier...');
|
|
var url = $(this).attr('href');
|
|
$.post( url, function (data, textStatus)
|
|
{
|
|
if( data=='' || data=='FALSE' || textStatus=='timeout' )
|
|
{
|
|
data = 'La construction du fichier a échoué.<br/>';
|
|
}
|
|
objet.html(data);
|
|
});
|
|
});
|
|
|
|
$('#bilanClient').live('click', function(e){
|
|
e.preventDefault();
|
|
var url = $(this).attr('href');
|
|
var title = $(this).attr('title');
|
|
var dialogOpts = {
|
|
bgiframe: true,
|
|
title: title,
|
|
width: 500,
|
|
height: 400,
|
|
modal: true,
|
|
open: function(event, ui) {
|
|
$(this).html('Chargement...');
|
|
$(this).load(url);
|
|
},
|
|
buttons: {
|
|
Valider: function() { formEnvoiBilanSubmit(); },
|
|
Annuler: function() { $(this).dialog('close'); }
|
|
},
|
|
close: function() { $('#dialogbilanclient').remove(); }
|
|
};
|
|
$('<div id="dialogbilanclient"></div>').dialog(dialogOpts);
|
|
return false;
|
|
});
|
|
|
|
});
|
|
|
|
function formEnvoiBilanSubmit(){
|
|
var url = $('#formEnvoiBilan').attr('action');
|
|
$.post(url, $('#formEnvoiBilan').serialize(),
|
|
function (data, textStatus) {
|
|
if (textStatus!='success'){
|
|
$('#dialogbilanclient').html('Erreur');
|
|
} else {
|
|
$('#dialogbilanclient').html(data);
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|