Changeset 228


Ignore:
Timestamp:
Nov 15, 2014, 7:19:07 PM (9 years ago)
Author:
roby
Message:

admin: correzione nella gestione della modifica dei dati del comune
client: visualizzazione del widget "02_risultati" anche per le circoscrizionali e per comuni con più collegi

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/modules/Elezioni/ele_comuni.php

    r189 r228  
    8282        echo "<td bgcolor=\"$bgcolor1\"><b>"._STEMMA."</b></td><td><input type=\"file\" name=\"stemma\" size=\"10\"></td>";
    8383        echo "<td bgcolor=\"$bgcolor1\"><b>"._CODICE."</b></td>";
    84         if ($desc)
     84        if ($id_comune2)
    8585                echo "<td><input type=\"hidden\" name=\"id_comune2\" value=\"$id_comune2\">$id_comune2</td>";
    8686        else
     
    109109        echo "<td></td><td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
    110110        echo "<input type=\"hidden\" name=\"ok\" value=0>";
    111         if ($desc) {
     111        if ($id_comune2) {
    112112                echo "<input type=\"hidden\" name=\"do\" value=\"update\">";
    113113                echo "<input type=\"submit\" name=\"add\" value=\""._MODIFY."\"></td></tr></form>";
  • trunk/admin/versione.php

    r227 r228  
    11<?php
    2 $versione="2.0 rev 227";
     2$versione="2.0 rev 228";
    33?>
  • trunk/client/modules/Elezioni/blocchi/02_risultati.php

    r73 r228  
    1515
    1616
    17 if($genere!='0' && !$circo){ // referendum e circoscrizionali
     17if($genere!='0'){ // referendum e circoscrizionali
    1818    list ($gruppo,$pro)=grupporss();
    1919    if ($gruppo!='')echo "<h5>Risultati </h5>";
  • trunk/client/modules/Elezioni/funzioni.php

    r180 r228  
    256256          if($genere=='4' || $votog) $tab="ele_voti_lista";
    257257          else $tab="ele_voti_gruppo";
    258        
     258          if($id_circ and !$circondt1) $circondt1="and t1.id_circ=$id_circ";
    259259     
    260260 
     
    264264        $res = mysql_query("select t2.*  from ".$prefix."_ele_sezioni as t2, ".$prefix."_ele_sede as t1 where t2.id_cons='$id_cons' and t1.id_sede=t2.id_sede $circondt1",$dbi);
    265265        if ($res) $sezioni=mysql_num_rows($res);else $sezioni=0;
    266        
    267266        if ($numero>0){
    268267                if ($genere!=0){
    269268                        $restotv = mysql_query("select sum(voti)  from ".$prefix."_$tab where id_cons='$id_cons' ",  $dbi);
    270269                        list($tot)  = mysql_fetch_row($restotv);
    271                        
    272270                        $i=0;
    273271                        // lista o gruppo
    274272                        if ($genere!=4){
    275                                  
    276273                                if ($votog){
    277                                
    278                                 $res = mysql_query("select t1.id_gruppo, t1.num_gruppo, t1.descrizione, sum(t2.voti) as somma
    279                                 from ".$prefix."_ele_gruppo as t1,
    280                                 ".$prefix."_ele_voti_lista as t2,
    281                                 ".$prefix."_ele_lista as t3
    282                                 where   t1.id_cons='$id_cons'
    283                                 and t2.id_lista=t3.id_lista
    284                                 and t1.id_gruppo=t3.id_gruppo
    285                                 group by t1.id_gruppo
    286                                 order by somma desc", $dbi);$cosa='id_gruppo';
    287                                
     274                                        $res = mysql_query("select t1.id_gruppo, t1.num_gruppo, t1.descrizione, sum(t2.voti) as somma
     275                                        from ".$prefix."_ele_gruppo as t1,
     276                                        ".$prefix."_ele_voti_lista as t2,
     277                                        ".$prefix."_ele_lista as t3
     278                                                where   t1.id_cons='$id_cons'
     279                                        and t2.id_lista=t3.id_lista
     280                                        and t1.id_gruppo=t3.id_gruppo
     281                                        group by t1.id_gruppo
     282                                        order by somma desc", $dbi);
    288283                                }else{
    289                                
    290                        
    291284                                $res = mysql_query("select t1.id_gruppo, t1.num_gruppo, t1.descrizione, sum(t2.voti) as somma
    292                                 from ".$prefix."_ele_gruppo as t1
    293                                 left join ".$prefix."_$tab as t2 on (t1.id_gruppo=t2.id_gruppo)
    294                                 where   t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circondt1
    295                                 group by t2.id_gruppo
    296                                 order by somma desc", $dbi);$cosa='id_gruppo';
    297                                }
    298                        
    299                        
     285                                        from ".$prefix."_ele_gruppo as t1
     286                                left join ".$prefix."_ele_voti_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo)
     287                                        where   t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons $circondt1
     288                                        group by t2.id_gruppo
     289                                        order by somma desc", $dbi);
     290                            }
    300291                        }else{
    301292                                $res = mysql_query("select t1.id_lista, t1.num_lista, t1.descrizione, sum(t2.voti) as somma
     
    304295                                where   t1.id_cons='$id_cons' and t1.id_cons=t2.id_cons
    305296                                group by t2.id_lista
    306                                 order by somma desc", $dbi);$cosa='id_lista';
     297                                order by somma desc", $dbi);
    307298                        }
    308 
    309                
    310                                        
    311299                                $gruppinum=mysql_num_rows($res);
    312300                                $altrivoti=0;
     
    316304                                $arvaltot=0;
    317305                                while (list($id,$num,$descrizione,$voti)  = mysql_fetch_row($res)){
    318                                 $arval[$id]=$voti;
    319                                 $arvaltot+=$voti;
     306                                        $arval[$id]=$voti;
     307                                        $arvaltot+=$voti;
    320308                                }
    321309                                $arperc=arrayperc($arval,$arvaltot);
    322310                                mysql_data_seek($res,0);
    323 ######
    324311                                while (list($id,$num,$descrizione,$voti)  = mysql_fetch_row($res)){
    325 
    326                                
    327                                
    328                                 // funz per il taglio corretto della frase 13 feb 2007
    329                                
    330                                 $descrizione=substr($descrizione,0,20);
    331                                 $gruppo[$i]=ucwords(strtolower($descrizione));
    332                                
    333                                 //if (strlen($descrizione)>25) $gruppo[$i].="...";
    334                                 if ($tot!='' and $tot!='0')
    335                                 $pro[$i]=number_format($voti*100/$tot,3);
    336                                 $pro[$i]=number_format($arperc[$id],2); // arrotondamento
    337                                
    338 
    339                                        
    340                                
    341 
    342 
    343                        
    344                        
    345                         $i++;
     312                                        // funz per il taglio corretto della frase 13 feb 2007
     313                                        $descrizione=substr($descrizione,0,20);
     314                                        $gruppo[$i]=ucwords(strtolower($descrizione));
     315                                        if ($tot!='' and $tot!='0')
     316                                        $pro[$i]=number_format($voti*100/$tot,3);
     317                                        $pro[$i]=number_format($arperc[$id],2); // arrotondamento
     318                                        $i++;
     319                                }
     320               
     321
     322
     323               
     324                $titolo=""._PERCE." "._VOTIE."";
     325                return array($gruppo,$pro);
    346326                }
    347                
    348 
    349 
    350                
    351                 $titolo=""._PERCE." "._VOTIE."";
    352                
    353                
    354                
    355 
    356                
    357                
    358 
    359                 return array($gruppo,$pro);
    360                
    361                
    362 
    363           }
    364327
    365328        }
  • trunk/client/versione.php

    r227 r228  
    11<?php
    2 $versione="2.0 rev 227";
     2$versione="2.0 rev 228";
    33?>
Note: See TracChangeset for help on using the changeset viewer.