56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
var pct = 0;
|
|
var prec = 0;
|
|
var checkInterval = 10;
|
|
var url = '';
|
|
|
|
function checkKbis(start)
|
|
{
|
|
if(start>=1){
|
|
$.post( './?page=kbis2', {
|
|
ajax: 'true', start: start, siret: siren },
|
|
function (data, textStatus) { url = data; }
|
|
);
|
|
}else{
|
|
$.post( './?page=kbis2', {
|
|
ajax: 'true', start: 0, url: url, siret: siren },
|
|
function (data, textStatus) {
|
|
if( data!='' && data!='FALSE' ){ updateKbisInfo(data); }
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
function updateKbis(){
|
|
$('#progressbar').reportprogress(++pct);
|
|
if(pct==100){
|
|
updateKbisInfo(message);
|
|
pct=0;
|
|
}
|
|
if( Math.floor(pct/checkInterval)!=prec || pct==1 ){
|
|
prec = Math.floor(pct/checkInterval);
|
|
checkKbis(false);
|
|
}
|
|
}
|
|
|
|
function updateKbisInfo(html){
|
|
$('#result').html(html);
|
|
clearInterval(holdTheInterval);
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
$('input[type=checkbox][name=sendmail]').live('click', function(){
|
|
if($(this).attr('checked')== true){
|
|
$('#formMail').css('display', 'block');
|
|
}else{
|
|
$('#formMail').css('display', 'none');
|
|
}
|
|
});
|
|
|
|
$('form[name=mailkbis]').submit(function(){
|
|
var eMail = $('input[name=mail]').val();
|
|
if(!checkEmail(eMail)){
|
|
alert('Veuillez saisir une adresse email.');
|
|
return false;
|
|
} else { return true; }
|
|
});
|
|
}); |