Changeset 394


Ignore:
Timestamp:
May 21, 2023, 1:46:40 AM (11 months ago)
Author:
roby
Message:

-- ADMIN

  • Inserito il controllo per la gestione del caso di sezione con zero votanti

-- CLIENT

  • Inserito il controllo della dimensione del logo
  • Ulteriori modifiche all'assegnazione dei seggi secondo la legge siciliana
Location:
trunk
Files:
10 edited

Legend:

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

    r342 r394  
    2020        $res->execute();       
    2121}else{ #candidati
    22         $sql="SELECT t2.id_lista FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista";
     22        $sql="SELECT t1.num_cand FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista";
    2323        $res = $dbi->prepare("$sql");
    2424        $res->execute();
    2525        $liste=$res->rowCount();
    26        
     26        list($listescru)=$res->fetch(PDO::FETCH_NUM);
     27        if($res->rowCount() and $listescru==0) {$listescru=1;$liste=0;}
    2728        $sql="SELECT count(id_lista) FROM ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco";
    2829        $res = $dbi->prepare("$sql");
    2930        $res->execute();
    3031        list($ltot)=$res->fetch(PDO::FETCH_NUM);
    31         if($liste && $liste==$ltot){
     32        if(($liste && $liste==$ltot) or $listescru){
    3233                $sezstat=2;
    33                 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; #VERDE
     34                $sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; ;#VERDE
    3435                $res = $dbi->prepare("$sql");
    3536                $res->execute();       
  • trunk/admin/modules/Elezioni/ele_spoglio.php

    r392 r394  
    670670
    671671function finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
    672  global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite;
     672 global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite,$scrtest;
    673673////////////////////////////////////////////
    674674// da qua va la sezione per i voti finali
     
    676676$bgcolor1="#7777ff";
    677677$bgcolor2=$_SESSION['bgcolor2'];
    678 
    679 
    680 
    681         echo "<form name=\"spogliovoti\" data-ajax=\"false\" action=\"modules/Elezioni/salva_voti.php\">"
    682         ."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";
    683         echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
    684         ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
    685         ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
    686         ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
    687         ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
     678echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     679."//-->\n";
     680echo "function setsez() {\n";
     681echo "document.getElementById('spogliovoti').submit(); }\n";
     682echo "</script>\n";     
     683
     684$sql="select * from ".$prefix."_ele_voti_lista where id_cons=$id_cons and id_sez=$id_sez and id_lista=0";
     685$res = $dbi->prepare("$sql");
     686$res->execute();
     687$stato=$res->rowCount();
     688if($stato) $stato='checked'; else $stato='';
     689echo "<form name=\"spogliovoti\" id=\"spogliovoti\" data-ajax=\"false\" action=\"modules/Elezioni/salva_voti.php\">"
     690."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";
     691echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
     692."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
     693."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
     694."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
     695."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
     696if($scrtest)
     697        echo "<div style=\"text-align:right;\">Considerare la sezione come scrutinata? <input type=\"checkbox\" name=\"scrutinata\" id=\"scrutinata\" value=\"true\" $stato onclick=\"setsez()\";> <br></div>";
    688698
    689699        echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr bgcolor=\"$bgcolor1\" align=\"center\">";
     
    750760
    751761function preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
    752  global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli;
     762 global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli,$scrtest;
    753763////////////////////////////////////////////
    754764// da qua va la sezione per le preferenze ai gruppi
     
    938948                        ."<td colspan=\"2\"><b>"._VOTANTI."</b></td></tr>";
    939949                }else{
    940                         echo "<br><br> <table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
     950                        echo "<br><br><table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
    941951                        ."<td width=\"3%\"><b>"._NUM."</b></td>"
    942952                        ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";
     
    956966                $tot_pref=0;
    957967                $totsg=0;
    958                 $pro=array();
    959                 $pro['voti']='';
    960                 $pro['solo_gruppo']='';
    961968                while(list($id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo) = $result->fetch(PDO::FETCH_NUM)){
    962969                        echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     
    10121019                                        $res = $dbi->prepare("$sql");
    10131020                                        $res->execute();
    1014                                         if($res->rowCount())
    1015                                                 $pro= $res->fetch(PDO::FETCH_BOTH);
     1021                                        $pro= $res->fetch(PDO::FETCH_BOTH);
     1022                                        if(!$res->rowCount()) {$pro['voti']=''; $pro['solo_gruppo']='';}
    10161023                                        $errcolor='';
    10171024                                        if(isset($errgrulis[$id_gruppo])) {$errcolor="style=\"background-color: rgb(255, 0, 0);\"";}
     
    10461053                }
    10471054                echo "</td></tr></table></center>";
    1048         }
     1055                $scrtest=0;
     1056        }else{$scrtest=1;}
    10491057        if ($genere!=0){
    10501058                finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
  • trunk/admin/modules/Elezioni/salva_voti.php

    r352 r394  
    3939if (isset($_GET['ops'])) $ops=intval($_GET['ops']); else $ops='';
    4040if (isset($_GET['delete'])) $delete=intval($_GET['delete']); else $delete='';
    41 
     41if (isset($_GET['scrutinata'])) {$scrutinata=$_GET['scrutinata']==false ? false : true;}else $scrutinata=false;
     42#$_SESSION['scrutinata']=$scrutinata;
     43#if(isset($_SESSION['scrutinata'])) $scrutinata=$_SESSION['scrutinata']; #else $scrutinata=false;
    4244global $prefix,$id_parz,$genere,$fileout,$id_cons;
    4345if (!isset($fileout)) $fileout='';
     
    6971        $res->execute();
    7072        if ($fileout) fwrite($fp,"$sql;\n");
     73######
     74#include($sql."TEST: scru=$scrutinata");
     75if(isset($scrutinata))
     76{       
     77        $sql="delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and num_gruppo=0";
     78        $res = $dbi->prepare("$sql");
     79        $res->execute();
     80        $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez' and num_lista=0";
     81        $res = $dbi->prepare("$sql");
     82        $res->execute();
     83        $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez' and num_cand=0";
     84        $res = $dbi->prepare("$sql");
     85        $res->execute();
     86        if($scrutinata==true)
     87        {
     88                # provare insert dei soli id_cons e id_sez
     89                $sql="insert into ".$prefix."_ele_voti_gruppo (id_cons,id_sez,num_gruppo) values('$id_cons','$id_sez',0)";
     90                $res = $dbi->prepare("$sql");
     91                $res->execute();
     92                $sql="insert into ".$prefix."_ele_voti_lista (id_cons,id_sez) values('$id_cons','$id_sez')";
     93                $res = $dbi->prepare("$sql");
     94                $res->execute();
     95                $sql="insert into ".$prefix."_ele_voti_candidati (id_cons,id_sez,num_cand) values('$id_cons','$id_sez',0)";
     96                $res = $dbi->prepare("$sql");
     97                $res->execute();
     98#               
     99        }               
     100}       
    71101/*}else{
    72102        $sql="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$aid','','','validi:$ar[6] nulli:$ar[7] bianchi:$ar[8] contestati:$ar[9] voti_nulli:$ar[13]','validi=$validi, nulli=$nulli,bianchi=$bianchi,contestati=$contestati, voti_nulli=$votinulli','_ele_sezioni')";
  • trunk/admin/versione.php

    r393 r394  
    11<?php
    22
    3 $versione = "3.0 rev 393";
     3$versione = "3.0 rev 394";
    44$version_number = $versione;
    5 $datarel = "05 marzo 2023";
     5$datarel = "21 maggio 2023";
    66$version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
    77
  • trunk/client/modules/Elezioni/blocchi/gom_affluenze.php

    r318 r394  
    4040       
    4141                echo "<h5>Ultime Affluenze</h5>";
     42                if($numero=$sezioni)
     43               echo "<div style=\"text-align:center;color:#ff0000\">"._PERC."<br><b>"._ORE." $ore,$minuti "._DEL."  $giorno/$mese/$anno</b></div>";
     44                else
    4245               echo "<div style=\"text-align:center;color:#ff0000\">"._PERC_TEND."<br><b>"._ORE." $ore,$minuti "._DEL."  $giorno/$mese/$anno</b></div>";
    4346                                                                                                                             
  • trunk/client/modules/Elezioni/blocchi/pie_affluenze.php

    r354 r394  
    2121// numero sezioni scrutinate
    2222
    23                 $sql="select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos";
     23        $sql="select t1.*  from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos";
    2424        $res2 = $dbi->prepare("$sql");
    2525        $res2->execute();
    26 
    27                 $sezioni=$res2->fetch(PDO::FETCH_NUM);
     26        $numsez=$res2->rowCount();
     27        $sezioni=$res2->fetch(PDO::FETCH_NUM);
    2828
    2929    $sql="select orario,data  from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' order  by data desc,orario desc limit 1";
     
    3737                list ($anno,$mese,$giorno)=explode('-',$data);
    3838                $tot_v_m=0;$tot_v_d=0;$tot_t=0;
    39        
     39                        $sql="select t3.id_sez from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos  group by t3.id_sez ";
     40                        $res1 = $dbi->prepare("$sql");
     41                        $res1->execute();
     42                        $numero=$res1->rowCount();             
     43                        echo "<h5>Ultime Affluenze</h5>";
     44                        if($numero==$numsez)
     45                                echo "<div style=\"text-align:center;color:#ff0000\">"._PERC."<br><b>"._ORE." $ore,$minuti "._DEL."  $giorno/$mese/$anno</b></div>";
     46                        else
     47                                echo "<div style=\"text-align:center;color:#ff0000\">"._PERC_TEND."<br><b>"._ORE." $ore,$minuti "._DEL."  $giorno/$mese/$anno</b></div>";
    4048
    41                 $sql="select t3.id_sez from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos  group by t3.id_sez ";
    42         $res1 = $dbi->prepare("$sql");
    43         $res1->execute();
    44 
    45                 $numero=$res1->rowCount();
    46        
    47                 echo "<h5>Ultime Affluenze</h5>";
    48                echo "<div style=\"text-align:center;color:#ff0000\">"._PERC_TEND."<br><b>"._ORE." $ore,$minuti "._DEL."  $giorno/$mese/$anno</b></div>";
    49                                                                                                                              
    50 
    51                
    52  
    5349#               $res1 = mysql_query("select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " , $dbi);
    5450#modifica del 26giugno 09 per gestione circoscrizionali
    55 if($genere==0)  {       $sql="select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " ;
    56         $res1 = $dbi->prepare("$sql");
    57         $res1->execute();
     51                        if($genere==0) 
     52                        {       
     53                                $sql="select sum(t1.voti_complessivi), t2.num_gruppo , t2.id_gruppo from ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2 on (t1.id_gruppo=t2.id_gruppo) where t1.id_cons='$id_cons' and t1.orario='$orario' and t1.data='$data' group by t2.num_gruppo,t2.id_gruppo order by t2.num_gruppo " ;
     54                                $res1 = $dbi->prepare("$sql");
     55                                $res1->execute();
    5856
    59                 }else{
    60                 $sql="select sum(t3.voti_complessivi),0,0  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";
    61         $res1 = $dbi->prepare("$sql");
    62         $res1->execute();
    63                 }
     57                        }else{
     58                                $sql="select sum(t3.voti_complessivi),0,0  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";
     59                                $res1 = $dbi->prepare("$sql");
     60                                $res1->execute();
     61                        }
    6462#fine modifica
    65                                                                                                                                      
    66                
    67                
    68                
    69                                                                                                                              
    70                 while(list($voti_t, $num_gruppo,$id_gruppo) = $res1->fetch(PDO::FETCH_NUM)) {
     63                                                                                                                           
     64            while(list($voti_t, $num_gruppo,$id_gruppo) = $res1->fetch(PDO::FETCH_NUM)) {
    7165
    72                         $sql="select sum(t3.voti_complessivi)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";         
    73                         if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";}
    74                         $res_aff = $dbi->prepare("$sql");
    75                         $res_aff->execute();
     66                                $sql="select sum(t3.voti_complessivi)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";         
     67                                                if ($genere==0){$query.=" and t3.id_gruppo=$id_gruppo";}
     68                                $res_aff = $dbi->prepare("$sql");
     69                                $res_aff->execute();
    7670
    77                         $voti_numero=$res_aff->rowCount();
    78                
    79                         $sql="select sum(t1.maschi+t1.femmine)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";         
    80                        
    81                         if ($genere==0){$query.=" and id_gruppo=$id_gruppo";}
    82         $res1234 = $dbi->prepare("$sql");
    83         $res1234->execute();
     71                                $voti_numero=$res_aff->rowCount();
     72                                       
     73                                $sql="select sum(t1.maschi+t1.femmine)  from ".$prefix."_ele_voti_parziale as t3 left join ".$prefix."_ele_sezioni as t1 on t3.id_sez=t1.id_sez left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t3.id_cons='$id_cons' and t3.data='$data' and t3.orario='$orario' $circos";         
     74                               
     75                                if ($genere==0){$query.=" and id_gruppo=$id_gruppo";}
     76                                $res1234 = $dbi->prepare("$sql");
     77                                $res1234->execute();
    8478
    85                         list($tot)=$res1234->fetch(PDO::FETCH_NUM);
    86                         if ($tot)
    87                             $perc=number_format($voti_t*100/$tot,2);
    88                         else {$tot=0;$perc="0.00";}
    89          
    90                         $resto=100-$perc;
    91                         if ($genere==0){echo "<div style=\"text-align:center\">referendum n. $num_gruppo</div";}
     79                                list($tot)=$res1234->fetch(PDO::FETCH_NUM);
     80                                if ($tot) $perc=number_format($voti_t*100/$tot,2);
     81                                else {$tot=0;$perc="0.00";}
     82                 
     83                                $resto=100-$perc;
     84                                if ($genere==0){echo "<div style=\"text-align:center\">referendum n. $num_gruppo</div";}
    9285
    93                         echo "<center><img src=\"http://chart.apis.google.com/chart?
    94                         chs=200x70
    95                         &chd=t:$resto,$perc
    96                         &cht=p3
    97                         &chl=|$perc%
    98                         &chco=ff0000,ffff00 \"
    99                         alt=\"Sample chart\" />
    100                         <a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=affluenze_graf\">Tutte le affluenze</a>
    101                         </center>";
     86                                echo "<center><img src=\"http://chart.apis.google.com/chart?
     87                                chs=200x70
     88                                &chd=t:$resto,$perc
     89                                &cht=p3
     90                                &chl=|$perc%
     91                                &chco=ff0000,ffff00 \"
     92                                alt=\"Sample chart\" />
     93                                <a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&file=index&op=affluenze_graf\">Tutte le affluenze</a>
     94                                </center>";
    10295
    10396
    10497
    105         }       
     98                        }       
    10699
    107         }
    108 }
     100                }
     101        }
    109102?>
  • trunk/client/modules/Elezioni/consiglieri.php

    r393 r394  
    9696                $res_lis = $dbi->prepare("$sql");
    9797                $res_lis->execute();
    98                 if($res_lis->rowCount()==1)
     98                if($res_lis->rowCount()==1 or $inffisso)
    9999                {
    100100                        list($num_gruppo1,$voti1)= $res_lis->fetch(PDO::FETCH_NUM);
     
    110110                        if($votanti<($elettori/2) || $voti1<($votanti/2))
    111111                        {
    112                                 include(ele.php);
    113                                 echo "<div>Non Ú possibile assegnare i seggi, la consultazione Ú nulla</div>";
    114                                 include(footer.php);
     112                                echo "<div style=\"text-align:center;\"><br><br>Il numero di votanti Ú inferiore al 50%, non Ú possibile assegnare i seggi. <br>La consultazione Ú nulla</div>";
     113                                include("footer.php");
    115114                                die();
    116                         }
     115                        } 
    117116                }else{
    118117                        list($num_gruppo1,$voti1)= $res_lis->fetch(PDO::FETCH_NUM);
     
    121120                if ($voti1>$voti2)
    122121                        $numgruppo=$num_gruppo1;
     122                else
     123                        $numgruppo=$num_gruppo2;
    123124        }
    124125        if ($fascia<=$limite and $numgruppo) {
     
    127128                else
    128129                        consmin($fascia,$numgruppo);
    129         }elseif ($gruppo>0) conssup($fascia,$gruppo,$collegate,$collperd,$primoturno);
     130        }
     131        elseif ($gruppo>0) conssup($fascia,$gruppo,$collegate,$collperd,$primoturno);
    130132        elseif ($numgruppo>0){
    131133                $sqllis = "SELECT t1.id_lista,t1.num_lista,t1.descrizione,t1.id_gruppo from ".$prefix."_ele_lista as t1, ".$prefix."_ele_gruppo as t2 where t1.id_cons='$id_cons' and t1.id_gruppo=t2.id_gruppo and t2.num_gruppo not in (".$_SESSION['ballo1'].",".$_SESSION['ballo2'].")";
     
    186188                echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"/>";
    187189                $sql = "SELECT t1.id_gruppo,t1.num_gruppo,t1.descrizione, sum(t2.voti) as pref FROM ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_gruppo as t2 where t1.id_gruppo=t2.id_gruppo and t1.id_cons='$id_cons' group by t1.id_gruppo,t1.num_gruppo,t1.descrizione order by pref desc limit 0,2";
    188 $res = $dbi->prepare("$sql");
    189 $res->execute();
     190                $res = $dbi->prepare("$sql");
     191                $res->execute();
    190192
    191193                while(list($id_gruppo,$num_gruppo, $descr_gruppo,$pref) = $res->fetch(PDO::FETCH_NUM)) {
     
    214216if (isset($votol)) {$votolista=$votol; $fisso=$votol;} #se votolista=1 c'e' voto di lista
    215217if (!isset($sincons)) $sincons=0; #se sincons=1 il sindaco eletto occupa un posto di consigliere
    216 $sql="SELECT t1.num_gruppo,sum(t2.voti) as voti from ".$prefix."_ele_gruppo as t1,  ".$prefix."_ele_voti_gruppo as t2 where t1.id_cons='$id_cons' and t1.id_gruppo=t2.id_gruppo group by t1.num_gruppo order by voti desc limit 0,2";
     218####################### DA TOGLIERE
     219$sql="SELECT t1.num_gruppo,sum(t2.voti) as voti from ".$prefix."_ele_gruppo as t1,  ".$prefix."_ele_voti_gruppo as t2 where t1.id_cons='$id_cons' and t1.id_gruppo=t2.id_gruppo group by t1.num_gruppo order by voti desc";
     220#$sql="SELECT t1.num_gruppo,sum(t2.voti) as voti from ".$prefix."_ele_gruppo as t1,  ".$prefix."_ele_voti_gruppo as t2 where t1.id_cons='$id_cons' and t1.id_gruppo=t2.id_gruppo group by t1.num_gruppo order by voti desc limit 0,2";
    217221$res = $dbi->prepare("$sql");
    218222$res->execute();
    219223$numgruppi=$res->rowCount();
     224#######################
     225
     226
    220227$sql = "SELECT sum(validi_lista+contestati_lista) from ".$prefix."_ele_sezioni where id_cons='$id_cons'";
    221228$res = $dbi->prepare("$sql");
     
    240247 ################
    241248        #seleziona il sindaco (gruppo con più voti) e lista collegata
    242         $sql = "SELECT t1.descrizione,t1.num_gruppo,sum(t3.voti) as voti from ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_gruppo as t3 where t1.id_cons='$id_cons' and t1.id_gruppo=t3.id_gruppo group by t1.descrizione, t1.num_gruppo order by voti desc limit 0,2";
     249#       $sql = "SELECT t1.descrizione,t1.num_gruppo,sum(t3.voti) as voti from ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_gruppo as t3 where t1.id_cons='$id_cons' and t1.id_gruppo=t3.id_gruppo group by t1.descrizione, t1.num_gruppo order by voti desc limit 0,2";
     250        $sql = "SELECT t1.descrizione,t1.num_gruppo,sum(t3.voti) as voti from ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_gruppo as t3 where t1.id_cons='$id_cons' and t1.id_gruppo=t3.id_gruppo group by t1.descrizione, t1.num_gruppo order by voti desc";
    243251        $res_per = $dbi->prepare("$sql");
    244252        $res_per->execute();
    245253        $votig=0;
    246         $gruppo=array();
    247254        $conselcsne=array();
     255        $desgruppi=array();
     256        $arlismag=array();
     257        $arlismin=array();
    248258        $lisvin=0;
    249259        $gruvin=0;
     260        $grumin=0;
     261        $votigrumin=0;
     262        #Il controllo va spostato nella funzione consiglio() -- riferimento riga 124
    250263        while(list($descr,$num_gruppo,$voti)= $res_per->fetch(PDO::FETCH_NUM))
    251264        {
    252                 $sql = "SELECT t2.id_lista,t2.num_lista,t2.descrizione,sum(t3.voti) from ".$prefix."_ele_lista as t2, ".$prefix."_ele_voti_lista as t3 where t2.id_cons='$id_cons' and t2.id_lista=t3.id_lista and t2.num_gruppo=$num_gruppo group by t2.id_lista,t2.num_lista,t2.descrizione order by voti desc limit 0,1";
     265#               $sql = "SELECT t2.id_lista,t2.num_lista,t2.descrizione,sum(t3.voti) from ".$prefix."_ele_lista as t2, ".$prefix."_ele_voti_lista as t3 where t2.id_cons='$id_cons' and t2.id_lista=t3.id_lista and t2.num_gruppo=$num_gruppo group by t2.id_lista,t2.num_lista,t2.descrizione order by voti desc limit 0,1";
     266                $desgruppi[$num_gruppo]=$descr;
     267                if($voti>=($votig-1)) # and (!$grp or $grp==$num_gruppo)
     268                {
     269                        if($grp and $grp!=$num_gruppo)
     270                        { #confronta i voti delle liste collegate ai candidati con stesso numero di voti e assegna il seggio a quello le cui liste hanno più voti
     271                                $sql = "SELECT t2.num_gruppo,sum(t3.voti) from ".$prefix."_ele_lista as t2, ".$prefix."_ele_voti_lista as t3 where t2.id_cons='$id_cons' and t2.id_lista=t3.id_lista and (t2.num_gruppo=$num_gruppo or t2.num_gruppo=$grp) group by t2.num_gruppo order by voti desc";
     272                                $res_lis = $dbi->prepare("$sql");
     273                                $res_lis->execute();
     274                                $votillrif=0;
     275                                while(list($num_grp,$votill)= $res_lis->fetch(PDO::FETCH_NUM))
     276                                {
     277                                        if($votill>$votillrif)
     278                                        {
     279                                                $gruvin=$num_grp;
     280                                                $votig=$voti+1;
     281                                                $votillrif=$votill;
     282                                                $grp=$num_grp;
     283                                        }       
     284                                        if($grp!=$num_grp)
     285                                        {
     286                                                $sindel=1;
     287                                                $votigrumin=$voti;
     288                                                $conselcsne[0]=array("$CSEC","","",$desgruppi[$num_grp],"","");
     289                                                $grumin=$num_grp;
     290                                        }
     291
     292                                }
     293                        }else{
     294                                $gruvin=$num_gruppo;
     295                                $votig=$voti;
     296                                if ($grp)
     297                                        $votig++;
     298                                $votigrumin=$voti;
     299                        }
     300                }
     301                elseif($votigrumin and $voti==$votigrumin)
     302                { #confronta i voti delle liste collegate ai candidati con stesso numero di voti e assegna il seggio a quello le cui liste hanno più voti
     303                        $sql = "SELECT t2.num_gruppo,sum(t3.voti) from ".$prefix."_ele_lista as t2, ".$prefix."_ele_voti_lista as t3 where t2.id_cons='$id_cons' and t2.id_lista=t3.id_lista group by t2.num_gruppo order by voti desc";
     304                        $res_lis = $dbi->prepare("$sql");
     305                        $res_lis->execute();
     306                        $votillrif=0;
     307                        while(list($num_grpmin,$votill)= $res_lis->fetch(PDO::FETCH_NUM))
     308                                if($voti>=$validi/5 and $votill>$votillrif) {$sindel=1; $votigrumin=$voti; $conselcsne[0]=array("$CSEC","","",$descr,"",""); $grumin=$num_gruppo;}
     309                }else{
     310                        if($voti>=$validi/5 and !$sindel) {$sindel=1; $conselcsne[0]=array("$CSEC","","",$descr,"",""); }                       
     311                        $votigrumin=$voti;
     312                        $grumin=$num_gruppo;
     313                }
     314                if(!isset($conselcsne[0][0])) $conselcsne[0]=array("<br><b>Consiglieri di minoranza</b>","","","","","");
     315#######
     316
     317        }
     318#####
     319        $sql = "SELECT t1.descrizione,t1.num_gruppo,sum(t3.voti) as voti from ".$prefix."_ele_gruppo as t1, ".$prefix."_ele_voti_gruppo as t3 where t1.id_cons='$id_cons' and t1.id_gruppo=t3.id_gruppo and t1.num_gruppo=$grp or t1.num_gruppo=$grumin group by t1.descrizione, t1.num_gruppo order by voti desc";
     320        $res_per = $dbi->prepare("$sql");
     321        $res_per->execute();
     322        while(list($descr,$num_gruppo,$voti)= $res_per->fetch(PDO::FETCH_NUM))
     323        {
     324                $sql = "SELECT t2.id_lista,t2.num_lista,t2.descrizione,sum(t3.voti) from ".$prefix."_ele_lista as t2, ".$prefix."_ele_voti_lista as t3 where t2.id_cons='$id_cons' and t2.id_lista=t3.id_lista and t2.num_gruppo=$num_gruppo group by t2.id_lista,t2.num_lista,t2.descrizione order by voti desc";
    253325                $res_lis = $dbi->prepare("$sql");
    254326                $res_lis->execute();
    255                 list($id_lista1,$num_lista,$descr_lista,$votil)= $res_lis->fetch(PDO::FETCH_NUM);
    256                
    257                 $desgruppi[$num_gruppo]=$descr;
    258                 $listagruppo[$num_lista]=$num_gruppo;
    259                 if($voti>=$votig and (!$grp or $grp==$num_gruppo))
     327                while(list($id_lista1,$num_lista,$descr_lista,$votil)= $res_lis->fetch(PDO::FETCH_NUM))
    260328                {
    261                         if(!$lisvin ) {$lisvin=$num_lista; $gruvin=$num_gruppo;}
    262                         $votig=$voti;
    263                         if ($grp)
    264                                 $votig++;
    265                         $gruppo[$num_gruppo]=array($descr,$num_gruppo,$id_lista1,$num_lista,$descr_lista,$voti);
    266                 }else{
    267                         if($voti>=$validi/5) {$sindel=1;$conselcsne[]=array("$CSEC","","",$descr,"","");}
    268                 }
    269         }
     329                        $listagruppo[$num_lista]=$num_gruppo;
     330                        if($grp==$num_gruppo)
     331                        {
     332                                $arlismag[$num_gruppo][]=$num_lista;
     333                                if(!$lisvin ) {$lisvin=$num_lista; }
     334                        }else{
     335                                $arlismin[$num_gruppo][]=$num_lista;
     336                        }
     337                }
     338        }
     339#####   
    270340        #seleziona la lista (o liste) con più voti
    271         $sql = "SELECT t1.descrizione, t2.id_lista,t2.num_lista, t1.num_gruppo, sum(t2.voti) as voti from ".$prefix."_ele_voti_lista as t2 left join ".$prefix."_ele_lista as t1 on t1.id_lista=t2.id_lista where t2.id_cons='$id_cons' group by t2.id_lista,t2.num_lista,t1.num_gruppo, t1.descrizione order by voti desc";
     341        $sql = "SELECT t1.descrizione, t2.id_lista,t2.num_lista, t1.num_gruppo, sum(t2.voti) as voti from ".$prefix."_ele_voti_lista as t2 left join ".$prefix."_ele_lista as t1 on t1.id_lista=t2.id_lista where t2.id_cons='$id_cons' and (t1.num_gruppo=$grp or t1.num_gruppo=$grumin) group by t2.id_lista,t2.num_lista,t1.num_gruppo, t1.descrizione order by voti desc";
    272342        $res_per = $dbi->prepare("$sql");
    273343        $res_per->execute();
     
    346416                        else $consel[]=array($desliste[$lista],$lists[$lista],$val,$arvin[$lista][($z)],$cifra[$lista][($z)],number_format($quozienti[$lista]/($z+1),2,',','.'));
    347417                }
    348         }
     418        } 
    349419    if($arvin[$lista][($z)]) $consel[]=array($desliste[$lista],"$PNE","",$arvin[$lista][($z)],$cifra[$lista][($z)],number_format($quozienti[$lista]/($z+1),2,',','.'));
    350420        $assegnato=0;
  • trunk/client/modules/Elezioni/index.php

    r384 r394  
    151151        $siteistat=$id_comune;
    152152        if($simbolo!=''){
    153         echo "<img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"logo\" />";
     153        echo "<img style=\"width: 150px; height: auto;\" src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"logo\" />";
    154154        }else{
    155155        echo "<img src=\"modules/Elezioni/images/logo.gif\" alt=\"logo\" height=\"100\" />";
     
    642642                $sql="SELECT COUNT(0) FROM ".$prefix."_ele_voti_ref WHERE id_cons ='$id_cons' group by id_sez";
    643643        else
    644                 $sql="SELECT COUNT(0) FROM ".$prefix."_ele_sezioni WHERE validi <>'0' AND id_cons ='$id_cons' group by id_sez";
     644                $sql="SELECT COUNT(0) FROM ".$prefix."_ele_voti_lista WHERE id_cons ='$id_cons' group by id_sez";               
    645645        $resn = $dbi->prepare("$sql");
    646646        $resn->execute();
  • trunk/client/versione.php

    r393 r394  
    11<?php
    22
    3 $versione = "3.0 rev 393";
     3$versione = "3.0 rev 394";
    44$version_number = $versione;
    5 $datarel = "05 marzo 2023";
     5$datarel = "21 maggio 2023";
    66$version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
    77
  • trunk/install/sql/eleonline.sql

    r362 r394  
    1 -- phpMyAdmin SQL Dump
    2 -- version 5.1.0
    3 -- https://www.phpmyadmin.net/
    4 --
    5 -- Host: localhost
    6 -- Creato il: Mar 11, 2022 alle 17:08
    7 -- Versione del server: 10.3.27-MariaDB-0+deb10u1
    8 -- Versione PHP: 7.3.31-1~deb10u1
    9 
    101SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
    112START TRANSACTION;
    123SET time_zone = "+00:00";
    13 
    144
    155/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
     
    188/*!40101 SET NAMES utf8mb4 */;
    199
    20 --
    21 -- Database: `eleonline3`
    22 --
    23 
    24 -- --------------------------------------------------------
    25 
    26 --
    27 -- Struttura della tabella `soraldo_access`
    28 --
     10CREATE DATABASE IF NOT EXISTS `eleonline` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
     11USE `eleonline`;
    2912
    3013CREATE TABLE `soraldo_access` (
    3114  `access_id` int(10) NOT NULL,
    3215  `access_title` varchar(20) DEFAULT NULL
    33 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    34 
    35 --
    36 -- Dump dei dati per la tabella `soraldo_access`
    37 --
     16) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    3817
    3918INSERT INTO `soraldo_access` (`access_id`, `access_title`) VALUES
     
    4322(64, 'Amministratore Unico'),
    4423(256, 'Superuser');
    45 
    46 -- --------------------------------------------------------
    47 
    48 --
    49 -- Struttura della tabella `soraldo_authors`
    50 --
    5124
    5225CREATE TABLE `soraldo_authors` (
     
    6134  `adminsuper` tinyint(2) NOT NULL DEFAULT 0,
    6235  `admlanguage` varchar(30) NOT NULL DEFAULT ''
    63 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    64 
    65 --
    66 -- Dump dei dati per la tabella `soraldo_authors`
    67 --
     36) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    6837
    6938INSERT INTO `soraldo_authors` (`aid`, `name`, `id_comune`, `email`, `pwd`, `counter`, `adminop`, `admincomune`, `adminsuper`, `admlanguage`) VALUES
    70 ('suser', 'suser', 0, 'test@', '098f6bcd4621d373cade4e832627b4f6', 1, 0, 0, 1, 'it');
    71 
    72 -- --------------------------------------------------------
    73 
    74 --
    75 -- Struttura della tabella `soraldo_config`
    76 --
     39('suser', 'suser', 0, 'test@eleonline.it', '098f6bcd4621d373cade4e832627b4f6', 1, 0, 0, 1, 'it');
    7740
    7841CREATE TABLE `soraldo_config` (
     
    10265  `tema_on` enum('0','1') NOT NULL DEFAULT '1',
    10366  `ed_user` varchar(25) NOT NULL DEFAULT ''
    104 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    105 
    106 --
    107 -- Dump dei dati per la tabella `soraldo_config`
    108 --
    109 
    110 INSERT INTO `soraldo_config` (`sitename`, `siteurl`, `site_logo`, `slogan`, `startdate`, `adminmail`, `tema`, `foot`, `language`, `blocco`, `testata`, `nome_testata`, `fileout`, `copyright`, `Versione`, `patch`, `siteistat`, `multicomune`, `flash`, `displayerrors`, `gkey`, `googlemaps`, `editor`, `tema_on`, `ed_user`) VALUES
    111 ('', 'https://www.eleonline.it', '', 'Sito istituzionale', 'Maggio 2022', 'admin@localhost', 'facebook', '<b>Comune di Test</b><br>\r\nvia  - \r\nTel:  Fax: \r\n<hr>', 'it', '1', '', '', '', 'Gpl v3', 2, 0, 84023, '1', '0', '0', '', '0', '1', '1', 'Admin');
    112 
    113 -- --------------------------------------------------------
    114 
    115 --
    116 -- Struttura della tabella `soraldo_doc_cons`
    117 --
     67) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
     68
     69INSERT INTO `soraldo_config` (`sitename`, `siteurl`, `site_logo`, `slogan`, `startdate`, `adminmail`, `tema`, `foot`, `language`, `blocco`, `testata`, `nome_testata`, `fileout`, `copyright`, `versione`, `patch`, `siteistat`, `multicomune`, `flash`, `displayerrors`, `gkey`, `googlemaps`, `editor`, `tema_on`, `ed_user`) VALUES
     70('Elezioni On Line', 'http://localhost/ele3/trunk/client', '', 'Sito istituzionale', 'March 2023', 'test@eleonline.it', 'default', '', 'it', '1', '', '', '', 'Gpl v3', 3, 0, 58047, '0', '0', '0', '', '0', '1', '1', 'Admin');
    11871
    11972CREATE TABLE `soraldo_doc_cons` (
     
    12174  `id_doc` int(11) NOT NULL DEFAULT 0,
    12275  `tabella` varchar(25) NOT NULL DEFAULT ''
    123 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    124 
    125 -- --------------------------------------------------------
    126 
    127 --
    128 -- Struttura della tabella `soraldo_ele_candidati`
    129 --
     76) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    13077
    13178CREATE TABLE `soraldo_ele_candidati` (
     
    13986  `simbolo` varchar(30) NOT NULL DEFAULT '',
    14087  `num_cand` int(7) NOT NULL DEFAULT 0
    141 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    142 
    143 -- --------------------------------------------------------
    144 
    145 --
    146 -- Struttura della tabella `soraldo_ele_circoscrizione`
    147 --
     88) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    14889
    14990CREATE TABLE `soraldo_ele_circoscrizione` (
     
    15293  `num_circ` int(7) NOT NULL DEFAULT 0,
    15394  `descrizione` mediumtext DEFAULT NULL
    154 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    155 
    156 -- --------------------------------------------------------
    157 
    158 --
    159 -- Struttura della tabella `soraldo_ele_collegi`
    160 --
     95) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    16196
    16297CREATE TABLE `soraldo_ele_collegi` (
     
    16499  `id_cons_gen` int(11) NOT NULL DEFAULT 0,
    165100  `descrizione` mediumtext DEFAULT NULL
    166 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    167 
    168 -- --------------------------------------------------------
    169 
    170 --
    171 -- Struttura della tabella `soraldo_ele_come`
    172 --
     101) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    173102
    174103CREATE TABLE `soraldo_ele_come` (
    175104  `id_cons` int(11) NOT NULL DEFAULT 0,
    176105  `mid` int(7) NOT NULL,
    177   `title` varchar(150) NOT NULL DEFAULT '',
    178   `preamble` mediumtext NOT NULL,
    179   `content` mediumtext NOT NULL,
    180   `editimage` varchar(100) NOT NULL DEFAULT ''
    181 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    182 
    183 -- --------------------------------------------------------
    184 
    185 --
    186 -- Struttura della tabella `soraldo_ele_comuni`
    187 --
     106  `title` varchar(150) NOT NULL DEFAULT ' ',
     107  `preamble` text DEFAULT NULL,
     108  `content` text DEFAULT NULL,
     109  `editimage` varchar(100) NOT NULL DEFAULT ' '
     110) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    188111
    189112CREATE TABLE `soraldo_ele_comuni` (
     
    200123  `id_cons` int(11) DEFAULT 0,
    201124  `cap` mediumtext DEFAULT NULL
    202 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    203 
    204 -- --------------------------------------------------------
    205 
    206 --
    207 -- Struttura della tabella `soraldo_ele_comu_collegi`
    208 --
     125) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
     126
     127INSERT INTO `soraldo_ele_comuni` (`id_comune`, `descrizione`, `indirizzo`, `centralino`, `fax`, `email`, `fascia`, `capoluogo`, `simbolo`, `stemma`, `id_cons`, `cap`) VALUES
     128(58047, 'Guidonia', '', '', '', '', 5, '0', '', '', 0, '');
    209129
    210130CREATE TABLE `soraldo_ele_comu_collegi` (
     
    213133  `id_comune` int(11) NOT NULL DEFAULT 0,
    214134  `id_cons_gen` int(11) NOT NULL DEFAULT 0
    215 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    216 
    217 -- --------------------------------------------------------
    218 
    219 --
    220 -- Struttura della tabella `soraldo_ele_conf`
    221 --
     135) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    222136
    223137CREATE TABLE `soraldo_ele_conf` (
     
    240154  `supfisso` enum('0','1') NOT NULL DEFAULT '0',
    241155  `fascia_capoluogo` int(2) NOT NULL DEFAULT 0
    242 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    243 
    244 --
    245 -- Dump dei dati per la tabella `soraldo_ele_conf`
    246 --
     156) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    247157
    248158INSERT INTO `soraldo_ele_conf` (`id_conf`, `descrizione`, `limite`, `consin`, `infpremio`, `supsbarramento`, `suppremio`, `listinfsbar`, `listinfconta`, `listsupconta`, `supminpremio`, `infminpremio`, `infdisgiunto`, `supdisgiunto`, `votolista`, `inffisso`, `supfisso`, `fascia_capoluogo`) VALUES
     
    250160(2, 'Regione Sicilia precedente al 2008', 2, '0', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6),
    251161(3, 'Regione Sicilia Legge n. 22 del 16/12/2008', 2, '0', 67, 5, 60, 3, '1', '0', 40, 40, '0', '0', '0', '0', '0', 7),
    252 (4, 'Regione Sicilia Legge n.6/2011', 5, '1', 67, 5, 60, 5, '1', '1', 40, 40, '1', '1', '0', '0', '0', 7),
     162(4, 'Regione Sicilia Legge n.6/2011', 5, '1', 67, 5, 60, 5, '1', '1', 40, 40, '1', '1', '0', '1', '0', 7),
    253163(5, 'Legge Italiana 267/2000 con riduzione 2011', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
    254164(6, 'Legge Italiana 267/2000 con riduzione 2012', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
    255165(7, 'Legge Italiana 267/2000 con modifiche 2014', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6);
    256 
    257 -- --------------------------------------------------------
    258 
    259 --
    260 -- Struttura della tabella `soraldo_ele_consultazione`
    261 --
    262166
    263167CREATE TABLE `soraldo_ele_consultazione` (
     
    267171  `data_fine` date DEFAULT NULL,
    268172  `tipo_cons` int(7) NOT NULL DEFAULT 0
    269 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    270 
    271 -- --------------------------------------------------------
    272 
    273 --
    274 -- Struttura della tabella `soraldo_ele_cons_comune`
    275 --
     173) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    276174
    277175CREATE TABLE `soraldo_ele_cons_comune` (
     
    287185  `solo_gruppo` enum('0','1') DEFAULT '0',
    288186  `disgiunto` enum('0','1') NOT NULL DEFAULT '0'
    289 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    290 
    291 -- --------------------------------------------------------
    292 
    293 --
    294 -- Struttura della tabella `soraldo_ele_controlli`
    295 --
     187) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    296188
    297189CREATE TABLE `soraldo_ele_controlli` (
     
    300192  `tipo` varchar(10) NOT NULL,
    301193  `id` int(11) NOT NULL
    302 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    303 
    304 -- --------------------------------------------------------
    305 
    306 --
    307 -- Struttura della tabella `soraldo_ele_documenti`
    308 --
     194) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    309195
    310196CREATE TABLE `soraldo_ele_documenti` (
     
    313199  `nomedoc` varchar(25) NOT NULL DEFAULT '',
    314200  `filedoc` blob NOT NULL
    315 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    316 
    317 -- --------------------------------------------------------
    318 
    319 --
    320 -- Struttura della tabella `soraldo_ele_fasce`
    321 --
     201) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    322202
    323203CREATE TABLE `soraldo_ele_fasce` (
     
    326206  `seggi` int(4) NOT NULL,
    327207  `id_conf` int(11) DEFAULT 1
    328 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    329 
    330 --
    331 -- Dump dei dati per la tabella `soraldo_ele_fasce`
    332 --
     208) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    333209
    334210INSERT INTO `soraldo_ele_fasce` (`id_fascia`, `abitanti`, `seggi`, `id_conf`) VALUES
     
    401277(9, 100000000, 48, 7);
    402278
    403 -- --------------------------------------------------------
    404 
    405 --
    406 -- Struttura della tabella `soraldo_ele_gruppo`
    407 --
    408 
    409279CREATE TABLE `soraldo_ele_gruppo` (
    410280  `id_cons` int(11) NOT NULL DEFAULT 0,
     
    418288  `prognome` mediumtext DEFAULT NULL,
    419289  `programma` mediumblob DEFAULT NULL
    420 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    421 
    422 -- --------------------------------------------------------
    423 
    424 --
    425 -- Struttura della tabella `soraldo_ele_link`
    426 --
     290) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    427291
    428292CREATE TABLE `soraldo_ele_link` (
    429293  `id_cons` int(11) NOT NULL DEFAULT 0,
    430294  `mid` int(7) NOT NULL,
    431   `title` varchar(150) NOT NULL DEFAULT '',
    432   `preamble` mediumtext NOT NULL,
    433   `content` mediumtext NOT NULL,
    434   `editimage` varchar(100) NOT NULL DEFAULT ''
    435 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    436 
    437 -- --------------------------------------------------------
    438 
    439 --
    440 -- Struttura della tabella `soraldo_ele_lista`
    441 --
     295  `title` varchar(150) NOT NULL DEFAULT ' ',
     296  `preamble` text DEFAULT NULL,
     297  `content` text DEFAULT NULL,
     298  `editimage` varchar(100) NOT NULL DEFAULT ' '
     299) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    442300
    443301CREATE TABLE `soraldo_ele_lista` (
     
    452310  `simbolo` mediumtext DEFAULT NULL,
    453311  `stemma` blob DEFAULT NULL
    454 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    455 
    456 -- --------------------------------------------------------
    457 
    458 --
    459 -- Struttura della tabella `soraldo_ele_log`
    460 --
     312) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    461313
    462314CREATE TABLE `soraldo_ele_log` (
     
    469321  `log_a` mediumtext DEFAULT NULL,
    470322  `tabella` varchar(30) DEFAULT NULL
    471 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    472 
    473 -- --------------------------------------------------------
    474 
    475 --
    476 -- Struttura della tabella `soraldo_ele_modelli`
    477 --
     323) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    478324
    479325CREATE TABLE `soraldo_ele_modelli` (
     
    481327  `categoria` varchar(20) NOT NULL DEFAULT '',
    482328  `modello` blob NOT NULL
    483 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    484 
    485 -- --------------------------------------------------------
    486 
    487 --
    488 -- Struttura della tabella `soraldo_ele_numeri`
    489 --
     329) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    490330
    491331CREATE TABLE `soraldo_ele_numeri` (
     
    496336  `content` mediumtext NOT NULL,
    497337  `editimage` varchar(100) NOT NULL DEFAULT ''
    498 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    499 
    500 -- --------------------------------------------------------
    501 
    502 --
    503 -- Struttura della tabella `soraldo_ele_operatori`
    504 --
     338) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    505339
    506340CREATE TABLE `soraldo_ele_operatori` (
     
    512346  `id_circ` int(11) NOT NULL DEFAULT 0,
    513347  `id_sez` int(11) NOT NULL DEFAULT 0
    514 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    515 
    516 -- --------------------------------------------------------
    517 
    518 --
    519 -- Struttura della tabella `soraldo_ele_province`
    520 --
     348) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    521349
    522350CREATE TABLE `soraldo_ele_province` (
    523351  `id` tinyint(11) NOT NULL DEFAULT 0,
    524352  `descrizione` varchar(30) NOT NULL DEFAULT ''
    525 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    526 
    527 -- --------------------------------------------------------
    528 
    529 --
    530 -- Struttura della tabella `soraldo_ele_regioni`
    531 --
     353) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    532354
    533355CREATE TABLE `soraldo_ele_regioni` (
    534356  `id` int(11) NOT NULL DEFAULT 0,
    535357  `descrizione` varchar(25) NOT NULL DEFAULT ''
    536 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    537 
    538 -- --------------------------------------------------------
    539 
    540 --
    541 -- Struttura della tabella `soraldo_ele_rilaff`
    542 --
     358) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    543359
    544360CREATE TABLE `soraldo_ele_rilaff` (
    545361  `id_cons_gen` int(11) NOT NULL DEFAULT 0,
    546362  `orario` time NOT NULL DEFAULT '00:00:00',
    547   `data` date NOT NULL DEFAULT '0000-00-00'
    548 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    549 
    550 -- --------------------------------------------------------
    551 
    552 --
    553 -- Struttura della tabella `soraldo_ele_sede`
    554 --
     363  `data` date NOT NULL DEFAULT '1900-01-01'
     364) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    555365
    556366CREATE TABLE `soraldo_ele_sede` (
     
    565375  `mappa` mediumblob NOT NULL,
    566376  `filemappa` varchar(100) NOT NULL DEFAULT ''
    567 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    568 
    569 -- --------------------------------------------------------
    570 
    571 --
    572 -- Struttura della tabella `soraldo_ele_servizi`
    573 --
     377) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    574378
    575379CREATE TABLE `soraldo_ele_servizi` (
    576380  `id_cons` int(11) NOT NULL DEFAULT 0,
    577381  `mid` int(7) NOT NULL,
    578   `title` varchar(150) NOT NULL DEFAULT '',
    579   `preamble` mediumtext NOT NULL,
    580   `content` mediumtext NOT NULL,
    581   `editimage` varchar(100) NOT NULL DEFAULT ''
    582 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    583 
    584 -- --------------------------------------------------------
    585 
    586 --
    587 -- Struttura della tabella `soraldo_ele_sezioni`
    588 --
     382  `title` varchar(150) NOT NULL DEFAULT ' ',
     383  `preamble` text DEFAULT NULL,
     384  `content` text DEFAULT NULL,
     385  `editimage` varchar(100) NOT NULL DEFAULT ' '
     386) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    589387
    590388CREATE TABLE `soraldo_ele_sezioni` (
     
    607405  `voti_nulli_lista` int(7) NOT NULL DEFAULT 0,
    608406  `solo_lista` int(7) NOT NULL DEFAULT 0,
    609   `colore` varchar(50) DEFAULT NULL
    610 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    611 
    612 -- --------------------------------------------------------
    613 
    614 --
    615 -- Struttura della tabella `soraldo_ele_temi`
    616 --
     407  `colore` varchar(50) DEFAULT '#FAFAD2'
     408) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    617409
    618410CREATE TABLE `soraldo_ele_temi` (
    619411  `id` int(11) NOT NULL,
    620412  `tema` varchar(20) NOT NULL DEFAULT ''
    621 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    622 
    623 -- --------------------------------------------------------
    624 
    625 --
    626 -- Struttura della tabella `soraldo_ele_tipo`
    627 --
     413) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    628414
    629415CREATE TABLE `soraldo_ele_tipo` (
     
    636422  `voto_c` enum('0','1') NOT NULL DEFAULT '0',
    637423  `circo` enum('0','1') NOT NULL DEFAULT '0'
    638 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    639 
    640 --
    641 -- Dump dei dati per la tabella `soraldo_ele_tipo`
    642 --
     424) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    643425
    644426INSERT INTO `soraldo_ele_tipo` (`tipo_cons`, `descrizione`, `lingua`, `genere`, `voto_g`, `voto_l`, `voto_c`, `circo`) VALUES
     
    663445(19, 'SENATO - Rosatellum 2.0', 'it', 5, '0', '0', '1', '0');
    664446
    665 -- --------------------------------------------------------
    666 
    667 --
    668 -- Struttura della tabella `soraldo_ele_voti_candidati`
    669 --
    670 
    671447CREATE TABLE `soraldo_ele_voti_candidati` (
    672448  `id_cons` int(11) NOT NULL DEFAULT 0,
     
    675451  `num_cand` int(2) UNSIGNED NOT NULL,
    676452  `voti` int(7) NOT NULL DEFAULT 0
    677 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    678 
    679 -- --------------------------------------------------------
    680 
    681 --
    682 -- Struttura della tabella `soraldo_ele_voti_gruppo`
    683 --
     453) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    684454
    685455CREATE TABLE `soraldo_ele_voti_gruppo` (
     
    690460  `voti` int(7) NOT NULL DEFAULT 0,
    691461  `solo_gruppo` int(7) NOT NULL DEFAULT 0
    692 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    693 
    694 -- --------------------------------------------------------
    695 
    696 --
    697 -- Struttura della tabella `soraldo_ele_voti_lista`
    698 --
     462) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    699463
    700464CREATE TABLE `soraldo_ele_voti_lista` (
     
    706470  `nulli_lista` int(7) NOT NULL DEFAULT 0,
    707471  `solo_lista` int(7) DEFAULT 0
    708 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    709 
    710 -- --------------------------------------------------------
    711 
    712 --
    713 -- Struttura della tabella `soraldo_ele_voti_parziale`
    714 --
     472) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    715473
    716474CREATE TABLE `soraldo_ele_voti_parziale` (
     
    719477  `id_parz` int(11) NOT NULL,
    720478  `orario` time NOT NULL DEFAULT '00:00:00',
    721   `data` date NOT NULL DEFAULT '0000-00-00',
     479  `data` date NOT NULL DEFAULT '1900-01-01',
    722480  `voti_uomini` int(7) NOT NULL DEFAULT 0,
    723481  `voti_donne` int(7) NOT NULL DEFAULT 0,
    724482  `voti_complessivi` int(7) NOT NULL DEFAULT 0,
    725483  `id_gruppo` int(11) NOT NULL DEFAULT 0
    726 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    727 
    728 -- --------------------------------------------------------
    729 
    730 --
    731 -- Struttura della tabella `soraldo_ele_voti_ref`
    732 --
     484) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    733485
    734486CREATE TABLE `soraldo_ele_voti_ref` (
     
    743495  `bianchi` int(7) DEFAULT 0,
    744496  `contestati` int(7) DEFAULT 0
    745 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    746 
    747 -- --------------------------------------------------------
    748 
    749 --
    750 -- Struttura della tabella `soraldo_ele_widget`
    751 --
     497) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    752498
    753499CREATE TABLE `soraldo_ele_widget` (
     
    758504  `pos_ver` int(3) NOT NULL DEFAULT 0,
    759505  `attivo` int(1) NOT NULL DEFAULT 0
    760 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    761 
    762 --
    763 -- Dump dei dati per la tabella `soraldo_ele_widget`
    764 --
     506) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
    765507
    766508INSERT INTO `soraldo_ele_widget` (`id`, `nome_file`, `titolo`, `pos_or`, `pos_ver`, `attivo`) VALUES
     
    780522(14, 'cookie_law.php', 'cookie_law.php', 1, 0, 0);
    781523
    782 --
    783 -- Indici per le tabelle scaricate
    784 --
    785 
    786 --
    787 -- Indici per le tabelle `soraldo_access`
    788 --
     524
    789525ALTER TABLE `soraldo_access`
    790526  ADD PRIMARY KEY (`access_id`);
    791527
    792 --
    793 -- Indici per le tabelle `soraldo_authors`
    794 --
    795528ALTER TABLE `soraldo_authors`
    796529  ADD PRIMARY KEY (`aid`,`id_comune`),
    797530  ADD KEY `aid` (`aid`);
    798531
    799 --
    800 -- Indici per le tabelle `soraldo_doc_cons`
    801 --
    802532ALTER TABLE `soraldo_doc_cons`
    803533  ADD KEY `id_cons` (`id_cons`,`id_doc`);
    804534
    805 --
    806 -- Indici per le tabelle `soraldo_ele_candidati`
    807 --
    808535ALTER TABLE `soraldo_ele_candidati`
    809536  ADD PRIMARY KEY (`id_cand`) USING BTREE,
     
    811538  ADD KEY `id_cons` (`id_cons`,`id_lista`) USING BTREE;
    812539
    813 --
    814 -- Indici per le tabelle `soraldo_ele_circoscrizione`
    815 --
    816540ALTER TABLE `soraldo_ele_circoscrizione`
    817541  ADD UNIQUE KEY `id_circ` (`id_circ`),
    818542  ADD UNIQUE KEY `id_cons` (`id_cons`,`num_circ`);
    819543
    820 --
    821 -- Indici per le tabelle `soraldo_ele_collegi`
    822 --
    823544ALTER TABLE `soraldo_ele_collegi`
    824545  ADD PRIMARY KEY (`id_collegio`),
    825546  ADD KEY `id_cons_gen` (`id_cons_gen`);
    826547
    827 --
    828 -- Indici per le tabelle `soraldo_ele_come`
    829 --
    830548ALTER TABLE `soraldo_ele_come`
    831549  ADD UNIQUE KEY `mid` (`mid`);
    832550
    833 --
    834 -- Indici per le tabelle `soraldo_ele_comuni`
    835 --
    836551ALTER TABLE `soraldo_ele_comuni`
    837552  ADD PRIMARY KEY (`id_comune`),
    838553  ADD KEY `access_id` (`descrizione`);
    839554
    840 --
    841 -- Indici per le tabelle `soraldo_ele_comu_collegi`
    842 --
    843555ALTER TABLE `soraldo_ele_comu_collegi`
    844556  ADD PRIMARY KEY (`id_cons_gen`,`id_comune`),
     
    846558  ADD KEY `id_collegio` (`id_collegio`);
    847559
    848 --
    849 -- Indici per le tabelle `soraldo_ele_conf`
    850 --
    851560ALTER TABLE `soraldo_ele_conf`
    852561  ADD PRIMARY KEY (`id_conf`);
    853562
    854 --
    855 -- Indici per le tabelle `soraldo_ele_consultazione`
    856 --
    857563ALTER TABLE `soraldo_ele_consultazione`
    858564  ADD PRIMARY KEY (`id_cons_gen`),
    859565  ADD UNIQUE KEY `descrizione` (`descrizione`(100));
    860566
    861 --
    862 -- Indici per le tabelle `soraldo_ele_cons_comune`
    863 --
    864567ALTER TABLE `soraldo_ele_cons_comune`
    865568  ADD PRIMARY KEY (`id_cons`),
    866569  ADD UNIQUE KEY `comune` (`id_comune`,`id_cons_gen`);
    867570
    868 --
    869 -- Indici per le tabelle `soraldo_ele_controlli`
    870 --
    871571ALTER TABLE `soraldo_ele_controlli`
    872572  ADD KEY `sezione` (`id_sez`);
    873573
    874 --
    875 -- Indici per le tabelle `soraldo_ele_documenti`
    876 --
    877574ALTER TABLE `soraldo_ele_documenti`
    878575  ADD PRIMARY KEY (`id_doc`),
    879576  ADD KEY `descrizione` (`descrizione`);
    880577
    881 --
    882 -- Indici per le tabelle `soraldo_ele_fasce`
    883 --
    884578ALTER TABLE `soraldo_ele_fasce`
    885579  ADD KEY `id_fascia` (`id_fascia`);
    886580
    887 --
    888 -- Indici per le tabelle `soraldo_ele_gruppo`
    889 --
    890581ALTER TABLE `soraldo_ele_gruppo`
    891582  ADD PRIMARY KEY (`id_gruppo`) USING BTREE,
    892583  ADD KEY `id_cons` (`id_cons`,`id_circ`) USING BTREE;
    893584
    894 --
    895 -- Indici per le tabelle `soraldo_ele_link`
    896 --
    897585ALTER TABLE `soraldo_ele_link`
    898586  ADD PRIMARY KEY (`mid`);
    899587
    900 --
    901 -- Indici per le tabelle `soraldo_ele_lista`
    902 --
    903588ALTER TABLE `soraldo_ele_lista`
    904589  ADD PRIMARY KEY (`id_lista`) USING BTREE,
     
    906591  ADD KEY `id_cons` (`id_cons`,`id_gruppo`) USING BTREE;
    907592
    908 --
    909 -- Indici per le tabelle `soraldo_ele_modelli`
    910 --
    911593ALTER TABLE `soraldo_ele_modelli`
    912594  ADD KEY `access_id` (`id_cons`);
    913595
    914 --
    915 -- Indici per le tabelle `soraldo_ele_numeri`
    916 --
    917596ALTER TABLE `soraldo_ele_numeri`
    918597  ADD PRIMARY KEY (`mid`),
    919598  ADD KEY `id_cons` (`id_cons`);
    920599
    921 --
    922 -- Indici per le tabelle `soraldo_ele_operatori`
    923 --
    924600ALTER TABLE `soraldo_ele_operatori`
    925601  ADD UNIQUE KEY `id_cons_aid` (`id_cons`,`aid`,`id_comune`),
     
    927603  ADD KEY `id_sede` (`id_sede`);
    928604
    929 --
    930 -- Indici per le tabelle `soraldo_ele_regioni`
    931 --
    932605ALTER TABLE `soraldo_ele_regioni`
    933606  ADD PRIMARY KEY (`id`),
    934607  ADD KEY `descrizione` (`descrizione`);
    935608
    936 --
    937 -- Indici per le tabelle `soraldo_ele_rilaff`
    938 --
    939609ALTER TABLE `soraldo_ele_rilaff`
    940610  ADD KEY `id_cons_gen` (`id_cons_gen`);
    941611
    942 --
    943 -- Indici per le tabelle `soraldo_ele_sede`
    944 --
    945612ALTER TABLE `soraldo_ele_sede`
    946613  ADD PRIMARY KEY (`id_sede`),
     
    948615  ADD KEY `id_circ` (`id_circ`);
    949616
    950 --
    951 -- Indici per le tabelle `soraldo_ele_servizi`
    952 --
    953617ALTER TABLE `soraldo_ele_servizi`
    954618  ADD PRIMARY KEY (`mid`),
    955619  ADD KEY `id_cons` (`id_cons`);
    956620
    957 --
    958 -- Indici per le tabelle `soraldo_ele_sezioni`
    959 --
    960621ALTER TABLE `soraldo_ele_sezioni`
    961622  ADD UNIQUE KEY `id_sezi` (`id_sez`),
    962   ADD KEY `id_cons` (`id_cons`),
     623  ADD UNIQUE KEY `id_cons` (`id_cons`,`num_sez`) USING BTREE,
    963624  ADD KEY `id_sede` (`id_sede`);
    964625
    965 --
    966 -- Indici per le tabelle `soraldo_ele_temi`
    967 --
    968626ALTER TABLE `soraldo_ele_temi`
    969627  ADD PRIMARY KEY (`id`);
    970628
    971 --
    972 -- Indici per le tabelle `soraldo_ele_tipo`
    973 --
    974629ALTER TABLE `soraldo_ele_tipo`
    975630  ADD PRIMARY KEY (`tipo_cons`);
    976631
    977 --
    978 -- Indici per le tabelle `soraldo_ele_voti_candidati`
    979 --
    980632ALTER TABLE `soraldo_ele_voti_candidati`
    981633  ADD KEY `id_sez` (`id_sez`),
     
    983635  ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_cand`) USING BTREE;
    984636
    985 --
    986 -- Indici per le tabelle `soraldo_ele_voti_gruppo`
    987 --
    988637ALTER TABLE `soraldo_ele_voti_gruppo`
    989638  ADD KEY `id_gruppo` (`id_gruppo`),
     
    991640  ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_gruppo`) USING BTREE;
    992641
    993 --
    994 -- Indici per le tabelle `soraldo_ele_voti_lista`
    995 --
    996642ALTER TABLE `soraldo_ele_voti_lista`
    997643  ADD KEY `id_lista` (`id_lista`),
     
    999645  ADD KEY `id_cons` (`id_cons`,`id_sez`,`id_lista`) USING BTREE;
    1000646
    1001 --
    1002 -- Indici per le tabelle `soraldo_ele_voti_parziale`
    1003 --
    1004647ALTER TABLE `soraldo_ele_voti_parziale`
    1005648  ADD PRIMARY KEY (`id_parz`),
     
    1008651  ADD KEY `id_gruppo` (`id_gruppo`);
    1009652
    1010 --
    1011 -- Indici per le tabelle `soraldo_ele_voti_ref`
    1012 --
    1013653ALTER TABLE `soraldo_ele_voti_ref`
    1014654  ADD KEY `id_gruppo` (`id_gruppo`),
     
    1016656  ADD KEY `id_cons` (`id_cons`,`id_gruppo`) USING BTREE;
    1017657
    1018 --
    1019 -- Indici per le tabelle `soraldo_ele_widget`
    1020 --
    1021658ALTER TABLE `soraldo_ele_widget`
    1022659  ADD PRIMARY KEY (`id`);
    1023660
    1024 --
    1025 -- AUTO_INCREMENT per le tabelle scaricate
    1026 --
    1027 
    1028 --
    1029 -- AUTO_INCREMENT per la tabella `soraldo_ele_candidati`
    1030 --
     661
    1031662ALTER TABLE `soraldo_ele_candidati`
    1032663  MODIFY `id_cand` int(11) NOT NULL AUTO_INCREMENT;
    1033664
    1034 --
    1035 -- AUTO_INCREMENT per la tabella `soraldo_ele_circoscrizione`
    1036 --
    1037665ALTER TABLE `soraldo_ele_circoscrizione`
    1038666  MODIFY `id_circ` int(11) NOT NULL AUTO_INCREMENT;
    1039667
    1040 --
    1041 -- AUTO_INCREMENT per la tabella `soraldo_ele_collegi`
    1042 --
    1043668ALTER TABLE `soraldo_ele_collegi`
    1044669  MODIFY `id_collegio` int(11) NOT NULL AUTO_INCREMENT;
    1045670
    1046 --
    1047 -- AUTO_INCREMENT per la tabella `soraldo_ele_come`
    1048 --
    1049671ALTER TABLE `soraldo_ele_come`
    1050672  MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
    1051673
    1052 --
    1053 -- AUTO_INCREMENT per la tabella `soraldo_ele_conf`
    1054 --
    1055674ALTER TABLE `soraldo_ele_conf`
    1056675  MODIFY `id_conf` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
    1057676
    1058 --
    1059 -- AUTO_INCREMENT per la tabella `soraldo_ele_consultazione`
    1060 --
    1061677ALTER TABLE `soraldo_ele_consultazione`
    1062678  MODIFY `id_cons_gen` int(11) NOT NULL AUTO_INCREMENT;
    1063679
    1064 --
    1065 -- AUTO_INCREMENT per la tabella `soraldo_ele_cons_comune`
    1066 --
    1067680ALTER TABLE `soraldo_ele_cons_comune`
    1068681  MODIFY `id_cons` int(11) NOT NULL AUTO_INCREMENT;
    1069682
    1070 --
    1071 -- AUTO_INCREMENT per la tabella `soraldo_ele_documenti`
    1072 --
    1073683ALTER TABLE `soraldo_ele_documenti`
    1074684  MODIFY `id_doc` int(11) NOT NULL AUTO_INCREMENT;
    1075685
    1076 --
    1077 -- AUTO_INCREMENT per la tabella `soraldo_ele_gruppo`
    1078 --
    1079686ALTER TABLE `soraldo_ele_gruppo`
    1080687  MODIFY `id_gruppo` int(11) NOT NULL AUTO_INCREMENT;
    1081688
    1082 --
    1083 -- AUTO_INCREMENT per la tabella `soraldo_ele_link`
    1084 --
    1085689ALTER TABLE `soraldo_ele_link`
    1086690  MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
    1087691
    1088 --
    1089 -- AUTO_INCREMENT per la tabella `soraldo_ele_lista`
    1090 --
    1091692ALTER TABLE `soraldo_ele_lista`
    1092693  MODIFY `id_lista` int(11) NOT NULL AUTO_INCREMENT;
    1093694
    1094 --
    1095 -- AUTO_INCREMENT per la tabella `soraldo_ele_numeri`
    1096 --
    1097695ALTER TABLE `soraldo_ele_numeri`
    1098696  MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
    1099697
    1100 --
    1101 -- AUTO_INCREMENT per la tabella `soraldo_ele_sede`
    1102 --
    1103698ALTER TABLE `soraldo_ele_sede`
    1104699  MODIFY `id_sede` int(11) NOT NULL AUTO_INCREMENT;
    1105700
    1106 --
    1107 -- AUTO_INCREMENT per la tabella `soraldo_ele_servizi`
    1108 --
    1109701ALTER TABLE `soraldo_ele_servizi`
    1110702  MODIFY `mid` int(7) NOT NULL AUTO_INCREMENT;
    1111703
    1112 --
    1113 -- AUTO_INCREMENT per la tabella `soraldo_ele_sezioni`
    1114 --
    1115704ALTER TABLE `soraldo_ele_sezioni`
    1116705  MODIFY `id_sez` int(11) NOT NULL AUTO_INCREMENT;
    1117706
    1118 --
    1119 -- AUTO_INCREMENT per la tabella `soraldo_ele_temi`
    1120 --
    1121707ALTER TABLE `soraldo_ele_temi`
    1122708  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
    1123709
    1124 --
    1125 -- AUTO_INCREMENT per la tabella `soraldo_ele_voti_parziale`
    1126 --
    1127710ALTER TABLE `soraldo_ele_voti_parziale`
    1128711  MODIFY `id_parz` int(11) NOT NULL AUTO_INCREMENT;
    1129712
    1130 --
    1131 -- AUTO_INCREMENT per la tabella `soraldo_ele_widget`
    1132 --
    1133713ALTER TABLE `soraldo_ele_widget`
    1134   MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
     714  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
    1135715COMMIT;
    1136716
Note: See TracChangeset for help on using the changeset viewer.