Ignore:
Timestamp:
Mar 30, 2010, 11:47:58 AM (14 years ago)
Author:
roby
Message:

icorretto calcolo percentuali in visualizzazione riepilogo voti (da completare con arrotondamento percentuali) + vari aggiustamenti

File:
1 edited

Legend:

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

    r39 r64  
    495495                                $ar[(2+$offsetsez-$minsez)][0]="<b>"._TOT."<br />"._COMPLESSIVO."</b>";
    496496                                if(isset($temp)) {
     497######################
     498                     if($tab15=="gruppo"){
     499                          $votigl=" sum(validi),sum(nulli),sum(bianchi),sum(contestati),sum(voti_nulli)";
     500                     }else{
     501                         /* if ($votog) $votigl=" (validi_lista),(nulli),(bianchi),(contestati_lista),(voti_nulli_lista)";
     502                          else */
     503                          $votigl=" sum(validi_lista),sum(nulli),sum(bianchi),sum(contestati_lista),sum(voti_nulli_lista)";
     504                     }
     505                                        $resv = mysql_query("SELECT $votigl from ".$prefix."_ele_sezioni where id_cons='$id_cons'",$dbi);
     506                                        list ($sevaltot,$senultot,$sebiatot,$secontot,$sevnutot)= mysql_fetch_row($resv);
     507                                        $voticompl=$sevaltot+$senultot+$sebiatot+$secontot+$sevnutot;
     508                                        $resvt = mysql_query("SELECT voti from ".$prefix."_ele_voti_$tab15 where id_cons='$id_cons'",$dbi);
     509                                        list($votlt)=mysql_fetch_row($resvt);
    497510                                        while (list($key,$voti)= each($temp)) {
    498511                                                $percento="<b>$voti</b>";
    499512                                                if ($perc=='true' and $voticompl)
    500513                                                {
    501                                                         $percento="<b>$voti<br /><span class=\"red\"><i>".number_format($voti*100/$voticompl,2)." %</i></span></b>";
     514                                                        $percento="<b>$voti<br /><span class=\"red\"><i>".number_format($voti*100/$sevaltot,2)." %</i></span></b>";
    502515                                                }
    503516                                                $ar[2+$offsetsez-$minsez][$key]=$percento;
     
    507520                                $key=$offset+1;
    508521                                $tmp=array($sevaltot,$senultot,$sebiatot,$secontot,$sevnutot);
    509                                 $voticompl=$sevaltot+$senultot+$sebiatot+$secontot+$sevnutot;
    510522                                while(list($k,$voti)= each($tmp)) {
    511523                                        $percento="<b>$voti</b>";
Note: See TracChangeset for help on using the changeset viewer.