COEFFICENTE_SFRATTO = $sfratto; $bando->COEFFICENTE = $nosfratto; $res = $bando->Save(); exit(json_encode(array($res))); } function loadDisponibilita(){ $simula = trim($_POST['disponibilita']); $r = array(); $r = Domanda::getDisponibilita($simula); $bando = new Bando(ID_BANDO_RIF); $r['COEFFICENTE_SFRATTO_BANDO'] = number_format($bando->COEFFICENTE_SFRATTO, 6); $r['COEFFICENTE_BANDO'] = number_format($bando->COEFFICENTE, 6); $r['TOTALE_PRESENTATE'] = ($r['NUM_DOMANDE_SFRATTO'] + $r['NUM_DOMANDE']); $r['DISPONIBILITA_FINANZIARIA'] = number_format($r['DISPONIBILITA_FINANZIARIA'], 6, ',', '.'); $r['DISPONIBILITA_FINANZIARIA_SFRATTO'] = number_format($r['DISPONIBILITA_FINANZIARIA_SFRATTO'], 6, ',', '.'); $r['TOTALE_CONTRIBUTO_SFRATTO'] = number_format(round(str_replace(",", ".", $r['TOTALE_CONTRIBUTO_SFRATTO']), 2), 6, ',', '.'); $r['COEFFICENTE_SFRATTO'] = number_format($r['COEFFICENTE_SFRATTO'], 6, ',', '.'); $r['ECCEDENZA_SFRATTO'] = number_format($r['ECCEDENZA_SFRATTO'], 6, ',', '.'); $r['DISPONIBILITA_FINANZIARIA_ALTRI'] = number_format($r['DISPONIBILITA_FINANZIARIA_ALTRI'], 6, ',', '.'); $r['DISPONIBILITA_ALTRI'] = number_format($r['DISPONIBILITA_ALTRI'], 6, ',', '.'); $r['TOTALE_CONTRIBUTO'] = number_format(round(str_replace(",", ".", $r['TOTALE_CONTRIBUTO']), 2), 2, ',', '.'); $r['COEFFICENTE_ALTRI'] = number_format($r['COEFFICENTE_ALTRI'], 6, ',', '.'); $r['RESIDUO'] = number_format($r['RESIDUO'], 5, ',', '.'); // number_format(DISPONIBILITA_FINANZIARIA, 2, ',', '.') exit(json_encode(array($r))); } function loadStatistiche(){ global $PROVINCE_SICILIA; $result = array(); $provincie = Domanda::GetTotaleContributoProvincia(); $charts['labels'] = array(); for($i = 0; $i $v){ $labels_compagnie['labels'][] = $k; //Utils::print_array($v); foreach($v as $key => $value){ if($key == 'N_RICHIESTE'){ $labels_compagnie['datasetsR']['label'] = 'Numero richieste'; $labels_compagnie['datasetsR']['data'][] = $value; $labels_compagnie['datasetsR']['backgroundColor'][] = $tmp_colorR; } if($key == 'TOT_SCONTO'){ $labels_compagnie['datasetsS']['label'] = 'Importo richieste'; $labels_compagnie['datasetsS']['data'][] = $value; $labels_compagnie['datasetsS']['backgroundColor'][] = $tmp_colorS; } } } $labels_tratte['labels'] = array(); $tmp_color = Utils::generaColoreRGB('1'); foreach($num_tratte as $k => $v){ $labels_tratte['labels'][] = $k; //Utils::print_array($v); foreach($v as $key => $value){ if($key == 'N_RICHIESTE'){ $labels_tratte['datasets']['label'] = 'Numero richieste'; $labels_tratte['datasets']['data'][] = $value; $labels_tratte['datasets']['backgroundColor'][] = $tmp_color; } } } $result['datasets'] = $datasets; $result['chardatasets'] = $charts; $result['provincie'] = $provincie; $result['compagnie'] = $labels_compagnie; $result['tratte'] = $labels_tratte; exit(json_encode(array($result))); } function domandePreparate() { $rec = array(); $rec['domande_presentate'] = Domanda::Count(); $rec['domande_complete'] = Domanda::Count('STATO = 1'); $rec['domande_inattesa'] = Domanda::Count('STATO = 0'); //$microimpreseAll = ClusterDb::Count(); //$microimpreseRegistrate = Account::Count('CONSENSO = 1'); //$microimpreseRegistrateNoConsenso = Account::Count('CONSENSO = 0'); exit(json_encode(array($rec))); } function array_to_xml($array, &$xml_istanze) { foreach ($array as $key => $value) { if (is_array($value)) { if (!is_numeric($key)) { $subnode = $xml_istanze->addChild("$key"); array_to_xml($value, $subnode); } else { $subnode = $xml_istanze->addChild("istanza"); array_to_xml($value, $subnode); } } else { $xml_istanze->addChild("$key", htmlspecialchars("$value")); } } }