Changeset 493


Ignore:
Timestamp:
Oct 11, 2025, 10:13:05 AM (2 months ago)
Author:
roby
Message:
  • ADMIN

-- Gestione nuova norma su affluenza di genere

Location:
trunk/admin
Files:
10 edited

Legend:

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

    r424 r493  
    5757 
    5858    global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $genere, $id_gruppo;
    59        
    6059        $cond='';
    6160        if ($genere==0) {
     
    128127                if(($data==$ultdata) and ($ora==$ultora))
    129128                {
    130                         $tot[$data.$ora]="\n<table width=\"100%\"><tr align=\"center\"><td width=\"30%\"><b>".number_format($votiu,0,',','.')."</b></td><td width=\"30%\"><b>".number_format($votid,0,',','.')."</b></td><td><b>".number_format($somma,0,',','.')."</b></td></tr></table>\n";
     129                        $tottmp="\n<table width=\"100%\"><tr align=\"center\">";
     130                        if($noGenere==0){
     131                                $tottmp.="<td width=\"30%\"><b>".number_format($votiu,0,',','.')."</b></td><td width=\"30%\"><b>".number_format($votid,0,',','.')."</b></td>";
     132                        }                       
     133                        $tottmp.="<td><b>".number_format($somma,0,',','.')."</b></td></tr></table>\n";
     134                        $tot[$data.$ora]=$tottmp;
     135
    131136                        if($tot_u) $perc_u=number_format($votiu*100/$tot_u,2);
    132137                        if($tot_d) $perc_d=number_format($votid*100/$tot_d,2);
     
    152157                list($num_scr)=$resaff->fetch(PDO::FETCH_NUM); //numero delle sezioni inserite
    153158                echo "<br>"._SEZIONI." $num_scr "._SU." $num_sez";
    154                 if ($ud==$num_ril) echo "<br>\n<table width=\"100%\"><tr align=\"center\"><td width=\"30%\">"._UOMINI."</td><td width=\"30%\">"._DONNE."</td><td>"._COMPLESSIVI."</td></tr></table>\n";
    155                
     159                if ($ud==$num_ril) {
     160                        echo "<br>\n<table width=\"100%\"><tr align=\"center\">";
     161                        if($noGenere==0)
     162                                echo "<td width=\"30%\">"._UOMINI."</td><td width=\"30%\">"._DONNE."</td>";
     163                        echo "<td>"._COMPLESSIVI."</td></tr></table>\n";
     164                }
    156165                echo "</td>";
    157166//      $ar['riga1'][$data1.$ora1]="<hr>";
     
    159168                if ($ora_rif=="$data1.$ora1")
    160169                {
    161                         $ar['perc'][$data1.$ora1]="\n<table width=\"100%\"><tr align=\"center\"><td width=\"30%\"><i>$perc_u%</i></td><td width=\"30%\"><i>$perc_d%</i></td><td><i>$perc_c%</i></td></tr></table>\n";
     170                        $artmp="\n<table width=\"100%\"><tr align=\"center\">";
     171                        if($noGenere==0)
     172                                $artmp.="<td width=\"30%\"><i>$perc_u%</i></td><td width=\"30%\"><i>$perc_d%</i></td>";
     173                        $artmp.="<td><i>$perc_c%</i></td></tr></table>\n";
     174                        $ar['perc'][$data1.$ora1]=$artmp;       
    162175                        $ar[0][$data1.$ora1]=$tot[$data1.$ora1];
    163176                }
     
    187200                $donne=$row[4];
    188201                $complessivi=$row[5];
    189                 if ($ora_rif=="$data.$ora")
    190                         $ar[$numsez][$data.$ora]="\n<table width=\"100%\"><tr align=\"center\"><td width=\"30%\">$uomini</td><td width=\"30%\">$donne</td><td>$complessivi</td></tr></table>\n";
    191                 else
     202                if ($ora_rif=="$data.$ora") {
     203                        $artmp="\n<table width=\"100%\"><tr align=\"center\">";
     204                        if($noGenere==0)
     205                                $artmp.="<td width=\"30%\">$uomini</td><td width=\"30%\">$donne</td>";
     206                        $artmp.="<td>$complessivi</td></tr></table>\n";
     207                        $ar[$numsez][$data.$ora]=$artmp;
     208                }else
    192209                        $ar[$numsez][$data.$ora]=$complessivi;
    193                 if ($uomini+$donne>0) {
    194                         if ($uomini+$donne!=$complessivi) {
     210                if ($uomini+$donne>0 or $complessivi>0) {
     211                        if ($uomini+$donne!=$complessivi and ($uomini+$donne)>0) {
    195212                                $ar[$numsez]['controllo']= "<a href=\"admin.php?op=voti&amp;id_cons_gen=$id_cons_gen&amp;id_sez=".$linka[$numsez]['id_sez']."&amp;id_circ=".$linka[$numsez]['id_circ']."&amp;id_sede=".$linka[$numsez]['id_sede']."&amp;do=spoglio&amp;ops=1\"><span style=\"color: rgb(255, 0, 0);\">ERRORE</span></a>";
    196213                        } else {
  • trunk/admin/modules/Elezioni/controllo_voti.php

    r393 r493  
    108108        $riga2= "<tr><td>\n<table border=\"0\" width=\"100%\" bgcolor=\"$bgcolor1\" ><tr><td align=\"center\">"._SEZIONI." $num_scr "._SU." $num_sez</td></tr></table></td></tr>\n";//sezioni scrutinate
    109109        $riga2 .= "<tr><td>\n<table border=\"0\" width=\"100%\"  align=\"center\">";
    110         $riga3 = "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td width=\"5%\"><b>"._SEZIONI."</b></td>"
    111     ."<td><b>"._VOTIU."</b></td>"."<td><b>"._VOTID."</b></td>"."<td><b>"._VOTIE."</b></td>"; //testata con nomi dei campi
     110        $riga3 = "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td width=\"5%\"><b>"._SEZIONI."</b></td>";
     111        if($noGenere==0)
     112                $riga3.="<td><b>"._VOTIU."</b></td>"."<td><b>"._VOTID."</b></td>";
     113        $riga3.="<td><b>"._VOTIE."</b></td>"; //testata con nomi dei campi
    112114        if ($genere==0) {  //se e' un referendum
    113115                $riga3 .= "<td><b>"._SI."</b></td><td><b>"._NO."</b></td>";
     
    164166                $tot_solog+=$solog;
    165167                $tot_solol+=$solol;
    166                 $righe .= "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td>$num</td><td>".number_format($votiu,0,',','.')."</td><td>".number_format($votid,0,',','.')."</td><td>".number_format($voti,0,',','.')."</td>";
     168                $righe .= "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td>$num</td>";
     169                if($noGenere==0)
     170                        $righe.="<td>".number_format($votiu,0,',','.')."</td><td>".number_format($votid,0,',','.')."</td>";
     171                $righe.="<td>".number_format($voti,0,',','.')."</td>";
    167172                if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1)){$righe .= "<td>".number_format($si,0,',','.')."</td>";}
    168173                if ($genere==0 or ((($genere==5) or ($genere==3)) and $pag==1 and !$votog)){$righe .= "<td>".number_format($no,0,',','.')."</td>";}
     
    198203        if(isset($totf) and $totf) $eled=number_format($tot_d*100/$totf,2); else $eled=0;
    199204        if(isset($totm) and $totm) $elem=number_format($tot_u*100/$totm,2); else $elem=0;       
    200         $righet = "<tr align=\"center\"><td><b>"._TOT."</b></td><td><b>".number_format($tot_u,0,',','.')."</b><br><i>(".$elem." %)</i></td><td><b>".number_format($tot_d,0,',','.')."</b><br><i>(".$eled." %)</i></td><td><b>".number_format($tot_voti,0,',','.')."</b><br><i>(".number_format($tot_voti*100/$totel,2)." %)</i></td>";
     205        $righet = "<tr align=\"center\"><td><b>"._TOT."</b></td>";
     206        if($noGenere==0)
     207        $righet.="<td><b>".number_format($tot_u,0,',','.')."</b><br><i>(".$elem." %)</i></td><td><b>".number_format($tot_d,0,',','.')."</b><br><i>(".$eled." %)</i></td>";
     208        $righet.="<td><b>".number_format($tot_voti,0,',','.')."</b><br><i>(".number_format($tot_voti*100/$totel,2)." %)</i></td>";
    201209        // se e' un referendum o una consultazione con raggruppamenti
    202210        if($tot_validi){
  • trunk/admin/modules/Elezioni/ele.php

    r488 r493  
    4343}
    4444include_once("modules/Elezioni/query.sql");
    45 
     45global $noGenere;
    4646$row=setconsultazione();
    4747if(isset($row[0])) {
    48         $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2];
     48        $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2]; $dataInizioCons=strtotime($row[3]);
    4949} else {
    50         $tipo_cons=0; $descr_cons=''; $id_cons_gen=0;
    51 }
     50        $tipo_cons=0; $descr_cons=''; $id_cons_gen=0; $dataInizioCons=0;
     51}
     52if($dataInizioCons>$inizioNoGenere) $noGenere=1; else $noGenere=0;
    5253$row=tipocons();
    5354if(isset($row[0])) {
  • trunk/admin/modules/Elezioni/ele_associazioni.php

    r489 r493  
    6767        //
    6868        function all() {
    69         global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf,$sg,$disgiunto,$id_cons_comu,$genere,$proiezione;
     69        global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf,$sg,$disgiunto,$id_cons_comu,$genere,$proiezione,$noGenere;
    7070$aid=$_SESSION['aid'];
    7171$prefix=$_SESSION['prefix'];
     
    141141                echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._FASCIA."</b></td>";
    142142                echo "<td bgcolor=\"$bgcolor1\"><b>"._PROIEZIONE."</b></td>";
    143                 }
    144         echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
     143        }
     144        if($noGenere==0)
     145                echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
    145146        $sql = "SELECT * from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons_comu'";
    146147        $rescomu = $dbi->prepare("$sql");
     
    236237        $rescomu->execute();   
    237238        list($vismf,$sg,$disgiunto)=$rescomu->fetch(PDO::FETCH_NUM);
    238         echo "<td><select name=\"vismf\">";
    239         if ($vismf==0) $sel="selected"; else $sel="";
    240         echo "<option value=\"0\" $sel>No";
    241         if ($vismf==1) $sel="selected"; else $sel="";
    242         echo "<option value=\"1\" $sel>Si";
    243         echo "</select></td>";
     239        if($noGenere==0) {
     240                echo "<td><select name=\"vismf\">";
     241                if ($vismf==0) $sel="selected"; else $sel="";
     242                echo "<option value=\"0\" $sel>No";
     243                if ($vismf==1) $sel="selected"; else $sel="";
     244                echo "<option value=\"1\" $sel>Si";
     245                echo "</select></td>";
     246        }
    244247        $sql = "SELECT * from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons_comu'";
    245248        $rescomu = $dbi->prepare("$sql");
     
    284287                echo "<td width=\"20%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._FASCIA."</b></td>";
    285288                echo "<td width=\"20%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._PROIEZIONE."</b></td>";
    286                 }
    287         echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
     289        }
     290        if($noGenere==0)
     291                echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>";
    288292        if ($genere==5){
    289293                echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>";
     
    327331
    328332                }
    329                 if ($vismf2==0) $sel=_NO; else $sel=_SI;
    330                 echo "<td>$sel</td>";
     333                if($noGenere==0) {
     334                        if ($vismf2==0) $sel=_NO; else $sel=_SI;
     335                        echo "<td>$sel</td>";
     336                }
    331337                if ($genere==5){
    332338                        if ($sg2==0) $sel=_NO; else $sel=_SI;
  • trunk/admin/modules/Elezioni/ele_riepilogo.php

    r344 r493  
    6767        echo "<center>";
    6868        echo "<fieldset><legend>"._VOTANTI."</legend>";
    69         echo "<table border=\"1\" width=\"100%\"><tr><th>"._ISCRITTI."</TH><TH>"._UOMINI."</TH><TH>"._DONNE."</TH><TH>"._VOTIU."</TH><TH>"._VOTID."</TH><TH>"._VOTIE."</TH></TR>";
    70         ECHO "<TR><TH>".number_format($totel,0,',','.')."</TH><TH>".number_format($totm,0,',','.')."</TH><TH>".number_format($totf,0,',','.')."</TH><TH>".number_format($votm,0,',','.')."</TH><TH>".number_format($votf,0,',','.')."</TH><TH>".number_format($votc,0,',','.')."</TH></TR></table><br/>";
     69        echo "<table border=\"1\" width=\"100%\"><tr><th>"._ISCRITTI."</TH>";
     70        if($noGenere==0)
     71                echo "<TH>"._UOMINI."</TH><TH>"._DONNE."</TH><TH>"._VOTIU."</TH><TH>"._VOTID."</TH>";
     72        echo "<TH>"._VOTIE."</TH></TR>";
     73        ECHO "<TR><TH>".number_format($totel,0,',','.')."</TH>";
     74        if($noGenere==0)
     75                echo "<TH>".number_format($totm,0,',','.')."</TH><TH>".number_format($totf,0,',','.')."</TH><TH>".number_format($votm,0,',','.')."</TH><TH>".number_format($votf,0,',','.')."</TH>";
     76        echo "<TH>".number_format($votc,0,',','.')."</TH></TR></table><br/>";
    7177        ECHO "</fieldset><br/><br/><br/>";     
    7278        $totnulli=$nulli+$bianchi+$contestati+$votinulli;
  • trunk/admin/modules/Elezioni/ele_sezione.php

    r454 r493  
    4747
    4848function all() {
    49         global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$mexsez;
     49        global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $id_cons,$id_cons_gen,$mexsez,$noGenere;
    5050#       OpenTable();
    5151        $y=0;
     
    6464        echo "<br><table border=\"0\" width=\"95%\"><tr>"
    6565        ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NUM."</b></td>"
    66         ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._INDIRIZZO."</b></td>"
    67         ."<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._MASCHI."</b></td>"
    68         ."<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._FEMMINE."</b></td>"
    69         ."<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._TOTS." "._ISCRITTI."</b></td>"
     66        ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._INDIRIZZO."</b></td>";
     67        if($noGenere==0) {
     68        echo "<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._MASCHI."</b></td>"
     69        ."<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._FEMMINE."</b></td>";
     70        }
     71        echo "<td bgcolor=\"$bgcolor1\" align=\"center\" ><b>"._TOTS." "._ISCRITTI."</b></td>"
    7072        ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._FUNZIONI."</b></td></tr>";
    7173        echo "<tr align=\"center\"><form name=\"sezi\" action=\"admin.php\">"
     
    9597        echo "</select></td>";
    9698        //*************************************
    97 
    9899        echo "<td><input type=\"text\" name=\"maschi\" size=\"4\"></td>";
    99        
    100 
    101         echo "<td><input type=\"text\" name=\"femmine\" size=\"4\"></td>";
    102 
     100        if($noGenere==0) {
     101                echo "<td><input type=\"text\" name=\"femmine\" size=\"4\"></td><td></td>";
     102        }
    103103        echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">";
    104104        echo "<input type=\"hidden\" name=\"min\" value=\"$min\">"
    105         ."</td><td><input type=\"submit\" name=\"add\" value=\""._ADD."\"></td></tr>"
     105        ."<input type=\"submit\" name=\"add\" value=\""._ADD."\"></td></tr>"
    106106        ."</form>";
    107107   
     
    145145        echo "</select></td>";
    146146
    147         echo "<td align=\"center\"><b><input type=\"text\" size=\"4\" name=\"maschi\" value=\"$maschi\"></b>";
    148         echo "</td><td align=\"center\"><b><input type=\"text\" size=\"4\" name=\"femmine\" value=\"$femmine\"></b>";
    149         echo "</td><td align=\"center\"><b>$totali</b>"
    150         ."</td><td align=\"center\" nowrap><table><tr><td align=\"center\" width=\"50%\">"
     147        echo "<td align=\"center\"><b><input type=\"text\" size=\"4\" name=\"maschi\" value=\"$maschi\"></b></td>";
     148        if($noGenere==0) {
     149                echo "<td align=\"center\"><b><input type=\"text\" size=\"4\" name=\"femmine\" value=\"$femmine\"></b></td>";
     150                echo "<td align=\"center\"><b>$totali</b></td>";
     151        }
     152        echo "<td align=\"center\" nowrap><table><tr><td align=\"center\" width=\"50%\">"
    151153        ."<input type=\"submit\" name=\"update$y\" value=\""._OK."\">"  ;
    152154        echo "</td><td align=\"center\" nowrap width=\"50%\">"
  • trunk/admin/modules/Elezioni/ele_spoglio.php

    r481 r493  
    1515function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){
    1616
    17 global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen,$id_comune,$ops;
     17global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen,$id_comune,$ops,$noGenere;
    1818##################
    1919echo "<style>";
     
    8080        $rigat[$y]= "<div class=\"tr\">";
    8181        if ($genere==0){ //e' un referendum
    82                 $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._NUM."</b></span>";
     82                $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\" style=\"width:150px;\"><b>"._NUM."</b></span>";
    8383        }
    84         $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._ORA."</b></span>"
    85         ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._DATA."</b></span>";
    86         $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIU."</b></span>";
    87         $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTID."</b></span>"
    88         ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIT."</b></span>";
     84        $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\" style=\"width:150px;\"><b>"._ORA."</b></span>"
     85        ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\" style=\"width:150px;\"><b>"._DATA."</b></span>";
     86        if($noGenere==0){
     87                $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" style=\"width:150px;\"><b>"._VOTIU."</b></span>";
     88                $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" style=\"width:150px;\"><b>"._VOTID."</b></span>";
     89        }
     90        $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" style=\"width:150px;\"><b>"._VOTIT."</b></span>";
    8991        if ($genere==0){
    9092                $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'  ";
     
    99101        for ($i=1;$i<=$max;$i++){
    100102                $autofocus=0;
    101                 $query="SELECT * FROM ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2
     103                $query="SELECT t1.* FROM ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2
    102104                on (t1.id_gruppo=t2.id_gruppo) where t1.id_sez='$id_sez'
    103105                and t1.id_cons='$id_cons' and t1.orario='$ora' and t1.data='$giorno'";
     
    149151        list ($anno,$mese,$di)=explode('-',$giorno);
    150152                $riga[$y].= "$ora</span><span class=\"td\" align=\"center\">$di-$mese-$anno</span>";
    151                 if ($voti_u > $maschi) {$riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">"; $errvot1=1;}
    152                 else $riga[$y].= "<span class=\"td\" align=\"center\">";
    153                 $af='';
    154153                $spuntacopia='';
    155                 if(!$autofocus) {
    156                         if($voti_u==0) {$af='autofocus'; $autofocus=1;
    157                         if($genere==0 and $gruppo==1) $spuntacopia="<input type=\"checkbox\" name=\"copia\" value=\"1\"> Copia su tutti i referendum";
    158                 }}
    159                 if ($y<$num and $vismf==0 and $voti_u==0) { $riga[$y].= "<input type=\"hidden\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"'$voti_u'\"";}else $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"$voti_u\" $af onfocus=\"select();\"";
    160                 $riga[$y].= " size=\"5\"/></span>";
    161                 if (!($y<$num and $vismf==0 and $voti_u==0)) $af='';
    162                 if ($voti_d > $femmine) {$riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">"; $errvot1=1;}
    163                 else $riga[$y].= "<span class=\"td\" align=\"center\">";
    164                 if ($y<$num and $vismf==0 and $voti_d==0) { $riga[$y].= "<input type=\"hidden\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"'$voti_d'\"";}else $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"$voti_d\" onfocus=\"select();\"";
    165                 $riga[$y].= "  size=\"5\"/></span>";
     154                if($noGenere==0){
     155                        if ($voti_u > $maschi) {
     156                                $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">"; $errvot1=1;
     157                        }                       
     158                        else $riga[$y].= "<span class=\"td\" align=\"center\">";
     159                        $af='';
     160                        if(!$autofocus) {
     161                                if($voti_u==0) {
     162                                        $af='autofocus';
     163                                        $autofocus=1;
     164                                        if($genere==0 and $gruppo==1)
     165                                                $spuntacopia="<input type=\"checkbox\" name=\"copia\" value=\"1\"> Copia su tutti i referendum";
     166                                }
     167                        }
     168                        if (($y<$num and $vismf==0 and $voti_u==0) or $noGenere==1) { $riga[$y].= "<input type=\"hidden\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"'$voti_u'\"";}else $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"$voti_u\" $af onfocus=\"select();\"";
     169                        $riga[$y].= " size=\"5\"/></span>";
     170                        if (!($y<$num and $vismf==0 and $voti_u==0)) $af='';
     171                        if ($voti_d > $femmine) {$riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">"; $errvot1=1;}
     172                        else $riga[$y].= "<span class=\"td\" align=\"center\">";
     173                        if (($y<$num and $vismf==0 and $voti_d==0) or $noGenere==1) { $riga[$y].= "<input type=\"hidden\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"'$voti_d'\"";
     174                        }else
     175                                $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"$voti_d\" onfocus=\"select();\"";
     176                        $riga[$y].= "  size=\"5\"/></span>";
     177                }
     178               
    166179                if ($voti_t > ($maschi+$femmine)) {$riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\" ><input type=\"text\" id=\"voti_t$y$i\" name=\"voti_t\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\" onfocus=\"select();\"/>"; $errvot1=1;}
    167180                else {
     
    191204        if(isset($errvot1) and $errvot1) echo "<table><tr><td align=\"center\" bgcolor=\"red\"> <h1 style=\"color:white;\">I votanti inseriti superano il numero di elettori</h1></td></tr></table></br>";
    192205        if(isset($error) and $error) echo "<table><tr><td align=\"center\" bgcolor=\"red\"> <h1 style=\"color:white;\">Numero di votanti inferiore della rilevazione precedente</h1></td></tr></table></br>";
    193         echo "<table border=\"1\"><tr><td><b>Iscritti nella sezione</b> Maschi: $maschi - Femmine: $femmine - Totale: ".($maschi+$femmine)."</td></tr></table></br>";
     206        echo "<table border=\"1\"><tr><td><b>Iscritti nella sezione</b>";
     207        if($noGenere==0)
     208                echo "Maschi: $maschi - Femmine: $femmine - Totale";
     209        echo ":  ".($maschi+$femmine)."</td></tr></table></br>";
    194210        foreach($riga as $key=>$val){
    195211                echo $rigat[$key];
  • trunk/admin/modules/Elezioni/query.sql

    r424 r493  
    5858if ($id_cons_gen) {
    5959        if ($id_comune and $perms<256)
    60                 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen 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'";
     60                $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen,t1.data_inizio 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'";
    6161        else
    62                 $sql = "SELECT t1.tipo_cons,t1.descrizione,t1.id_cons_gen FROM ".$prefix."_ele_consultazione as t1 where  t1.id_cons_gen='$id_cons_gen'";
     62                $sql = "SELECT t1.tipo_cons,t1.descrizione,t1.id_cons_gen,t1.data_inizio FROM ".$prefix."_ele_consultazione as t1 where  t1.id_cons_gen='$id_cons_gen'";
    6363}else{
    6464        if($perms>128)
    65                 $sql = "SELECT tipo_cons,descrizione,id_cons_gen FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 ";
     65                $sql = "SELECT tipo_cons,descrizione,id_cons_gen,t1.data_inizio FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 ";
    6666        else
    67                 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".
     67                $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen,t1.data_inizio FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".
    6868                $prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and date_add(t1.data_fine, interval 3 day)>CURDATE() and t3.aid='$aid' order by t1.data_fine desc limit 0,1 ";
    6969
  • trunk/admin/modules/Elezioni/salva_aff.php

    r474 r493  
    3636list($id_cons,$chiusa)=$res->fetch(PDO::FETCH_NUM);
    3737if($chiusa!=1){
    38         $query="select id_parz from ".$prefix."_ele_voti_parziale where data='$data' and orario='$orario' and id_sez='$id_sez' and id_gruppo='$id_gruppo'";
     38        $query="select id_parz from ".$prefix."_ele_voti_parziale where data='$data' and orario='$orario' and id_sez='$id_sez'";
     39        if($genere==0) $query.=" and id_gruppo='$id_gruppo'";
    3940        $res = $dbi->prepare("$query");
    4041        $res->execute();         
     
    6566                        }
    6667                }else{
    67                         $sql="insert into ".$prefix."_ele_voti_parziale values ('$id_cons', '$id_sez','0','$orario','$data','$voti_u','$voti_d','$voti_t','$id_gruppo')";
     68                        $sql="insert into ".$prefix."_ele_voti_parziale values ('$id_cons', '$id_sez','0','$orario','$data','$voti_u','$voti_d','$voti_t','0')";
    6869                        $res = $dbi->prepare("$sql");
    6970                        $res->execute();
  • trunk/admin/variabili.php

    r483 r493  
    2626$giorniaut=30;
    2727
     28# data di entrata in vigore della legge 72/2025 - abolizione liste di genere, formato 'YYYY/MM/DD'
     29$inizioNoGenere=strtotime('2025/06/30');
     30
    2831# $LINK e fileback vanno lasciate vuote, vengono gestite da programma per contenere il nome del file di backup e l'indirizzo completo per scaricare la consultazione e come discrimine per la funzione di restore
    2932$LINK='';
Note: See TracChangeset for help on using the changeset viewer.