Changeset 68 for trunk/client


Ignore:
Timestamp:
Mar 31, 2010, 4:51:50 PM (14 years ago)
Author:
roby
Message:

gestione percentuali applicata a grafici, sistemazione xhtml in ele_voti, prova help in inglese

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/modules/Elezioni/grafici.php

    r65 r68  
    247247                from ".$prefix."_ele_voti_ref  where id_cons=$id_cons group by id_gruppo having tot>0",$dbi);
    248248        }
    249 
    250249        while  (list($tot_votanti,$validi,$nulli,$bianchi,$contestati,$id)  = mysql_fetch_row($res1)){
     250                $arperc=array();
     251                $arval=array($validi,$nulli,$bianchi,$contestati);
     252                $arperc=arrayperc($arval,$tot_votanti);
    251253                $tot_votanti=$validi+$bianchi+$nulli+$contestati;
    252                 $perc_validi=number_format($validi*100/$tot_votanti,2);
    253                 $perc_nulli=number_format($nulli*100/$tot_votanti,2);
    254                 $perc_bianchi=number_format($bianchi*100/$tot_votanti,2);
    255                 $perc_conte=number_format($contestati*100/$tot_votanti,2);
     254                $perc_validi=number_format($arperc[0],2);
     255                $perc_nulli=number_format($arperc[1],2);
     256                $perc_bianchi=number_format($arperc[2],2);
     257                $perc_conte=number_format($arperc[3],2);
    256258                $perc_votanti=number_format($tot_votanti*100/$tot_aventi,2);
    257259                $non_votanti=($tot_aventi - $tot_votanti);
     
    433435                                $gruppinum=mysql_num_rows($res);
    434436                                $altrivoti=0;
     437####calcolo percentuale
     438                                $arvoti=array();
     439                                $arperc=array();
     440                                while (list($id,$num,$descrizione,$voti)  = mysql_fetch_row($res)){
     441                                        $arvoti[$id]=$voti;
     442                                }
     443                                $arperc=arrayperc($arvoti,$tot);
     444                                mysql_data_seek($res,0);
     445####
    435446                                while (list($id,$num,$descrizione,$voti)  = mysql_fetch_row($res)){
    436447
     
    469480
    470481
    471                                 $prov=number_format($voti*100/$tot,3);
    472482                                $votiv=number_format($voti,0,',','.');
    473483                                // formattazione numeri perc
    474                                 $prov=number_format($prov,2); // funzione
    475 
     484                                $prov=number_format($arperc[$id],2);
    476485
    477486                        // sviluppo tabella dati
Note: See TracChangeset for help on using the changeset viewer.