Changeset 69


Ignore:
Timestamp:
Apr 1, 2010, 1:04:43 PM (14 years ago)
Author:
roby
Message:

funzione per gestione calcolo percentuali: applicata a grafici

File:
1 edited

Legend:

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

    r68 r69  
    444444                                mysql_data_seek($res,0);
    445445####
     446                                $altriperc=0;
    446447                                while (list($id,$num,$descrizione,$voti)  = mysql_fetch_row($res)){
    447448
     
    465466                                if (strlen($descrizione)>21) $gruppo[$i].="...";
    466467                                if (strlen($descrizione)>21) $gruppos[$e].="...";
    467                                 $pro[$i]=number_format($voti*100/$tot,3);
    468                                 $pre[$e]=number_format($voti*100/$tot,3);// flash
     468                                $pro[$i]=number_format($arperc[$id],2);
     469                                $pre[$e]=number_format($arperc[$id],2); //flash
    469470
    470471
     
    472473                                //somma i voti sotto il 3%
    473474                                $altrivoti = $altrivoti + $voti;
    474                                
     475                                $altriperc += $arperc[$id];
    475476                             }
    476477                               
     
    502503                                        $gruppo[]=_ALTRI;
    503504                                        $gruppos[]=_ALTRI;
    504                                         $pro[]=number_format($altrivoti*100/$tot,3);
    505                                         $pre[]=number_format($altrivoti*100/$tot,3);
     505                                        $pro[]=$altriperc; #number_format($altrivoti*100/$tot,3);
     506                                        $pre[]=$altriperc; #number_format($altrivoti*100/$tot,3);
    506507                                }
    507508
Note: See TracChangeset for help on using the changeset viewer.