Changeset 424 for trunk/admin/modules
- Timestamp:
- Jun 13, 2024, 7:18:22 PM (5 months ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/aggiornadb.php
r423 r424 114 114 if(controllo($prefix.'_authors','admincomune',++$num)) 115 115 { 116 $sql="UPDATE `".$prefix."_authors` SET `admin op` = '1', `adminsuper` = '0',`admincomune` = '0' WHERE `".$prefix."_authors`.`aid` != 'admin' AND `".$prefix."_authors`.`adminsuper` != '1'";116 $sql="UPDATE `".$prefix."_authors` SET `adminsuper` = '0',`admincomune` = '0' WHERE `".$prefix."_authors`.`aid` != 'admin' AND `".$prefix."_authors`.`adminsuper` != '1'"; 117 117 $ret=aggiorna($sql,$dbi,'',$num); 118 118 $sql="UPDATE `".$prefix."_authors` SET `adminop` = '0', `adminsuper` = '0',`admincomune` = '1' WHERE `".$prefix."_authors`.`aid` = 'admin' and `".$prefix."_authors`.`adminsuper` != '1'"; -
trunk/admin/modules/Elezioni/aggiornamento.php
r412 r424 185 185 $myrev=$_SESSION['localrev']; 186 186 if (isset($_SESSION['forzadb'])) $myrev=378; 187 if($newrev ==$myrev) {187 if($newrev<=$myrev) { 188 188 $errmex=1; 189 189 Header("Location: admin.php?op=aggiorna&id_cons_gen=$id_cons_gen&errmex=$errmex"); exit; -
trunk/admin/modules/Elezioni/controllo_votanti.php
r344 r424 131 131 if($tot_u) $perc_u=number_format($votiu*100/$tot_u,2); 132 132 if($tot_d) $perc_d=number_format($votid*100/$tot_d,2); 133 $perc_c=number_format($somma*100/$tot_compl,2);133 if($tot_compl) $perc_c=number_format($somma*100/$tot_compl,2); 134 134 } 135 135 else -
trunk/admin/modules/Elezioni/ele.php
r403 r424 66 66 function ele() { 67 67 68 global $espandi, $aid, $bgcolor1, $bgcolor2,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons, $id_cons_gen,$tipo_cons,$genere,$op,$id_comune,$perms,$id_cons,$votog,$votol,$votoc,$votocirc,$tema,$fascia,$limite ;68 global $espandi, $aid, $bgcolor1, $bgcolor2,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons, $id_cons_gen,$tipo_cons,$genere,$op,$id_comune,$perms,$id_cons,$votog,$votol,$votoc,$votocirc,$tema,$fascia,$limite,$BACKUP; 69 69 70 70 include ("header.php"); … … 162 162 if ($perms>128) { 163 163 164 165 164 # <a href=\"admin.php?op=inscollegi&id_cons_gen=$id_cons_gen\">$bullet"._COLLEGI."</a><br> 166 165 167 echo "166 echo " 168 167 <tr align=\"left\" bgcolor=\"$bgcolor1\"> 169 168 <td valign=\"top\" align=\"center\" bgcolor=\"#000000\" rowspan=\"3\"><font face=\"Arial,Helvetica\" size=-1><font color=\"#ffffff\"><b>"._SUPER." 170 171 </b></font></font> 172 173 </td> 174 <td valign=\"top\" align=\"left\" width=\"150\"> 175 176 177 <a href=\"admin.php?op=configurazione&id_cons_gen=$id_cons_gen\">$bullet"._CONFIGURAZIONE."</a><br>"; 178 if($op=="configurazione" || $op=="widget" || $op=="plugin"){ 179 echo " - <a href=\"admin.php?op=widget&id_cons_gen=$id_cons_gen\"> "._WIDGET."</a>"; 180 echo "<br> - "._PLUGINS.""; 181 echo "<hr>"; 182 } 183 $newrev=$_SESSION['remoterev']; 184 $myrev=$_SESSION['localrev']; 185 if($newrev==$myrev or $newrev==0) echo "<a href=\"admin.php?op=aggiorna&id_cons_gen=$id_cons_gen\">$bullet"._AGGIORNA."</a><br>"; 186 else echo "<a href=\"admin.php?op=aggiorna&id_cons_gen=$id_cons_gen\">$bullet_red<b>"._AGGIORNA."</b></a><br>"; 187 echo "<a href=\"admin.php?op=confconsiglio&id_cons_gen=$id_cons_gen\">$bullet"._CONFCONS."</a> 188 </td></tr><tr align=\"left\" bgcolor=\"$bgcolor1\"><td> 189 <a href=\"admin.php?op=inscomuni&id_cons_gen=$id_cons_gen\">$bullet"._DEFCOMUNE."</a><br> 190 <a href=\"admin.php?op=oper_admin&id_cons_gen=$id_cons_gen\">$bullet"._AMMINISTRATORI."</a> 191 </td></tr><tr align=\"left\" bgcolor=\"$bgcolor1\"><td> 192 <a href=\"admin.php?op=consultazione&id_cons_gen=$id_cons_gen\">$bullet"._CONSULTAZIONE_ADM."</a><br>"; 193 echo "<a href=\"admin.php?op=rec_add_aff&id_cons_gen=$id_cons_gen\">$bullet"._AFFLUENZE."</a><br> 194 <a href=\"admin.php?op=associazioni&id_cons_gen=$id_cons_gen\">$bullet"._INSCOMUNE."</a> 195 </td></tr>"; 196 # <br><a href=\"http://www.eleonline.it/portal/segnala.php?tmp=test123\" target=\"_blank\">$bullet_red <b>"._SEGNALA."</b></a> 197 198 # <a href=\"admin.php?op=backup&id_cons_gen=$id_cons_gen\">$bullet"._BACKUP."</a><br> 199 # <a href=\"admin.php?op=restore&id_cons_gen=$id_cons_gen\">$bullet"._RESTORE."</a> 200 201 } 169 </b></font></font> 170 </td>"; 171 if(!$BACKUP){ 172 echo "<td valign=\"top\" align=\"left\" width=\"150\">"; 173 echo "<a href=\"admin.php?op=configurazione&id_cons_gen=$id_cons_gen\">$bullet"._CONFIGURAZIONE."</a><br>"; 174 if($op=="configurazione" || $op=="widget" || $op=="plugin"){ 175 echo " - <a href=\"admin.php?op=widget&id_cons_gen=$id_cons_gen\"> "._WIDGET."</a>"; 176 echo "<br> - "._PLUGINS.""; 177 echo "<hr>"; 178 } 179 $newrev=$_SESSION['remoterev']; 180 $myrev=$_SESSION['localrev']; 181 if($newrev==$myrev or $newrev==0) echo "<a href=\"admin.php?op=aggiorna&id_cons_gen=$id_cons_gen\">$bullet"._AGGIORNA."</a><br>"; 182 else echo "<a href=\"admin.php?op=aggiorna&id_cons_gen=$id_cons_gen\">$bullet_red<b>"._AGGIORNA."</b></a><br>"; 183 echo "<a href=\"admin.php?op=confconsiglio&id_cons_gen=$id_cons_gen\">$bullet"._CONFCONS."</a> 184 </td></tr><tr align=\"left\" bgcolor=\"$bgcolor1\"><td> 185 <a href=\"admin.php?op=inscomuni&id_cons_gen=$id_cons_gen\">$bullet"._DEFCOMUNE."</a><br> 186 <a href=\"admin.php?op=oper_admin&id_cons_gen=$id_cons_gen\">$bullet"._AMMINISTRATORI."</a> 187 </td></tr><tr align=\"left\" bgcolor=\"$bgcolor1\"><td> 188 <a href=\"admin.php?op=consultazione&id_cons_gen=$id_cons_gen\">$bullet"._CONSULTAZIONE_ADM."</a><br>"; 189 echo "<a href=\"admin.php?op=rec_add_aff&id_cons_gen=$id_cons_gen\">$bullet"._AFFLUENZE."</a><br> 190 <a href=\"admin.php?op=associazioni&id_cons_gen=$id_cons_gen\">$bullet"._INSCOMUNE."</a>"; 191 }else{ 192 echo "</tr><tr align=\"left\" bgcolor=\"$bgcolor1\"><td valign=\"top\" align=\"left\" width=\"150\" rowspan=\"2\">"; 193 echo "<a href=\"admin.php?op=aggcons&id_cons_gen=$id_cons_gen\">$bullet"._AGGDATI."</a>"; 194 echo "</td></tr><tr><td>"; 195 } 196 echo "</td></tr>"; 197 # <br><a href=\"http://www.eleonline.it/portal/segnala.php?tmp=test123\" target=\"_blank\">$bullet_red <b>"._SEGNALA."</b></a> 198 199 # <a href=\"admin.php?op=backup&id_cons_gen=$id_cons_gen\">$bullet"._BACKUP."</a><br> 200 201 } 202 202 // Amministrazione locale solo superuser e adminuser 203 if ($perms>16 and ! $espandi ) {203 if ($perms>16 and ! $espandi and !$BACKUP) { 204 204 echo " 205 205 <tr bgcolor=\"$bgcolor1\"> … … 267 267 <td valign=\"top\" width=\"150\">"; 268 268 if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) and ! $espandi) { 269 echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=spoglio\">$bullet "._GEST." "._SPOGLIO."</a><br>";269 if(!$BACKUP) echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=spoglio\">$bullet "._GEST." "._SPOGLIO."</a><br>"; 270 270 if ($nraff) { 271 271 echo "<a href=\"admin.php?op=controllo_votanti&id_cons_gen=$id_cons_gen\">$bullet "._STATO." "._AFFLUENZE."</a><br>"; -
trunk/admin/modules/Elezioni/ele_cons_comuni.php
r344 r424 149 149 function cons_comuni($ok, $id_cons2,$do, $duplica,$elettori) 150 150 { 151 global $prefix, $dbi,$id_comune,$id_cons_gen,$perms,$predefinita ;151 global $prefix, $dbi,$id_comune,$id_cons_gen,$perms,$predefinita,$chiusa; 152 152 if ($perms>32) { 153 153 $sql="select id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune=$id_comune"; … … 236 236 $result->execute(); 237 237 }else{ 238 $sql="update ".$prefix."_ele_cons_comune set chiusa='$chiusa' WHERE id_cons 2='$id_cons2'";238 $sql="update ".$prefix."_ele_cons_comune set chiusa='$chiusa' WHERE id_cons='$id_cons2'"; 239 239 $result = $dbi->prepare("$sql"); 240 240 $result->execute(); -
trunk/admin/modules/Elezioni/ele_controlli.php
r422 r424 308 308 $res->execute(); 309 309 list($prefs,$disg,$solog,$fascia,$id_conf)=$res->fetch(PDO::FETCH_NUM); 310 $sql="SELECT supdisgiunto FROM ".$prefix."_ele_conf where id_conf='$id_conf'"; 310 $sql="SELECT supdisgiunto FROM ".$prefix."_ele_conf where id_conf='$id_conf'"; 311 311 $res = $dbi->prepare("$sql"); 312 312 $res->execute(); … … 361 361 $res = $dbi->prepare("$sql"); 362 362 $res->execute(); 363 list($votiv,$validil,$contestatil,$nullil,$solo g,$solol) = $res->fetch(PDO::FETCH_NUM);363 list($votiv,$validil,$contestatil,$nullil,$solovg,$solol) = $res->fetch(PDO::FETCH_NUM); 364 364 $vl=0; 365 365 $tvl=0; … … 391 391 $tnl+=$nl; 392 392 if(($votig+$svl)!=($votil+$svg+$nl) and (!$supdis and !$disg)) 393 { $err=1; $tipo='lista'; break; }393 { $err=1; $tipo='lista'; break; } 394 394 } 395 395 $totg+=($votig+$svl);$totl+=($votil+$svg+$nl); #$svl da ele_voti_gruppo e $solog da ele_sezioni 396 396 397 397 } 398 if(($totg )!=($totl+$nullil+$contestatil) or $totsg!=$solog)399 { $err=1; $tipo='lista';}398 if(($totg+$totsg)!=($totl+$nullil+$contestatil+$solovg) or ($totsg!=$solovg and $solog)) 399 {$err=1; $tipo='lista';} 400 400 401 401 }else{ 402 402 #inserire controllo per consultazioni con voto alle liste ma senza voto di gruppo 403 403 } 404 if (!$totsg) $totsg=$solo g;404 if (!$totsg) $totsg=$solovg; 405 405 if (($totlis!=$validil or $validil+$contestatil+$nullil+$totsg!=$votiv) and ($validil+$contestatil+$nullil+$solol>0 or $tvl>0)) {$err=1;$tipo='lista';} 406 if(($solo g && !$disg && ($tnl!=$nullil && $disg)) || $totsl!=$solol || ($totsg!=$solog)) {$err=1;$tipo='lista';}406 if(($solovg && !$disg && ($tnl!=$nullil && $disg)) || $totsl!=$solol || ($totsg!=$solovg)) {$err=1;$tipo='lista';} 407 407 } 408 408 } -
trunk/admin/modules/Elezioni/ele_gruppo.php
r395 r424 14 14 15 15 // Offset - visualizza il numero di elementi per pagina 16 $offset=5;16 if(isset($offsetgruppi) and $offsetgruppi>0) $offset=$offsetgruppi; else $offset=5; 17 17 global $dbi; 18 18 $aid=$_SESSION['aid']; -
trunk/admin/modules/Elezioni/ele_riepilogovoti.php
r364 r424 67 67 68 68 ################# calcolo voti di lista espressi 69 $sql="select sum(validi_lista),sum(nulli+bianchi+voti_nulli+contestati+solo_gruppo),sum(voti_nulli_lista),sum(contestati_lista) from ".$prefix."_ele_sezioni where id_cons='$id_cons'";69 $sql="select sum(validi_lista),sum(nulli+bianchi+voti_nulli+contestati+solo_gruppo),sum(voti_nulli_lista),sum(contestati_lista),sum(solo_gruppo) from ".$prefix."_ele_sezioni where id_cons='$id_cons'"; 70 70 $resperc = $dbi->prepare("$sql"); 71 71 $resperc->execute(); 72 list($scruvalidi,$scrunulli,$nullista,$contlista )=$resperc->fetch(PDO::FETCH_NUM);72 list($scruvalidi,$scrunulli,$nullista,$contlista,$sgs)=$resperc->fetch(PDO::FETCH_NUM); 73 73 74 74 if($totschede) … … 96 96 list($num_gruppo,$descrg)=$resg2->fetch(PDO::FETCH_NUM); 97 97 98 echo "<tr style=\"border-top: 2px solid;\"><td rowspan=\"$numliste\">$descrg</td><td rowspan=\"$numliste\" align=\"right\"><h2>".number_format($votigruppo,0,',','.')."</h2></td><td rowspan=\"$numliste\" align=\"right\"><h2>".number_format($sologruppo,0,',','.')."</h2></td>"; 98 echo "<tr style=\"border-top: 2px solid;\"><td rowspan=\"$numliste\">$descrg</td><td rowspan=\"$numliste\" align=\"right\"><h2>".number_format($votigruppo,0,',','.')."</h2></td><td rowspan=\"$numliste\" align=\"right\"><h2>"; 99 if($sologruppo) echo number_format($sologruppo,0,',','.'); 100 echo "</h2></td>"; 99 101 $currlst=0; 100 102 while (list($id_lista,$num_lista,$descrl)=$resl->fetch(PDO::FETCH_NUM)) … … 110 112 if(!$currlst) echo "<td></td><td></td></tr>"; 111 113 } 114 if(!$totsg)$totsg=$sgs; 112 115 echo "<tr style=\"border-top: 2px solid;\"><td rowspan=\"3\"><b>Totale</b></td><td rowspan=\"3\" align=\"right\"><h1>".number_format($totg,0,',','.')."</h1></td><td rowspan=\"3\" align=\"right\"><h1>".number_format($totsg,0,',','.')."</h1></td><td align=\"right\"><b>Validi di lista</b></td><td align=\"right\"><h1>".number_format($totl,0,',','.')."</h1></td></tr><tr><td align=\"right\"><b>Nulli di lista</b></td><td align=\"right\"><h1>".number_format($nullista,0,',','.')."</h1></td></tr><tr><td align=\"right\"><b>Contestati di lista</b></td><td align=\"right\"><h1>".number_format($contlista,0,',','.')."</h1></td></tr>"; 113 116 echo "</table></br>"; -
trunk/admin/modules/Elezioni/ele_spoglio.php
r422 r424 278 278 echo "<input type=\"hidden\" id=\"pag\" name=\"pag\" value=\"admin.php?id_cons_gen=$id_cons_gen&op=$op&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=3&id_lista=\">"; 279 279 echo "<select id=\"id_lista\" name=\"id_lista\" onChange=\"vai_lista('id_lista');\">"; 280 if ($id_lista){ 280 if ($id_lista){ #TEST spostare la valorizzazione di $ele_lista 281 281 echo "<option value=\"0\">"._VOTI_LISTA; 282 282 $ele_lista=" and t1.id_lista='$id_lista' "; … … 498 498 499 499 500 if($id_lista) $sql="select t1.* from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $ele_lista $circoORDER BY t2.num_lista,t1.num_cand";501 else $sql="select 0,'$id_cons',t1.id_lista,'','','','','',0 from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $ ele_lista $circoORDER BY t2.num_lista";500 if($id_lista) $sql="select t1.* from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $ele_lista ORDER BY t2.num_lista,t1.num_cand"; 501 else $sql="select 0,'$id_cons',t1.id_lista,'','','','','',0 from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $circo $ele_lista ORDER BY t2.num_lista"; 502 502 $result = $dbi->prepare("$sql"); 503 503 $result->execute(); -
trunk/admin/modules/Elezioni/language/lang-it.php
r407 r424 219 219 define("_SPUNTAELIMINA","Metti la spunta per abilitare la cancellazione dei dati (solo voti e votanti):"); 220 220 define("_DATI","i dati dello spoglio"); 221 define("_AGGDATI","Aggiorna i dati"); 221 222 define("_SPUNTALABEL1","Abilita la cancellazione"); 222 223 define("_SPUNTALABEL2","Cancella anche candidati e struttura"); -
trunk/admin/modules/Elezioni/query.sql
r406 r424 1 1 <?php 2 2 3 3 if (!defined('ADMIN_FILE')) { … … 96 96 function elenco_cons() 97 97 { 98 global $perms,$dbi,$prefix,$currentlang,$aid,$id_comune ;98 global $perms,$dbi,$prefix,$currentlang,$aid,$id_comune,$giorniaut; 99 99 100 100 if ($perms<64) { 101 $sql="select t2.id_cons,t1.descrizione,t4.genere,t1.id_cons_gen,t2.chiusa from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t4 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and t1.tipo_cons=t4.tipo_cons and date_add(t1.data_fine, interval 3day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0)";101 $sql="select t2.id_cons,t1.descrizione,t4.genere,t1.id_cons_gen,t2.chiusa from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t4 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and t1.tipo_cons=t4.tipo_cons and date_add(t1.data_fine, interval $giorniaut day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0)"; 102 102 } 103 103 elseif ($perms<128) { -
trunk/admin/modules/Elezioni/restore.php
r383 r424 15 15 $perms=ChiSei(0); 16 16 if ($perms!=256) die("Non hai i permessi per effettuare questa operazione!"); 17 17 global $LINK,$fileback; 18 18 $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST; 19 19 if (isset($param['datafile'])) $datafile=addslashes($param['datafile']); else $datafile=''; … … 22 22 ele(); 23 23 if (isset($_FILES['datafile']['tmp_name'])) $updfile=$_FILES['datafile']['tmp_name']; else $updfile=''; 24 if (!is_uploaded_file($updfile) )24 if (!is_uploaded_file($updfile) and $LINK=='') 25 25 # if (!is_uploaded_file($_FILES['datafile']['tmp_name'])) 26 26 # if (file_exists($datafile)) … … 33 33 echo "<td align=\"center\"><input type=\"submit\" name=\"add\" value=\""._OK."\"></td></tr></table></form>"; 34 34 //////////////////////////// 35 }else{$datafile=$_FILES['datafile']['tmp_name']; 35 }else{ 36 if($LINK=='') 37 $datafile=$_FILES['datafile']['tmp_name']; 38 else 39 $datafile=$fileback; 36 40 $arrFile = file($datafile); 37 41 $handle = fopen($datafile, "r"); … … 123 127 } else $errore=1; 124 128 fclose($handle); 125 die("finito");129 echo "<center><h2>Aggiornamento del ".date('d/m/Y H:i')." terminato</h2></center>"; 126 130 } 127 if (isset($errore)) 128 if ($errore) die( _MEX_RESTORE_FAILED); 129 else die( _MEX_RESTORE_OK ); 131 if (isset($errore) and $errore) echo _MEX_RESTORE_FAILED; 132 130 133 echo"</td></tr></table>"; 131 134 include("footer.php");
Note:
See TracChangeset
for help on using the changeset viewer.