(function($) {
$(document).ready(function(){
function requisitaJson_93(that){
$('#tabellaMenu_93 .registros').removeClass('selected');
$(that).addClass('selected');
$('#tabella_93').empty();
var html = '';
html += '';
html += '';
html += '';
html += '';
html += '';
var rand = Math.floor(Math.random() * 1000);
$('#tabella_93').html('');
$.getJSON('/grafici/tabella.php?c=93&' + rand, function(data, textStatus, jqxhr){
var idRegistros = $('#tabellaMenu_93 .registros.selected').attr('id');
numeroRegistros = idRegistros.split('_')
$.each(data, function (i, obj) {
if(obj.anno == numeroRegistros[1] || numeroRegistros[1] == 'all'){
let hidden = obj.anno === '2012' ? 'style="display:none"' : '';
html += '';
html += '';
html += '';
html += '' + (obj.rend_reale == 'n.d.'? obj.rend_reale: (obj.rend_reale + '').replace(".", ",") + '%') + '';
html += ' | ';
}
});
html += '';
html += 'Mese | Valore quota (€) | Rendimento da inizio anno |
---|
' + obj.data + ' | ' + obj.valore_reale + ' |
';
$('#tabella_93').html(html);
});
return false;
}
function menuAnni_93(){
var anno;
var html = '';
$('#tabellaMenu_93').empty();
var rand = Math.floor(Math.random() * 1000);
$.getJSON('/grafici/tabella.php?c=93&a=5&' + rand, function(data, textStatus, jqxhr){
var first = true;
$.each(data, function (i, obj) {
if(obj.anno != anno && obj.anno > 1){
html += '' + obj.anno + ' ';
anno = obj.anno;
first = false;
}
});
$('#tabellaMenu_93').html(html).append('Tutti');
$('#tabellaMenu_93 .registros').click(function(e){
return requisitaJson_93(this);
});
requisitaJson_93($('#tabellaMenu_93 .registros.selected'));
});
}
menuAnni_93();
});
})( jQuery );