Ignore:
Timestamp:
Mar 13, 2018, 9:26:23 PM (6 years ago)
Author:
roby
Message:

adeguata la funzione di installazione al php7

File:
1 edited

Legend:

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

    r250 r254  
    2626$perms=ChiSei($id_cons_gen);
    2727if ($perms<16 or !$id_cons_gen) die("$perms Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
    28 $res = mysql_query("SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
    29 list($tipo_cons,$id_cons) = mysql_fetch_row($res);
     28$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons,t2.solo_gruppo,t2.disgiunto FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
     29list($tipo_cons,$id_cons,$dettnulli,$disgiunto) = mysql_fetch_row($res);
    3030$res = mysql_query("SELECT genere,voto_g,voto_l FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' " , $dbi);
    3131        list($genere,$votog,$votol) = mysql_fetch_row($res);
     
    102102       
    103103        }else{
    104         if ($dettnulli){
     104        if ($dettnulli or $disgiunto){
    105105                        $res = mysql_query("SELECT id_gruppo,num_gruppo,descrizione from ".$prefix."_ele_gruppo where id_cons='$id_cons' order by num_gruppo", $dbi);
    106106
    107107        echo "<fieldset><legend>"._GRUPPO."</legend>";
    108         echo "<table border=\"1\" width=\"100%\"><tr><th colspan=\"2\" rowspan=\"2\" ALIGN=\"CENTER\"><b>Candidato</b></th><th rowspan=\"2\" ALIGN=\"CENTER\">"._VALIDI."</th><th colspan=\"2\" ALIGN=\"CENTER\">"._SOLO_GRUPPO."</th></tr><tr><th ALIGN=\"CENTER\">Senza indicazione di lista</th><th>"._VOTINULLI." di Lista</th></TR>";
     108        echo "<table border=\"1\" width=\"100%\"><tr><th colspan=\"2\" rowspan=\"2\" ALIGN=\"CENTER\"><b>Candidato</b></th><th rowspan=\"2\" ALIGN=\"CENTER\">"._VALIDI."</th><th colspan=\"2\" ALIGN=\"CENTER\">"._SOLO_GRUPPO."</th></tr><tr><th ALIGN=\"CENTER\">Senza indicazione di lista</th>";
     109        if ($disgiunto) echo "<th>"._SOLOLIS."</th>"; else echo "<th>"._VOTINULLI." di Lista</th>";
     110        echo "</TR>";
     111        $t_voti=0;$t_solo_gruppo=0;$t_nulli_lista=0;
    109112        while(list($id_gruppo,$num_gruppo,$desc) = mysql_fetch_row($res)){
    110113                $resv = mysql_query("SELECT sum(voti),sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_gruppo='$id_gruppo'", $dbi);
    111114                list($voti,$solo_gruppo)=mysql_fetch_row($resv);
    112                 $resv = mysql_query("SELECT sum(t1.nulli_lista) from ".$prefix."_ele_voti_lista as t1 left join ".$prefix."_ele_lista as t2 on t1.id_lista=t2.id_lista where t2.id_gruppo='$id_gruppo'", $dbi);
    113                 list($nulli_lista)=mysql_fetch_row($resv);
    114                        
    115                 ECHO "<TR><TD>".$num_gruppo."</TD><TD>".$desc."</TD><TD ALIGN=\"RIGHT\">".number_format($voti,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($solo_gruppo,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($nulli_lista,0,',','.')."</TD></TD></TR>";
     115                if($disgiunto){
     116                        $resv = mysql_query("SELECT sum(t1.solo_lista) from ".$prefix."_ele_voti_lista as t1 left join ".$prefix."_ele_lista as t2 on t1.id_lista=t2.id_lista where t2.id_gruppo='$id_gruppo'", $dbi);         
     117                }else{
     118                        $resv = mysql_query("SELECT sum(t1.nulli_lista) from ".$prefix."_ele_voti_lista as t1 left join ".$prefix."_ele_lista as t2 on t1.id_lista=t2.id_lista where t2.id_gruppo='$id_gruppo'", $dbi);
     119                }
     120                list($perlista)=mysql_fetch_row($resv);
     121                $t_voti+=$voti;$t_solo_gruppo+=$solo_gruppo;$t_perlista+=$perlista;     
     122                ECHO "<TR><TD>".$num_gruppo."</TD><TD>".$desc."</TD><TD ALIGN=\"RIGHT\">".number_format($voti,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($solo_gruppo,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($perlista,0,',','.')."</TD></TD></TR>";
    116123        }
     124        echo "<tr><th colspan=\"2\" rowspan=\"2\" ALIGN=\"CENTER\"><b>Totale</b></th><th rowspan=\"2\"  ALIGN=\"RIGHT\">$t_voti</th><th ALIGN=\"RIGHT\">$t_solo_gruppo</th><th ALIGN=\"RIGHT\">$t_perlista</th></tr>";
    117125        ECHO "</table><br/></fieldset><br/><br/><br/>";
    118126
Note: See TracChangeset for help on using the changeset viewer.