- Timestamp:
- Mar 5, 2024, 10:09:23 PM (8 months ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/aggiornadb.php
r401 r407 132 132 echo "<br> Il record cookie_law.php Ú stato eliminato dalla tabella dei widget, usare privacy.php<br>"; 133 133 } else echo "<br><span style=\"color: green;\">- La tabella ".$prefix."_ele_widget non richiede questo aggiornamento</span><br>"; 134 135 136 if(!controllo($prefix.'_ele_con_comune','proiezione',++$num)) 137 { 138 $sql="ALTER TABLE `".$prefix."_ele_cons_comune` ADD `proiezione` ENUM('0','1') NOT NULL DEFAULT '0' AFTER `disgiunto`"; 139 $ret=aggiorna($sql,$dbi,'',$num); 140 $sql="update `".$prefix."_ele_cons_comune` set proiezione='1' where chiusa='1' and id_conf=4"; 141 $ret=aggiorna($sql,$dbi,'',$num); 142 } else echo "<br><span style=\"color: green;\">- La tabella ".$prefix."_cons_comune non richiede questo aggiornamento</span><br>"; 143 134 144 if(!controllo($prefix.'_config','versione',++$num)) 135 145 { -
trunk/admin/modules/Elezioni/ele_associazioni.php
r357 r407 56 56 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=0; 57 57 if (isset($_GET['disgiunto'])) $disgiunto=intval($_GET['disgiunto']); else $disgiunto=0; 58 if (isset($_GET['proiezione'])) $proiezione=intval($_GET['proiezione']); else $proiezione=0; 58 59 59 60 $offset=15; … … 66 67 // 67 68 function all() { 68 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 ;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 70 $aid=$_SESSION['aid']; 70 71 $prefix=$_SESSION['prefix']; … … 139 140 echo "<td bgcolor=\"$bgcolor1\"><b>"._CONF."</b></td>"; 140 141 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._FASCIA."</b></td>"; 142 echo "<td bgcolor=\"$bgcolor1\"><b>"._PROIEZIONE."</b></td>"; 141 143 } 142 144 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; … … 189 191 if($tipo_cons==3){ 190 192 if($idcomune) { 191 $sql="SELECT id_fascia from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomune'";193 $sql="SELECT id_fascia,proiezione from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomune'"; 192 194 $rescomu = $dbi->prepare("$sql"); 193 195 $rescomu->execute(); 194 196 if($rescomu->rowCount()) 195 list($fasciacom )=$rescomu->fetch(PDO::FETCH_NUM);197 list($fasciacom,$proiezione)=$rescomu->fetch(PDO::FETCH_NUM); 196 198 else $fasciacom=0; 197 199 } else $fasciacom=0; … … 222 224 } 223 225 echo "</select></td>"; 224 226 echo "<td id=\"proiezione\"><select name=\"proiezione\">"; 227 if ($proiezione) {$sel0='';$sel1='selected';} else {$sel1='';$sel0='selected';} 228 echo "<option value=\"0\" $sel0>No"; 229 echo "<option value=\"1\" $sel1>Si"; 230 echo "</select></td>"; 225 231 226 232 } … … 276 282 echo "<td width=\"20%\" bgcolor=\"$bgcolor1\"><b>"._CONF."</b></td>"; 277 283 echo "<td width=\"20%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._FASCIA."</b></td>"; 284 echo "<td width=\"20%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._PROIEZIONE."</b></td>"; 278 285 } 279 286 echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; … … 284 291 echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b> "._FUNZIONI."</b></td></tr>"; 285 292 286 $sql="SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo,t1.disgiunto FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione";293 $sql="SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo,t1.disgiunto,t1.proiezione FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione"; 287 294 $resmod = $dbi->prepare("$sql"); 288 295 $resmod->execute(); 289 while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf2,$sg2,$disgiunto2 ) = $resmod->fetch(PDO::FETCH_NUM)){ //elenco dei modelli inseriti296 while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf2,$sg2,$disgiunto2,$proiezione) = $resmod->fetch(PDO::FETCH_NUM)){ //elenco dei modelli inseriti 290 297 $sql="SELECT descrizione FROM ".$prefix."_ele_conf where id_conf='$id_conf'"; 291 298 $resconf = $dbi->prepare("$sql"); … … 315 322 $inffascia=$abitanti; 316 323 } 324 if($proiezione) $sceltapro='Si'; else $sceltapro='No'; 325 echo "<td>".$sceltapro."</td>"; 317 326 318 327 } … … 343 352 344 353 function associazioni($ok, $do,$descr_comu,$id_cons_comu,$id_collegio,$id_comune,$chiusa,$id_conf,$preferenze) { 345 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg,$disgiunto ;354 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg,$disgiunto,$proiezione; 346 355 $delcons=0; 347 356 if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) { … … 352 361 list($delcons)=$rescomu->fetch(PDO::FETCH_NUM); 353 362 if (!$max){ //se no la inserisce 354 $sql="insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf,solo_gruppo,disgiunto ) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf','$sg','$disgiunto')";363 $sql="insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf,solo_gruppo,disgiunto,proiezione) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf','$sg','$disgiunto','$proiezione')"; 355 364 $result = $dbi->prepare("$sql"); 356 365 $result->execute(); … … 375 384 $result = $dbi->prepare("$sql"); 376 385 $result->execute(); 377 $sql="update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf',solo_gruppo='$sg',disgiunto='$disgiunto' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'";386 $sql="update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf',solo_gruppo='$sg',disgiunto='$disgiunto',proiezione='$proiezione' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"; 378 387 $result = $dbi->prepare("$sql"); 379 388 $result->execute(); -
trunk/admin/modules/Elezioni/ele_voti.php
r384 r407 332 332 if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista=''; 333 333 if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff=''; 334 echo "<div data-role=\"content\" data-theme=\"a\"><hr><h2>Sezione n. $num_sez</h2><table style=\"margin-left:auto; margin-right:auto;\"><tr>"; 334 echo "<div data-role=\"content\" data-theme=\"a\"><hr><h2>Sezione n. $num_sez"; 335 $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'"; 336 $res = $dbi->prepare("$sql"); 337 $res->execute(); 338 list($chiusa) = $res->fetch(PDO::FETCH_NUM); 339 if ($chiusa) echo " -- CONSULTAZIONE NON ATTIVA"; 340 echo "</h2><table style=\"margin-left:auto; margin-right:auto;\"><tr>"; 335 341 #<a href=\"admin.php?id_comune=$id_comune&id_cons_gen=$id_cons_gen&ops=1\"></a> 336 342 echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=1');\"><p style=\"margin-left:10px;margin-right:10px;\"><font color=\"$tcolora\"><b>"._AFFLUENZE."</font></b></p></td>\n"; -
trunk/admin/modules/Elezioni/language/lang-it.php
r389 r407 42 42 define("_SOLO_GRUPPO","Voti al solo candidato Sindaco"); 43 43 define("_DESCRCONS","COMUNALI"); 44 define("_PROIEZIONE","Proiezione<br>Consiglio"); 44 45 break; 45 46 case 4: -
trunk/admin/modules/Elezioni/salva_aff.php
r358 r407 45 45 46 46 $salvato=0; 47 $query="select id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$id_comune'";47 $query="select id_cons,chiusa from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$id_comune'"; 48 48 $res = $dbi->prepare("$query"); 49 49 $res->execute(); 50 list($id_cons)=$res->fetch(PDO::FETCH_NUM); 51 $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'"; 52 $res = $dbi->prepare("$query"); 53 $res->execute(); 54 $righe=$res->rowCount(); 55 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 56 if($righe){ #la riga Ú presente e viene aggiorata 57 $arr=$res->fetch(PDO::FETCH_BOTH); 58 $sql="update ".$prefix."_ele_voti_parziale set voti_uomini='$voti_u',voti_donne='$voti_d',voti_complessivi='$voti_t' where id_parz='$id_parz'"; 59 $compl = $dbi->prepare("$sql"); 60 $compl->execute(); 61 if($compl->rowCount()) $salvato=1; 62 if($delete=="true"){ 63 $sql="delete from ".$prefix."_ele_voti_parziale where id_parz='$id_parz'"; 50 list($id_cons,$chiusa)=$res->fetch(PDO::FETCH_NUM); 51 if(!$chiusa){ 52 $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'"; 53 $res = $dbi->prepare("$query"); 54 $res->execute(); 55 $righe=$res->rowCount(); 56 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 57 if($righe){ #la riga Ú presente e viene aggiorata 58 $arr=$res->fetch(PDO::FETCH_BOTH); 59 $sql="update ".$prefix."_ele_voti_parziale set voti_uomini='$voti_u',voti_donne='$voti_d',voti_complessivi='$voti_t' where id_parz='$id_parz'"; 60 $compl = $dbi->prepare("$sql"); 61 $compl->execute(); 62 if($compl->rowCount()) $salvato=1; 63 if($delete=="true"){ 64 $sql="delete from ".$prefix."_ele_voti_parziale where id_parz='$id_parz'"; 65 $res = $dbi->prepare("$sql"); 66 $res->execute(); 67 if($res->rowCount()) $salvato=1; 68 } 69 }else{ # Ú un nuovo inserimento 70 $sql="insert into ".$prefix."_ele_voti_parziale values ('$id_cons', '$id_sez','0','$orario','$data','$voti_u','$voti_d','$voti_t','$id_gruppo')"; 64 71 $res = $dbi->prepare("$sql"); 65 72 $res->execute(); 66 if($res->rowCount()) $salvato=1; 73 if($res->rowCount()) $salvato=1; 67 74 } 68 }else{ # Ú un nuovo inserimento 69 $sql="insert into ".$prefix."_ele_voti_parziale values ('$id_cons', '$id_sez','0','$orario','$data','$voti_u','$voti_d','$voti_t','$id_gruppo')"; 70 $res = $dbi->prepare("$sql"); 71 $res->execute(); 72 if($res->rowCount()) $salvato=1; 75 if ($fileout) { 76 while (!$fp = fopen($fileout,"a")); 77 fwrite($fp,"$sql;\n"); 78 fclose($fp); 79 } 80 if($salvato){ 81 $riga=addslashes($sql); 82 $sqlog="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$data','$orario','','$riga','".$prefix."_ele_voti_parziale')"; 83 $res = $dbi->prepare("$sqlog"); 84 $res->execute(); 85 } 86 #controllo_aff($id_cons,$id_sez,$id_parz); 87 include("ele_controlli.php"); 88 controllo_aff($id_cons,$id_sez,$id_parz); 89 include("ele_colora_sez.php"); 73 90 } 74 if ($fileout) {75 while (!$fp = fopen($fileout,"a"));76 fwrite($fp,"$sql;\n");77 fclose($fp);78 }79 if($salvato){80 $riga=addslashes($sql);81 $sqlog="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$data','$orario','','$riga','".$prefix."_ele_voti_parziale')";82 $res = $dbi->prepare("$sqlog");83 $res->execute();84 }85 #controllo_aff($id_cons,$id_sez,$id_parz);86 include("ele_controlli.php");87 controllo_aff($id_cons,$id_sez,$id_parz);88 include("ele_colora_sez.php");89 91 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 90 92 -
trunk/admin/modules/Elezioni/salva_gruppi.php
r358 r407 44 44 45 45 global $prefix,$id_parz,$fileout; 46 $sql="SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'";46 $sql="SELECT disgiunto,chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 47 47 $res = $dbi->prepare("$sql"); 48 48 $res->execute(); 49 list($tipo_cons) = $res->fetch(PDO::FETCH_NUM); 50 $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' "; 51 $res = $dbi->prepare("$sql"); 52 $res->execute(); 53 list($circo)=$res->fetch(PDO::FETCH_NUM); 49 list($disgiunto,$chiusa)=$res->fetch(PDO::FETCH_NUM); 50 if(!$chiusa){ 51 $sql="SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'" ; 52 $res = $dbi->prepare("$sql"); 53 $res->execute(); 54 list($tipo_cons) = $res->fetch(PDO::FETCH_NUM); 55 $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' "; 56 $res = $dbi->prepare("$sql"); 57 $res->execute(); 58 list($circo)=$res->fetch(PDO::FETCH_NUM); 54 59 55 if ($circo) $circo="and id_circ=$id_circ"; else $circo='';56 $sql="select num_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo ";57 $result = $dbi->prepare("$sql");58 $result->execute();59 while(list($i)=$result->fetch(PDO::FETCH_BOTH)) {60 $vot="voti$i";$solo="solog$i";$grupp="num_gruppo$i";61 if (isset($_GET[$grupp])) $num_gruppo[$i]=intval($_GET[$grupp]); else $num_gruppo[$i]='0';62 if (isset($_GET[$vot]) && $_GET[$vot]) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0';63 if (isset($_GET[$solo])) $solog[$i]=intval($_GET[$solo]); else $solog[$i]='0';60 if ($circo) $circo="and id_circ=$id_circ"; else $circo=''; 61 $sql="select num_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo "; 62 $result = $dbi->prepare("$sql"); 63 $result->execute(); 64 while(list($i)=$result->fetch(PDO::FETCH_BOTH)) { 65 $vot="voti$i";$solo="solog$i";$grupp="num_gruppo$i"; 66 if (isset($_GET[$grupp])) $num_gruppo[$i]=intval($_GET[$grupp]); else $num_gruppo[$i]='0'; 67 if (isset($_GET[$vot]) && $_GET[$vot]) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 68 if (isset($_GET[$solo])) $solog[$i]=intval($_GET[$solo]); else $solog[$i]='0'; 64 69 65 }70 } 66 71 67 if (!isset($fileout)) $fileout='';68 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d;69 if ($fileout) while (!$fp = fopen($fileout,"a"));72 if (!isset($fileout)) $fileout=''; 73 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d; 74 if ($fileout) while (!$fp = fopen($fileout,"a")); 70 75 71 ################## 72 if($do==1) { 73 $sql="delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'"; 74 $res = $dbi->prepare("$sql"); 75 $res->execute(); 76 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 77 $res = $dbi->prepare("$sql"); 78 $res->execute(); 79 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'"; 80 $res = $dbi->prepare("$sql"); 81 $res->execute(); 82 $sql="update ".$prefix."_ele_sezioni set validi_lista='0',contestati_lista='0',voti_nulli_lista='0',solo_gruppo='0',solo_lista='0' where id_cons='$id_cons' and id_sez='$id_sez'"; 83 $res = $dbi->prepare("$sql"); 84 $res->execute(); 85 }else{ 86 $sql="SELECT disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 87 $res = $dbi->prepare("$sql"); 88 $res->execute(); 89 list($disgiunto)=$res->fetch(PDO::FETCH_NUM); 90 if($disgiunto){ 91 } 92 $sql="update ".$prefix."_ele_sezioni set solo_lista='$sololista' where id_cons='$id_cons' and id_sez='$id_sez'"; 93 $result = $dbi->prepare("$sql"); 94 $result->execute(); 95 $sql="select num_gruppo from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'"; 96 $result = $dbi->prepare("$sql"); 97 $result->execute(); 98 if($result->rowCount()) { 99 while(list($i)=$result->fetch(PDO::FETCH_NUM)){ 100 $sql="update ".$prefix."_ele_voti_gruppo set voti='".$voti[$i]."',solo_gruppo='".$solog[$i]."' where id_cons='$id_cons' and id_sez='$id_sez' and num_gruppo='".$num_gruppo[$i]."'"; 101 $res = $dbi->prepare("$sql"); 102 $res->execute(); 76 ################## 77 if($do==1) { 78 $sql="delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'"; 79 $res = $dbi->prepare("$sql"); 80 $res->execute(); 81 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 82 $res = $dbi->prepare("$sql"); 83 $res->execute(); 84 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'"; 85 $res = $dbi->prepare("$sql"); 86 $res->execute(); 87 $sql="update ".$prefix."_ele_sezioni set validi_lista='0',contestati_lista='0',voti_nulli_lista='0',solo_gruppo='0',solo_lista='0' where id_cons='$id_cons' and id_sez='$id_sez'"; 88 $res = $dbi->prepare("$sql"); 89 $res->execute(); 90 }else{ 91 if($disgiunto){ 103 92 } 104 }else{ 105 $sql="select num_gruppo,id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo"; 93 $sql="update ".$prefix."_ele_sezioni set solo_lista='$sololista' where id_cons='$id_cons' and id_sez='$id_sez'"; 106 94 $result = $dbi->prepare("$sql"); 107 95 $result->execute(); 108 while(list($i,$id_gruppo)=$result->fetch(PDO::FETCH_NUM)){ 109 $sql="insert into ".$prefix."_ele_voti_gruppo values('$id_cons','$id_gruppo','$id_sez','$i','".$voti[$i]."','".$solog[$i]."')"; 110 $res = $dbi->prepare("$sql"); 111 $res->execute(); 96 $sql="select num_gruppo from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'"; 97 $result = $dbi->prepare("$sql"); 98 $result->execute(); 99 if($result->rowCount()) { 100 while(list($i)=$result->fetch(PDO::FETCH_NUM)){ 101 $sql="update ".$prefix."_ele_voti_gruppo set voti='".$voti[$i]."',solo_gruppo='".$solog[$i]."' where id_cons='$id_cons' and id_sez='$id_sez' and num_gruppo='".$num_gruppo[$i]."'"; 102 $res = $dbi->prepare("$sql"); 103 $res->execute(); 104 } 105 }else{ 106 $sql="select num_gruppo,id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo"; 107 $result = $dbi->prepare("$sql"); 108 $result->execute(); 109 while(list($i,$id_gruppo)=$result->fetch(PDO::FETCH_NUM)){ 110 $sql="insert into ".$prefix."_ele_voti_gruppo values('$id_cons','$id_gruppo','$id_sez','$i','".$voti[$i]."','".$solog[$i]."')"; 111 $res = $dbi->prepare("$sql"); 112 $res->execute(); 113 } 114 112 115 } 113 114 } 116 } 117 include("ele_controlli.php"); 118 controllo_votig($id_cons,$id_sez,$genere); 119 include("ele_colora_sez.php"); 120 if ($fileout) fclose($fp); 115 121 } 116 117 118 include("ele_controlli.php");119 controllo_votig($id_cons,$id_sez,$genere);120 include("ele_colora_sez.php");121 122 if ($fileout) fclose($fp);123 122 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 124 123 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); -
trunk/admin/modules/Elezioni/salva_liste.php
r360 r407 50 50 51 51 global $prefix,$id_parz,$fileout; 52 $sql="SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'";52 $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 53 53 $res = $dbi->prepare("$sql"); 54 54 $res->execute(); 55 list($tipo_cons) = $res->fetch(PDO::FETCH_NUM); 56 $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' "; 57 $res = $dbi->prepare("$sql"); 58 $res->execute(); 59 list($circo)=$res->fetch(PDO::FETCH_NUM); 60 if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 61 if($id_lista){ 62 $sql="select num_cand,id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista' ORDER BY num_cand "; 63 $result = $dbi->prepare("$sql"); 64 $result->execute(); 65 while(list($i,$y)=$result->fetch(PDO::FETCH_NUM)) { 66 $vot="voti$i";$cand="id_cand$i"; 67 if (isset($_GET[$cand])) $idcand[$i]=intval($_GET[$cand]); else $idcand[$i]=$y; 68 if (isset($_GET[$vot])) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 69 # if (isset($_GET[$solo])) $solog[$i]=intval($_GET[$solo]); else $solog[$i]='0'; 55 list($chiusa)=$res->fetch(PDO::FETCH_NUM); 56 if(!$chiusa){ 57 $sql="SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'" ; 58 $res = $dbi->prepare("$sql"); 59 $res->execute(); 60 list($tipo_cons) = $res->fetch(PDO::FETCH_NUM); 61 $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' "; 62 $res = $dbi->prepare("$sql"); 63 $res->execute(); 64 list($circo)=$res->fetch(PDO::FETCH_NUM); 65 if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 66 if($id_lista){ 67 $sql="select num_cand,id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista' ORDER BY num_cand "; 68 $result = $dbi->prepare("$sql"); 69 $result->execute(); 70 while(list($i,$y)=$result->fetch(PDO::FETCH_NUM)) { 71 $vot="voti$i";$cand="id_cand$i"; 72 if (isset($_GET[$cand])) $idcand[$i]=intval($_GET[$cand]); else $idcand[$i]=$y; 73 if (isset($_GET[$vot])) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 74 # if (isset($_GET[$solo])) $solog[$i]=intval($_GET[$solo]); else $solog[$i]='0'; 70 75 76 } 77 }else{ 78 $sql="select num_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco ORDER BY num_lista "; 79 $result = $dbi->prepare("$sql"); 80 $result->execute(); 81 $sololiste=0; 82 while(list($i)=$result->fetch(PDO::FETCH_NUM)) { 83 $vot="voti$i";$vnp="vnpl$i";$slp="slpl$i";$idlist="id_lista$i"; 84 if (isset($_GET[$vnp])) $vnpl[$i]=intval($_GET[$vnp]); else $vnpl[$i]='0'; 85 if (isset($_GET[$vot])) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 86 if (isset($_GET[$slp])) $slpl[$i]=intval($_GET[$slp]); else $slpl[$i]='0'; 87 if (isset($_GET[$idlist])) $idlista[$i]=intval($_GET[$idlist]); else $idlista[$i]='0'; 88 $sololiste+=$slpl[$i]; 89 } 71 90 } 72 }else{ 73 $sql="select num_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco ORDER BY num_lista "; 74 $result = $dbi->prepare("$sql"); 75 $result->execute(); 76 $sololiste=0; 77 while(list($i)=$result->fetch(PDO::FETCH_NUM)) { 78 $vot="voti$i";$vnp="vnpl$i";$slp="slpl$i";$idlist="id_lista$i"; 79 if (isset($_GET[$vnp])) $vnpl[$i]=intval($_GET[$vnp]); else $vnpl[$i]='0'; 80 if (isset($_GET[$vot])) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 81 if (isset($_GET[$slp])) $slpl[$i]=intval($_GET[$slp]); else $slpl[$i]='0'; 82 if (isset($_GET[$idlist])) $idlista[$i]=intval($_GET[$idlist]); else $idlista[$i]='0'; 83 $sololiste+=$slpl[$i]; 84 } 85 } 86 if (!isset($fileout)) $fileout=''; 87 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d; 88 if ($fileout) while (!$fp = fopen($fileout,"a")); 91 if (!isset($fileout)) $fileout=''; 92 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d; 93 if ($fileout) while (!$fp = fopen($fileout,"a")); 89 94 90 ##################91 # if($id_lista){95 ################## 96 # if($id_lista){ 92 97 93 #$andlis="and 94 if($pwd3==1) { 95 if($id_lista) $condiz="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista')"; else $condiz=''; 96 $sql="delete from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' $condiz"; 97 $res = $dbi->prepare("$sql"); 98 $res->execute(); 99 $sql="delete from ".$prefix."_ele_controlli where tipo='candidato' and id_sez='$id_sez' "; 100 $res = $dbi->prepare("$sql"); 101 $res->execute(); 102 if(!$id_lista){ 103 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 98 #$andlis="and 99 if($pwd3==1) { 100 if($id_lista) $condiz="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista')"; else $condiz=''; 101 $sql="delete from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' $condiz"; 104 102 $res = $dbi->prepare("$sql"); 105 103 $res->execute(); 106 $sql="delete from ".$prefix."_ele_controlli where tipo=' lista' and id_sez='$id_sez' ";104 $sql="delete from ".$prefix."_ele_controlli where tipo='candidato' and id_sez='$id_sez' "; 107 105 $res = $dbi->prepare("$sql"); 108 106 $res->execute(); 109 $sql="update ".$prefix."_ele_sezioni set validi_lista='0',contestati_lista='0',voti_nulli_lista='0',solo_gruppo='0',solo_lista='0' where id_cons='$id_cons' and id_sez='$id_sez'"; 110 $res = $dbi->prepare("$sql"); 111 $res->execute(); 112 } 113 114 }elseif($id_lista){ 107 if(!$id_lista){ 108 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 109 $res = $dbi->prepare("$sql"); 110 $res->execute(); 111 $sql="delete from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' "; 112 $res = $dbi->prepare("$sql"); 113 $res->execute(); 114 $sql="update ".$prefix."_ele_sezioni set validi_lista='0',contestati_lista='0',voti_nulli_lista='0',solo_gruppo='0',solo_lista='0' where id_cons='$id_cons' and id_sez='$id_sez'"; 115 $res = $dbi->prepare("$sql"); 116 $res->execute(); 117 } 118 119 }elseif($id_lista){ 115 120 116 foreach($idcand as $idkey=>$idc){ 117 $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'"; 118 $result = $dbi->prepare("$sql"); 119 $result->execute(); 120 if($result->rowCount()) 121 $sql="update ".$prefix."_ele_voti_candidati set voti='".$voti[$idkey]."' where id_sez='$id_sez' and id_cand='$idc'"; 122 else 123 $sql="insert into ".$prefix."_ele_voti_candidati values('$id_cons','$idc','$id_sez','$idkey','".$voti[$idkey]."')"; 124 $result = $dbi->prepare("$sql"); 125 $result->execute(); 126 } 127 }else{ 128 $sql="update ".$prefix."_ele_sezioni set validi_lista='$validi',contestati_lista='$contestati',voti_nulli_lista='$votinulli',solo_gruppo='$sg' where id_cons='$id_cons' and id_sez='$id_sez'"; 129 $res = $dbi->prepare("$sql"); 130 $res->execute(); 131 $sql="select num_lista,id_lista from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 132 $result = $dbi->prepare("$sql"); 133 $result->execute(); 134 if($result->rowCount()){ 135 $sql="select num_lista,id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco"; 121 foreach($idcand as $idkey=>$idc){ 122 $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'"; 136 123 $result = $dbi->prepare("$sql"); 137 124 $result->execute(); 138 while(list($i,$idl)=$result->fetch(PDO::FETCH_NUM)){ 139 $sql="update ".$prefix."_ele_voti_lista set num_lista='$i',voti='".$voti[$i]."',nulli_lista='".$vnpl[$i]."',solo_lista='".$slpl[$i]."' where num_lista='$i' and id_sez='$id_sez'"; 140 $res = $dbi->prepare("$sql"); 141 $res->execute(); 142 } 143 144 }else{ 145 146 $sql="select num_lista,id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco"; 125 if($result->rowCount()) 126 $sql="update ".$prefix."_ele_voti_candidati set voti='".$voti[$idkey]."' where id_sez='$id_sez' and id_cand='$idc'"; 127 else 128 $sql="insert into ".$prefix."_ele_voti_candidati values('$id_cons','$idc','$id_sez','$idkey','".$voti[$idkey]."')"; 147 129 $result = $dbi->prepare("$sql"); 148 130 $result->execute(); 149 while(list($i,$idl)=$result->fetch(PDO::FETCH_NUM)){ 150 $sql="insert into ".$prefix."_ele_voti_lista values('$id_cons','$idl','$id_sez','$i','".$voti[$i]."','".$vnpl[$i]."','".$slpl[$i]."')"; 151 $res = $dbi->prepare("$sql"); 152 $res->execute(); 131 } 132 }else{ 133 $sql="update ".$prefix."_ele_sezioni set validi_lista='$validi',contestati_lista='$contestati',voti_nulli_lista='$votinulli',solo_gruppo='$sg' where id_cons='$id_cons' and id_sez='$id_sez'"; 134 $res = $dbi->prepare("$sql"); 135 $res->execute(); 136 $sql="select num_lista,id_lista from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 137 $result = $dbi->prepare("$sql"); 138 $result->execute(); 139 if($result->rowCount()){ 140 $sql="select num_lista,id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco"; 141 $result = $dbi->prepare("$sql"); 142 $result->execute(); 143 while(list($i,$idl)=$result->fetch(PDO::FETCH_NUM)){ 144 $sql="update ".$prefix."_ele_voti_lista set num_lista='$i',voti='".$voti[$i]."',nulli_lista='".$vnpl[$i]."',solo_lista='".$slpl[$i]."' where num_lista='$i' and id_sez='$id_sez'"; 145 $res = $dbi->prepare("$sql"); 146 $res->execute(); 147 } 148 149 }else{ 150 151 $sql="select num_lista,id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $iscirco"; 152 $result = $dbi->prepare("$sql"); 153 $result->execute(); 154 while(list($i,$idl)=$result->fetch(PDO::FETCH_NUM)){ 155 $sql="insert into ".$prefix."_ele_voti_lista values('$id_cons','$idl','$id_sez','$i','".$voti[$i]."','".$vnpl[$i]."','".$slpl[$i]."')"; 156 $res = $dbi->prepare("$sql"); 157 $res->execute(); 158 } 153 159 } 154 } 155 } 156 157 158 159 include("ele_controlli.php"); 160 controllo_votil($id_cons,$id_sez,$id_lista); 161 include("ele_colora_sez.php"); 162 163 if ($fileout) fclose($fp); 160 } 161 include("ele_controlli.php"); 162 controllo_votil($id_cons,$id_sez,$id_lista); 163 include("ele_colora_sez.php"); 164 if ($fileout) fclose($fp); 165 } 164 166 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 165 167 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 166 168 167 168 169 170 169 ################################# 171 172 173 174 175 176 177 178 170 ?> -
trunk/admin/modules/Elezioni/salva_ref.php
r366 r407 43 43 44 44 global $prefix,$id_parz,$fileout; 45 $sql="select num_gruppo,id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' ORDER BY num_gruppo "; 46 $resultg = $dbi->prepare("$sql"); 47 $resultg->execute(); 45 $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 46 $res = $dbi->prepare("$sql"); 47 $res->execute(); 48 list($chiusa)=$res->fetch(PDO::FETCH_NUM); 49 if(!$chiusa){ 50 $sql="select num_gruppo,id_gruppo from ".$prefix."_ele_gruppo where id_cons='$id_cons' ORDER BY num_gruppo "; 51 $resultg = $dbi->prepare("$sql"); 52 $resultg->execute(); 48 53 49 if (!isset($fileout)) $fileout='';54 if (!isset($fileout)) $fileout=''; 50 55 51 if ($fileout) while (!$fp = fopen($fileout,"a"));56 if ($fileout) while (!$fp = fopen($fileout,"a")); 52 57 53 ##################54 if($do==1) {55 $sql="delete from ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez=$id_sez";56 $res = $dbi->prepare("$sql");57 $res->execute();58 $sql="delete from ".$prefix."_ele_controlli where id_cons='$id_cons' and id_sez=$id_sez";59 $res = $dbi->prepare("$sql");60 $res->execute();61 }else{62 while(list($i,$idgruppo)=$resultg->fetch(PDO::FETCH_BOTH)) {63 $gruv="id_gruppo$i";$siv="si$i";$nov="no$i";$valv="val$i";$biav="bia$i";$conv="con$i";$nulv="nul$i";64 if($_GET[$siv]=='' and $_GET[$nov]=='' and $_GET[$biav]=='' and $_GET[$conv]=='' and $_GET[$nulv]=='') continue;65 if (isset($_GET[$gruv])) $id_gruppo[$i]=intval($_GET[$gruv]); else $id_gruppo[$i]='0';66 if (isset($_GET[$siv])) $si[$i]=intval($_GET[$siv]); else $si[$i]='0';67 if (isset($_GET[$nov])) $no[$i]=intval($_GET[$nov]); else $no[$i]='0';68 if (isset($_GET[$valv])) $val[$i]=intval($_GET[$valv]); else $val[$i]='0';69 if (isset($_GET[$biav])) $bia[$i]=intval($_GET[$biav]); else $bia[$i]='0';70 if (isset($_GET[$conv])) $con[$i]=intval($_GET[$conv]); else $con[$i]='0';71 if (isset($_GET[$nulv])) $nul[$i]=intval($_GET[$nulv]); else $nul[$i]='0';58 ################## 59 if($do==1) { 60 $sql="delete from ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez=$id_sez"; 61 $res = $dbi->prepare("$sql"); 62 $res->execute(); 63 $sql="delete from ".$prefix."_ele_controlli where id_cons='$id_cons' and id_sez=$id_sez"; 64 $res = $dbi->prepare("$sql"); 65 $res->execute(); 66 }else{ 67 while(list($i,$idgruppo)=$resultg->fetch(PDO::FETCH_BOTH)) { 68 $gruv="id_gruppo$i";$siv="si$i";$nov="no$i";$valv="val$i";$biav="bia$i";$conv="con$i";$nulv="nul$i"; 69 if($_GET[$siv]=='' and $_GET[$nov]=='' and $_GET[$biav]=='' and $_GET[$conv]=='' and $_GET[$nulv]=='') continue; 70 if (isset($_GET[$gruv])) $id_gruppo[$i]=intval($_GET[$gruv]); else $id_gruppo[$i]='0'; 71 if (isset($_GET[$siv])) $si[$i]=intval($_GET[$siv]); else $si[$i]='0'; 72 if (isset($_GET[$nov])) $no[$i]=intval($_GET[$nov]); else $no[$i]='0'; 73 if (isset($_GET[$valv])) $val[$i]=intval($_GET[$valv]); else $val[$i]='0'; 74 if (isset($_GET[$biav])) $bia[$i]=intval($_GET[$biav]); else $bia[$i]='0'; 75 if (isset($_GET[$conv])) $con[$i]=intval($_GET[$conv]); else $con[$i]='0'; 76 if (isset($_GET[$nulv])) $nul[$i]=intval($_GET[$nulv]); else $nul[$i]='0'; 72 77 73 $sql="select num_gruppo from ".$prefix."_ele_voti_ref where id_gruppo='$idgruppo' and id_sez=$id_sez"; 74 $result = $dbi->prepare("$sql"); 75 $result->execute(); 76 if($result->rowCount()) { 77 $sql="update ".$prefix."_ele_voti_ref set si='".$si[$i]."',no='".$no[$i]."',validi='".$val[$i]."',bianchi='".$bia[$i]."',contestati='".$con[$i]."',nulli='".$nul[$i]."' where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='".$id_gruppo[$i]."'"; 78 $res = $dbi->prepare("$sql"); 79 $res->execute(); 80 }elseif($val[$i]!=''){ 81 $sql="insert into ".$prefix."_ele_voti_ref values('$id_cons','$idgruppo','$id_sez','$i','".$si[$i]."','".$no[$i]."','".$val[$i]."','".$nul[$i]."','".$bia[$i]."','".$con[$i]."')"; 82 $res = $dbi->prepare("$sql"); 83 $res->execute(); 84 78 $sql="select num_gruppo from ".$prefix."_ele_voti_ref where id_gruppo='$idgruppo' and id_sez=$id_sez"; 79 $result = $dbi->prepare("$sql"); 80 $result->execute(); 81 if($result->rowCount()) { 82 $sql="update ".$prefix."_ele_voti_ref set si='".$si[$i]."',no='".$no[$i]."',validi='".$val[$i]."',bianchi='".$bia[$i]."',contestati='".$con[$i]."',nulli='".$nul[$i]."' where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='".$id_gruppo[$i]."'"; 83 $res = $dbi->prepare("$sql"); 84 $res->execute(); 85 }elseif($val[$i]!=''){ 86 $sql="insert into ".$prefix."_ele_voti_ref values('$id_cons','$idgruppo','$id_sez','$i','".$si[$i]."','".$no[$i]."','".$val[$i]."','".$nul[$i]."','".$bia[$i]."','".$con[$i]."')"; 87 $res = $dbi->prepare("$sql"); 88 $res->execute(); 89 90 } 85 91 } 92 include("ele_controlli.php"); 93 controllo_votir($id_cons,$id_sez); 86 94 } 87 include("ele_controlli.php"); 88 controllo_votir($id_cons,$id_sez); 89 } 90 91 92 93 include("ele_colora_sez.php"); 94 if ($fileout) fclose($fp); 95 include("ele_colora_sez.php"); 96 if ($fileout) fclose($fp); 97 } 95 98 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 96 99 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 97 100 ################################# 98 101 99 100 101 102 103 104 105 102 ?> -
trunk/admin/modules/Elezioni/salva_voti.php
r394 r407 43 43 #if(isset($_SESSION['scrutinata'])) $scrutinata=$_SESSION['scrutinata']; #else $scrutinata=false; 44 44 global $prefix,$id_parz,$genere,$fileout,$id_cons; 45 if (!isset($fileout)) $fileout=''; 46 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d; 47 if ($fileout) while (!$fp = fopen($fileout,"a")); 48 49 $salvato=0; 50 51 ################## 52 $sql="select solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 45 $sql="select solo_gruppo,disgiunto,chiusa from ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 53 46 $result = $dbi->prepare("$sql"); 54 47 $result->execute(); 55 list($flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM); 56 $sql="select * from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' "; 57 $result = $dbi->prepare("$sql"); 58 $result->execute(); 59 $ar=$result->fetch(PDO::FETCH_BOTH); 60 $validilista=$validi-$ar['solo_gruppo']; 61 $log_data= date("Y/m/d"); 62 $log_ora=getdate(time()); 63 $orario=($log_ora['hours'].":".$log_ora['minutes'].":".$log_ora['seconds']); 48 list($flagsg,$disgiunto,$chiusa)=$result->fetch(PDO::FETCH_NUM); 49 if(!$chiusa){ 50 if (!isset($fileout)) $fileout=''; 51 #if(($voti_u+$voti_d) and !$voti_t) $voti_t=$voti_u+$voti_d; 52 if ($fileout) while (!$fp = fopen($fileout,"a")); 64 53 65 #if($ops==3 and ($genere==3 or $genere==4 or $genere==5) and ($votog or $genere==4)){ 66 $sql="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$aid','$log_data','$orario','validi_lista:$ar[14] nulli:$ar[7] bianchi:$ar[8] ','validi_lista=$validilista, nulli=$nulli,bianchi=$bianchi','_ele_sezioni')"; 67 $res = $dbi->prepare("$sql"); 68 $res->execute(); 69 $sql="update ".$prefix."_ele_sezioni set validi='$validi', contestati='$contestati', nulli='$nulli',bianchi='$bianchi', voti_nulli='$votinulli' where id_cons='$id_cons' and id_sez='$id_sez' "; 70 $res = $dbi->prepare("$sql"); 71 $res->execute(); 72 if ($fileout) fwrite($fp,"$sql;\n"); 73 ###### 74 #include($sql."TEST: scru=$scrutinata"); 75 if(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)"; 54 $salvato=0; 55 56 ################## 57 58 $sql="select * from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' "; 59 $result = $dbi->prepare("$sql"); 60 $result->execute(); 61 $ar=$result->fetch(PDO::FETCH_BOTH); 62 $validilista=$validi-$ar['solo_gruppo']; 63 $log_data= date("Y/m/d"); 64 $log_ora=getdate(time()); 65 $orario=($log_ora['hours'].":".$log_ora['minutes'].":".$log_ora['seconds']); 66 67 #if($ops==3 and ($genere==3 or $genere==4 or $genere==5) and ($votog or $genere==4)){ 68 $sql="insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$aid','$log_data','$orario','validi_lista:$ar[14] nulli:$ar[7] bianchi:$ar[8] ','validi_lista=$validilista, nulli=$nulli,bianchi=$bianchi','_ele_sezioni')"; 90 69 $res = $dbi->prepare("$sql"); 91 $res->execute(); 92 $sql=" insert into ".$prefix."_ele_voti_lista (id_cons,id_sez) values('$id_cons','$id_sez')";70 $res->execute(); 71 $sql="update ".$prefix."_ele_sezioni set validi='$validi', contestati='$contestati', nulli='$nulli',bianchi='$bianchi', voti_nulli='$votinulli' where id_cons='$id_cons' and id_sez='$id_sez' "; 93 72 $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)"; 73 $res->execute(); 74 if ($fileout) fwrite($fp,"$sql;\n"); 75 ###### 76 #include($sql."TEST: scru=$scrutinata"); 77 if(isset($scrutinata)) 78 { 79 $sql="delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and num_gruppo=0"; 96 80 $res = $dbi->prepare("$sql"); 97 $res->execute(); 98 # 99 } 100 } 101 /*}else{ 102 $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')"; 103 $res = $dbi->prepare("$sql"); 104 $res->execute(); 105 $sql="update ".$prefix."_ele_sezioni set validi='$validi', nulli='$nulli',bianchi='$bianchi',contestati='$contestati',voti_nulli='$votinulli' where id_cons='$id_cons' and id_sez='$id_sez' "; 106 $res = $dbi->prepare("$sql"); 107 $res->execute(); 108 if ($fileout) fwrite($fp,"$sql;\n"); */ 109 #} 110 include("ele_controlli.php"); 111 controllo_voti($id_cons,$id_sez); 112 include("ele_colora_sez.php"); 113 114 if ($fileout) fclose($fp); 81 $res->execute(); 82 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez' and num_lista=0"; 83 $res = $dbi->prepare("$sql"); 84 $res->execute(); 85 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez' and num_cand=0"; 86 $res = $dbi->prepare("$sql"); 87 $res->execute(); 88 if($scrutinata==true) 89 { 90 # provare insert dei soli id_cons e id_sez 91 $sql="insert into ".$prefix."_ele_voti_gruppo (id_cons,id_sez,num_gruppo) values('$id_cons','$id_sez',0)"; 92 $res = $dbi->prepare("$sql"); 93 $res->execute(); 94 $sql="insert into ".$prefix."_ele_voti_lista (id_cons,id_sez) values('$id_cons','$id_sez')"; 95 $res = $dbi->prepare("$sql"); 96 $res->execute(); 97 $sql="insert into ".$prefix."_ele_voti_candidati (id_cons,id_sez,num_cand) values('$id_cons','$id_sez',0)"; 98 $res = $dbi->prepare("$sql"); 99 $res->execute(); 100 # 101 } 102 } 103 /*}else{ 104 $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')"; 105 $res = $dbi->prepare("$sql"); 106 $res->execute(); 107 $sql="update ".$prefix."_ele_sezioni set validi='$validi', nulli='$nulli',bianchi='$bianchi',contestati='$contestati',voti_nulli='$votinulli' where id_cons='$id_cons' and id_sez='$id_sez' "; 108 $res = $dbi->prepare("$sql"); 109 $res->execute(); 110 if ($fileout) fwrite($fp,"$sql;\n"); */ 111 #} 112 include("ele_controlli.php"); 113 controllo_voti($id_cons,$id_sez); 114 include("ele_colora_sez.php"); 115 if ($fileout) fclose($fp); 116 } 115 117 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 116 118 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); -
trunk/admin/versione.php
r406 r407 1 1 <?php 2 2 3 $versione = "3.0 rev 40 6";3 $versione = "3.0 rev 407"; 4 4 $version_number = $versione; 5 $datarel = " 28 febbraio 2024";5 $datarel = "05 marzo 2024"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7 -
trunk/client/modules/Elezioni/affluenze-inc.php
r400 r407 179 179 $num_ril= $resril->rowCount(); //numero delle rilevazioni previste 180 180 if(!isset($html)) $html=''; 181 $html .= "<table class=\"td-89\">"; 181 if($csv && $pdf) $tabpdf="style=\"width:45%; margin:0px auto;text-align:center;\""; 182 else $tabpdf=''; 183 $html .= "<table class=\"td-100\" $tabpdf>"; 182 184 $html .= "<tr class=\"bggray\"><td>"._SEZIONI."</td><td>"._ISCR_SEZ."</td>"; 183 185 $sql="SELECT orario,data FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data desc,orario desc limit 0,1"; … … 196 198 # if(($data==$ultdata) and ($ora==$ultora)) 197 199 { 198 $tot[$data.$ora]="<table style=\"width:100%;border:none;\"><tr class=\"bggray2\"><td style=\"width:33%;text-align:center;border:none; \">199 <b>".number_format($votiu,0,',','.')."</b></td><td style=\"width:33%;text-align:center;border:none; \">200 <b>".number_format($votid,0,',','.')."</b></td><td style=\"width:33%;text-align:center;border:none; \">200 $tot[$data.$ora]="<table style=\"width:100%;border:none;\"><tr class=\"bggray2\"><td style=\"width:33%;text-align:center;border:none;max-width:50px;\"> 201 <b>".number_format($votiu,0,',','.')."</b></td><td style=\"width:33%;text-align:center;border:none;max-width:50px;\"> 202 <b>".number_format($votid,0,',','.')."</b></td><td style=\"width:33%;text-align:center;border:none;max-width:50px;\"> 201 203 <b>".number_format($somma,0,',','.')."</b></td> 202 204 </tr></table>"; … … 227 229 $html .= "<br /><table style=\"width:100%;border:none;\"><tr class=\"bggray\">"; 228 230 if ((isset($perc_u[$data1.$ora1]) or isset($perc_d[$data1.$ora1])) and ($perc_u[$data1.$ora1]+$perc_d[$data1.$ora1])>0) 229 $html .= "<th style=\"width:28%;text-align:center;border:none;\">"._UOMINI."</th><th style=\"width:28%;text-align:center;border:none;\">"._DONNE."</th>"; 230 $html .= "<th style=\"width:28%;text-align:center;border:none;\">"._COMPLESSIVI."</th></tr></table></td>"; 231 $html .= "<th style=\"width:33%;max-width:100px;text-align:center;border:none;\">"._UOMINI."</th><th style=\"width:33%;max-width:50px;text-align:center;border:none;\">"._DONNE."</th><th style=\"width:33%;max-width:150px;text-align:center;border:none;\">"._COMPLESSIVI."</th></tr></table></td>"; 232 233 else $html .= "<th style=\"width:150px;text-align:center;border:none;\">"._COMPLESSIVI."</th></tr></table></td>"; 231 234 232 235 if (isset($tot[$data1.$ora1])){ … … 234 237 if (($perc_u[$data1.$ora1] or $perc_d[$data1.$ora1])){ 235 238 $ar['perc'][$data1.$ora1]="<table style=\"width:100%;border:none;\"><tr class=\"bggray2\"> 236 <td style=\"width:33%;text-align:center;border:none; \"><b><i><span class=\"red\">".$perc_u[$data1.$ora1]."%</span></i></b></td>237 <td style=\"width:33%;text-align:center;border:none; \"><b><i><span class=\"red\">".$perc_d[$data1.$ora1]."%</span></i></b></td>238 <td style=\"width:33%;text-align:center;border:none; \" ><span class=\"red\"><b><i>".$perc_c[$data1.$ora1]."%</i></b></span></td>239 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\"><b><i><span class=\"red\">".$perc_u[$data1.$ora1]."%</span></i></b></td> 240 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\"><b><i><span class=\"red\">".$perc_d[$data1.$ora1]."%</span></i></b></td> 241 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\" ><span class=\"red\"><b><i>".$perc_c[$data1.$ora1]."%</i></b></span></td> 239 242 </tr></table>"; 240 243 $ar[0][$data1.$ora1]=$tot[$data1.$ora1]; … … 270 273 if(($uomini+$donne)>0) 271 274 $ar[$numsez][$data.$ora]="<table style=\"width:100%;border:none;\"><tr> 272 <td style=\"width:33%;text-align:center;border:none; \">$uomini</td>273 <td style=\"width:33%;text-align:center;border:none; \">$donne</td>274 <td style=\"width:33%;text-align:center;border:none; \">$complessivi</td>275 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\">$uomini</td> 276 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\">$donne</td> 277 <td style=\"width:33%;text-align:center;border:none;max-width:50px;\">$complessivi</td> 275 278 </tr></table>"; 276 279 else … … 285 288 foreach ($arr as $valore) 286 289 { 287 $html .= "<td >$valore</td>";290 $html .= "<td style=\"max-width:33%;text-align:center;border:none;\">$valore</td>"; 288 291 } 289 292 $html .= "</tr>"; … … 311 314 if($csv==1){ 312 315 $data=date("d-m-y G:i"); 313 $style .="\t\t\n<br/><br/><br/>< div style=\"margin:0px auto;text-align:center;\"><i>Stampato: $data</i></div>";314 $style .="<br/><div style=\"text-align:center;\"><i>Eleonline by luciano apolito e roberto gigli - www.eleonline.it</i></div> ";316 $style .="\t\t\n<br/><br/><br/><table style=\"width:50%; margin:0px auto;text-align:center;\"><tr><td><div style=\"margin:0px auto;text-align:center;\"><i>Stampato: $data</i></div>"; 317 $style .="<br/><div style=\"text-align:center;\"><i>Eleonline by luciano apolito e roberto gigli - www.eleonline.it</i></div></td></tr></table>"; 315 318 $style .= "<br/> "; 316 319 } -
trunk/client/modules/Elezioni/affluenze.php
r400 r407 34 34 $nomefile="$descr_cons affluenze.pdf"; 35 35 $stampa ="$datipdf $html $style"; 36 if($vismf)36 # if($vismf) 37 37 $html2pdf = new Html2Pdf('L','A4', 'it'); 38 else39 $html2pdf = new Html2Pdf('P','A4', 'it');38 # else 39 # $html2pdf = new Html2Pdf('P','A4', 'it'); 40 40 $html2pdf->WriteHTML($stampa, isset($_GET['vuehtml'])); 41 41 $html2pdf->Output($nomefile); -
trunk/client/modules/Elezioni/blocchi/04_sezioni.php
r347 r407 73 73 if ($genere==0) $pos="gruppo_sezione";elseif($genere=='4' || $votog) $pos="lista_sezione"; 74 74 else $pos="gruppo_sezione"; 75 76 $html .="<td style=\"margin:0px auto; text-align:center; width:5%;background-color:$bgsez;\" ><ahref=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&perc=true&file=index&op=$pos&minsez=$sez_num&offsetsez=$sez_num\"><b>$sez_num</b></a></td>";75 76 $html .="<td style=\"margin:0px auto; text-align:center; width:5%;background-color:$bgsez;\"><a style=\"background-color:$bgsez;\" href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&perc=true&file=index&op=$pos&minsez=$sez_num&offsetsez=$sez_num\"><b>$sez_num</b></a></td>"; 77 77 78 78 if (($i%5) ==0) $html .="</tr>\n<tr>"; -
trunk/client/temi/Futura2/index.php
r371 r407 151 151 152 152 function footer_mon(){ 153 global $id_comune,$id_cons_gen,$tema,$colortheme,$rss; 153 global $id_comune,$id_cons_gen,$tema,$colortheme,$rss,$prefix,$dbi; 154 155 $sql="SELECT tema FROM `".$prefix."_config`"; 156 $res = $dbi->prepare("$sql"); 157 $res->execute(); 158 list($deftema) = $res->fetch(PDO::FETCH_NUM); 154 159 155 160 echo ' … … 161 166 if($tema=="Futura2") 162 167 //echo'<a href="backtoapp.html" data-rel="external" data-ajax="false">Chiudi</a>'; // per l'app precedente non piu usata 163 echo ' <a href="modules.php?name=Elezioni&tema= facebook&nocell=1" data-rel="external" data-ajax="false" >Versione Desktop</a>';168 echo ' <a href="modules.php?name=Elezioni&tema='.$deftema.'&nocell=1&op=gruppo&id_cons_gen='.$id_cons_gen.'" data-rel="external" data-ajax="false" >Versione Desktop</a>'; 164 169 else 165 echo ' <a href="modules.php?name=Elezioni&tema=facebook&desktop=1 " data-rel="external" data-ajax="false" >Versione Desktop</a>';170 echo ' <a href="modules.php?name=Elezioni&tema=facebook&desktop=1&op=gruppo" data-rel="external" data-ajax="false" >Versione Desktop</a>'; 166 171 echo'</div>'; 167 172 } -
trunk/client/temi/bsitalia/layout/styles/style.css
r400 r407 495 495 496 496 } 497 498 .td-100 { 499 500 501 width: 100%; 502 border: none; 503 text-align: left; 504 505 } 497 506 .td-640 { 498 507 float: left; -
trunk/client/temi/bsitalia/style.css
r400 r407 489 489 } 490 490 491 .td-100 { 492 493 494 width: 100%; 495 border: none; 496 text-align: left; 497 498 } 491 499 .td-89 { 492 500 -
trunk/client/versione.php
r406 r407 1 1 <?php 2 2 3 $versione = "3.0 rev 40 6";3 $versione = "3.0 rev 407"; 4 4 $version_number = $versione; 5 $datarel = " 28 febbraio 2024";5 $datarel = "05 marzo 2024"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7
Note:
See TracChangeset
for help on using the changeset viewer.