Changeset 360 for trunk/admin/modules/Elezioni
- Timestamp:
- Mar 14, 2022, 5:13:56 PM (3 years ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_candidato.php
r358 r360 283 283 }else{ 284 284 $pro= $sthcan->fetch(PDO::FETCH_BOTH); 285 $dati = htmlentities($_pro['cognome'], ENT_QUOTES, "UTF-8"); 285 286 $sql="delete from ".$prefix."_ele_candidati where id_cand='$id_cand'"; 286 287 $sth = $dbi->prepare("$sql"); 287 288 $sth->execute(); 288 289 $result=$sth->rowCount(); 289 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','DELETE:id_lista:$pro[id_lista],cognome:$ pro[cognome],nome:$pro[nome]','','".$prefix."_ele_candidati')";290 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','DELETE:id_lista:$pro[id_lista],cognome:$dati,nome:$codifica:$pro[nome]','','".$prefix."_ele_candidati')"; 290 291 $sth = $dbi->prepare("$sql"); 291 292 $sth->execute(); -
trunk/admin/modules/Elezioni/ele_controlli.php
r358 r360 16 16 list($maschi,$femmine)=$res->fetch(PDO::FETCH_NUM); 17 17 18 $sql="select voti_uomini,voti_donne,voti_complessivi from ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_parz='$id_parz'"; 19 $res = $dbi->prepare("$sql"); 20 $res->execute(); 21 while(list($voti_u,$voti_d,$voti_t)=$res->fetch(PDO::FETCH_NUM)) 22 if((($voti_u+$voti_d!=$voti_t && $voti_u+$voti_d>0) || $voti_u>$maschi || $voti_d>$femmine || $voti_t>$maschi+$femmine) ) {$err=1; break;} 23 18 $sql="select voti_uomini,voti_donne,voti_complessivi,id_gruppo from ".$prefix."_ele_voti_parziale where id_sez='$id_sez' order by id_gruppo,data,orario"; 19 $res = $dbi->prepare("$sql"); 20 $res->execute(); 21 $votiu2=0;$votid2=0;$votit2=0;$idg2=-1; 22 while(list($voti_u,$voti_d,$voti_t,$idg)=$res->fetch(PDO::FETCH_NUM)) { 23 if($idg2!=$idg) { 24 $votiu2=0;$votid2=0;$votit2=0; 25 $idg2=$idg; 26 } 27 if((($voti_u+$voti_d!=$voti_t && $voti_u+$voti_d>0) || $voti_u>$maschi || $voti_d>$femmine || $voti_t>$maschi+$femmine ||$voti_u<$votiu2 ||$voti_d<$votid2 || $voti_t<$votit2) ) { 28 $err=1; break;} 29 $votiu2=$voti_u;$votid2=$voti_d;$votit2=$voti_t; 30 } 24 31 $tipo='affluenze'; 25 32 $sql="select id from ".$prefix."_ele_controlli where tipo='$tipo' and id_sez='$id_sez' "; … … 28 35 $righe=$res->rowCount(); 29 36 if($righe){ 30 while(list($id)=$res->fetch(PDO::FETCH_NUM)){ 31 if($id==$id_parz){37 while(list($id)=$res->fetch(PDO::FETCH_NUM)){#die("$sql"); 38 # if($id==$id_parz){ 32 39 if(!$err){ 33 $sql="delete from ".$prefix."_ele_controlli where tipo='$tipo' and id ='$id_parz' ";40 $sql="delete from ".$prefix."_ele_controlli where tipo='$tipo' and id_sez='$id_sez' "; 34 41 $res = $dbi->prepare("$sql"); 35 42 $res->execute(); … … 38 45 $err=0; 39 46 break; 40 }47 # } 41 48 } 42 49 } 43 50 if($err){ 44 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id _parz')";51 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$idg2')";#die("$sql"); 45 52 $res = $dbi->prepare("$sql"); 46 53 $res->execute(); … … 141 148 ############################## 142 149 $err=0; $err2=0; 143 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'"; 150 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'"; 144 151 $resref = $dbi->prepare("$sql"); 145 152 $resref->execute(); 146 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'";153 $sql="SELECT sum(voti),count(voti) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'"; 147 154 $resref = $dbi->prepare("$sql"); 148 155 $resref->execute(); 149 list($votig )=$resref->fetch(PDO::FETCH_NUM);156 list($votig,$numrec)=$resref->fetch(PDO::FETCH_NUM); 150 157 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez'"; 151 158 $res3 = $dbi->prepare("$sql"); … … 156 163 $res2->execute(); 157 164 list($validi) = $res2->fetch(PDO::FETCH_NUM); 158 if($validi ) {165 if($validi and $numrec) { 159 166 $status=0; 160 167 $query="SELECT validi,nulli,bianchi,contestati,voti_nulli,solo_gruppo,validi_lista,contestati_lista,voti_nulli_lista,solo_lista FROM ".$prefix."_ele_sezioni as t1 where t1.id_sez='$id_sez'"; … … 382 389 383 390 if(!$err){ 384 $sql="delete from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' ";391 $sql="delete from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' and id='$id_lista'"; 385 392 $res = $dbi->prepare("$sql"); 386 393 $res->execute(); … … 388 395 389 396 if($err){ 390 $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' ";397 $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' and id='$id_lista'"; 391 398 $res = $dbi->prepare("$sql"); 392 399 $res->execute(); … … 395 402 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 396 403 $res = $dbi->prepare("$sql"); 397 $res->execute(); 404 $res->execute(); #die("TEST $sql"); 398 405 } 399 406 } -
trunk/admin/modules/Elezioni/ele_lista.php
r344 r360 26 26 include("modules/Elezioni/funzionidata.php"); 27 27 include("modules/Elezioni/ele.php"); 28 if (isset($param['mex'])) $mex= addslashes($param['mex']); else $mex='';29 if (isset($param['do'])) $do= addslashes($param['do']); else $do='';28 if (isset($param['mex'])) $mex=htmlentities($param['mex'], ENT_QUOTES, "UTF-8"); else $mex=''; 29 if (isset($param['do'])) $do=htmlentities($param['do'], ENT_QUOTES, "UTF-8"); else $do=''; 30 30 if (isset($param['min'])) $min=intval($param['min']); else $min=0; 31 if (isset($param['ok'])) $ok= addslashes($param['ok']); else $ok='';31 if (isset($param['ok'])) $ok=htmlentities($param['ok'], ENT_QUOTES, "UTF-8"); else $ok=''; 32 32 if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista=0; 33 33 if (isset($param['id_circ'])) {$id_circ=intval($param['id_circ']); $_SESSION['id_circ']=$id_circ;} else … … 36 36 if (isset($param['id_gruppo2'])) $id_gruppo2=intval($param['id_gruppo2']); else $id_gruppo2=0; 37 37 if (isset($param['num_lista'])) $num_lista=intval($param['num_lista']); else $num_lista=0; 38 #if (isset($param['descr_lista'])) $descr_lista=htmlentities($param['descr_lista']); else $descr_lista=''; 38 39 if (isset($param['descr_lista'])) $descr_lista=addslashes($param['descr_lista']); else $descr_lista=''; 39 40 if (isset($param['simbolo'])) $simbolo=addslashes($param['simbolo']); else $simbolo=''; … … 268 269 $stemmacontents = fread ($fdstemma, filesize ("$filestemma")); 269 270 fclose ($fdstemma); 270 $stemmablob=addslashes($stemmacontents); 271 $stemmanome= addslashes($nomestemma);271 $stemmablob=addslashes($stemmacontents); 272 $stemmanome=($nomestemma); 272 273 $cond=", simbolo='$stemmanome', stemma='$stemmablob'"; 273 274 } else {$cond='';} 274 275 $sql="update ".$prefix."_ele_lista set num_lista='$num_lista' , id_gruppo='$id_gruppo',descrizione='$descr_lista' $cond where id_lista='$id_lista'"; 276 #die("TEST: $sql"); 275 277 $result = $dbi->prepare("$sql"); 276 278 $result->execute(); -
trunk/admin/modules/Elezioni/ele_voti.php
r358 r360 43 43 include("modules/Elezioni/funzionidata.php"); 44 44 include("modules/Elezioni/ele.php"); 45 include_once("modules/Elezioni/ele_spoglio.php"); 45 46 global $votolista, $limite, $dettnulli,$disgiunto; 46 47 if(!isset($votolista)) $votolista=0; … … 302 303 $result->execute(); 303 304 list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine) = $result->fetch(PDO::FETCH_NUM); 305 $sql="select tipo from ".$prefix."_ele_controlli where id_sez='$id_sez' group by tipo"; 306 $rese = $dbi->prepare("$sql"); 307 $rese->execute(); 308 $id_comune=$_SESSION['id_comune']; 309 $bordoa=''; 310 $bordog=''; 311 $bordol=''; 312 while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) { 313 if ($tipo=='affluenze') $bordoa="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 314 if ($tipo=='gruppo' or $tipo=='referendum') $bordog="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 315 if ($tipo=='lista') $bordol="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 316 } 317 echo "<SCRIPT type=\"text/javascript\">\n"; 318 echo "function vai_scelta(idrif){\n"; 319 echo "window.document.location.href=idrif\n"; 320 echo "}\n"; 321 echo "</script>\n"; 322 if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna=''; 323 if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo=''; 324 if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista=''; 325 if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff=''; 326 echo "<div data-role=\"content\" data-theme=\"a\"><hr><table style=\"margin-left:auto; margin-right:auto;\"><tr>"; 327 #<a href=\"admin.php?id_comune=$id_comune&id_cons_gen=$id_cons_gen&ops=1\"></a> 328 echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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"; 329 if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){ 330 echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_cons_gen=$id_cons_gen&do=spoglio&ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n"; 331 } 332 if($genere==2 and $votog) 333 echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_cons_gen=$id_cons_gen&do=spoglio&ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n"; 334 elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){ 335 echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_cons_gen=$id_cons_gen&do=spoglio&ops=3');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorl\">"._LISTA."</font></b></p></td>\n"; 336 } 337 echo "</tr></table><hr></div>\n"; 338 /* 304 339 echo "<hr><table><tr><td width=\"200\"><font size =\"4\" color=\"black\" align=\"left\"><b>Sezione N. $num_sez</b></font></td><td><table><tr>"; 305 340 echo "\n<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=1\">"._AFFLUENZE."</a></b></p></td>\n"; … … 313 348 } 314 349 echo "</tr></table></td></tr></table><hr>\n"; 315 350 */ 316 351 ############# 317 352 # posizionamento in mancanza di scelta … … 376 411 377 412 } 378 ////////////////////////////////////////////////////////////////////////////////379 // FUNZIONI DI IMMISSIONE380 // - preferenze (candidati consiglieri)381 // - preferenze_gruppi382 // - votanti383 ////////////////////////////////////////////////////////////////////////////////384 385 //////////////////////////////////////////////////////////////////////386 // da qui va la sezione per le preferenze candidati consiglieri387 //////////////////////////////////////////////////////////////////////388 function preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){389 global $aid, $prefix, $dbi, $id_lista,$genere,$id_cons_gen,$id_gruppo,$sezi,$circo,$votog,$votol,$votoc,$conscirc;390 global $tipo_cons,$limite,$dettnulli,$disgiunto;391 $bgcolor1="#7777ff";392 $bgcolor2=$_SESSION['bgcolor2'];393 394 if ($genere==4){395 $sql="SELECT voti_uomini,voti_donne, voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_cons='$id_cons' order by data desc,orario desc limit 0,1";396 $result = $dbi->prepare("$sql");397 $result->execute();398 399 400 list( $voti_u, $voti_d, $voti_t) = $result->fetch(PDO::FETCH_NUM);401 echo "<table class=\"table-menu\" style=\"width: 50%; color: black;\">"402 ."<tr><td></td><td align=\"center\"></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIU."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTID."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIT."</td></tr>"403 ."<tr><td></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._TOT_ULT."</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_u</td><td align=\"center\" bgcolor=\"$bgcolor2\">$voti_d</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_t</td></tr>";404 echo "</table>";405 }406 $sql="select validi,nulli,bianchi,contestati from ".$prefix."_ele_sezioni where id_sez='$id_sez' ";407 $result = $dbi->prepare("$sql");408 $result->execute();409 list($v1,$v2,$v3,$v4)=$result->fetch(PDO::FETCH_NUM);410 if($v1+$v2+$v3+$v4>0){411 //controlla se sono stati inseriti i votanti412 $sql="SELECT preferenze, id_fascia, id_conf,solo_gruppo, disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";413 $result = $dbi->prepare("$sql");414 $result->execute();415 416 417 list($numprefs,$fascia,$id_conf,$flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM);418 419 ####### 06-11-2014 - circoscrizionali - nello spostamento ad altra sezione resta sullo stesso numero di lista anche se sono sezioni di diverse circoscrizioni420 if ($circo and $id_lista){421 $sql="SELECT num_lista from ".$prefix."_ele_lista where id_lista=$id_lista";422 $res_lis = $dbi->prepare("$sql");423 $res_lis->execute();424 list($num_lista)=$res_lis->fetch(PDO::FETCH_NUM);425 }426 427 if(!$votog and ($genere==3 or $genere==5)){428 $sql="select validi_lista,nulli,bianchi,contestati_lista,voti_nulli_lista from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";429 $result = $dbi->prepare("$sql");430 $result->execute();431 432 433 }else{434 $sql="select validi,nulli,bianchi,contestati,voti_nulli from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";435 $result = $dbi->prepare("$sql");436 $result->execute();437 }438 439 list($validi,$nulli,$bianchi,$contestati,$votinulli) = $result->fetch(PDO::FETCH_NUM);440 echo "<table class=\"table-menu\" style=\"width: 100%;\"><tr>";441 $sql="SELECT id_lista, descrizione,num_lista from ".$prefix."_ele_lista where id_cons=$id_cons $circo order by num_lista";442 $res_lis = $dbi->prepare("$sql");443 $res_lis->execute();444 445 446 $num_liste = $res_lis->rowCount();447 $ele_lista='';448 if (($genere==4 or $genere==5) and !$votoc) { //liste a piu' candidati449 if(($genere==5 and $id_conf and $fascia<=$limite and !$disgiunto) and !$id_lista) { //esclude il voto di lista per le comunali nei comuni sotto fascia limite450 $sql="SELECT id_lista from ".$prefix."_ele_lista where id_cons=$id_cons $circo limit 0,1";451 $result = $dbi->prepare("$sql");452 $result->execute();453 454 455 list($id_lista)=$result->fetch(PDO::FETCH_NUM);456 }457 echo "<td> </td></tr><tr><td style=\"vertical-align: top;\">";458 echo "<form name=\"liste\" action=\"modules/Elezioni/salva_liste.php\">";459 echo "<input type=\"hidden\" name=\"pag\" value=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=3&id_lista=\">";460 echo "<select name=\"id_lista\" size=\"".($num_liste+1)."\" onChange=\"vai_lista()\">";461 if ($id_lista){462 echo "<option value=\"0\">"._VOTI_LISTA;463 $ele_lista=" and t1.id_lista='$id_lista' ";464 }else{465 echo "<option value=\"0\" selected>"._VOTI_LISTA;466 $ele_lista=" group by t1.id_lista ";467 if(!isset($votolista)) $votolista=0;468 469 }470 while(list($id_rif,$descrizione,$num_lis) = $res_lis->fetch(PDO::FETCH_NUM)) {471 $segna='';472 $sql="SELECT count(t1.voti) from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on (t1.id_cand=t2.id_cand) where t1.id_sez=$id_sez and t2.id_lista=$id_rif";473 $result = $dbi->prepare("$sql");474 $result->execute();475 476 477 list($ctrvoticand)=$result->fetch(PDO::FETCH_NUM);478 $sql="SELECT sum(t1.voti),0,0 from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on (t1.id_cand=t2.id_cand) where t1.id_sez=$id_sez and t2.id_lista=$id_rif";479 $result = $dbi->prepare("$sql");480 $result->execute();481 482 483 list($votisezcand)=$result->fetch(PDO::FETCH_NUM);484 if((($fascia>$limite or $disgiunto) or !$id_conf) or $genere==4){485 $sql="SELECT voti,solo_lista from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_rif'";486 $result = $dbi->prepare("$sql");487 $result->execute();488 }else{489 $sql="SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_rif'";490 $result = $dbi->prepare("$sql");491 $result->execute();492 list($id_gruppo)=$result->fetch(PDO::FETCH_NUM);493 $sql="SELECT sum(voti),0 from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";494 $result = $dbi->prepare("$sql");495 $result->execute();496 }497 list($votisezlis,$sgpl)=$result->fetch(PDO::FETCH_NUM);498 if($votisezcand>($votisezlis*$numprefs))499 {$segna="style=\"background-color: #dd0000;\"";}500 elseif($ctrvoticand)501 $segna="style=\"background-color: #99CC33;\"";502 $sql="SELECT t1.voti,t2.num_cand FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' and t2.id_lista='$id_rif'";503 $res4 = $dbi->prepare("$sql");504 $res4->execute();505 506 507 $errcand[$id_rif]=array();508 while(list($testvotic,$numcand)=$res4->fetch(PDO::FETCH_NUM))509 if($votisezlis<$testvotic) { $segna="style=\"background-color: #dd0000;\"";$errcand[$id_rif][]=$numcand;}510 511 $sel = ($id_rif == $id_lista) ? "selected" : "";512 echo "<option $segna value=\"$id_rif\" $sel>";513 for ($j=strlen($num_lis);$j<2;$j++) { echo " ";}514 echo $num_lis.") ".substr($descrizione,0,30);515 }516 echo "</select></form></td>\n";517 }else {518 $id_lista=0;519 }520 echo "<td style=\"vertical-align: top;\">";521 522 if ((!$id_lista)){$tab="_ele_voti_lista";} else {$tab="_ele_voti_candidati";}523 if(($genere==4 or ($genere==5 and $votog)) and !$id_lista) {524 $sql="SELECT sum(t1.voti),t2.validi, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli,t2.bianchi,t2.nulli,t2.contestati,0,0 from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez=$id_sez group by t1.id_sez";525 $result = $dbi->prepare("$sql");526 $result->execute();527 528 529 }else{530 $sql="SELECT sum(t1.voti),t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli,t2.solo_gruppo,t1.id_sez from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez='$id_sez' group by t1.id_sez,t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli,t2.solo_gruppo";531 $result = $dbi->prepare("$sql");532 $result->execute();533 }534 535 // aggiunte le variabili $sgpl e $vnulli2 per la gestione dei voti 1) al solo presidente per singola lista - 2) al solo presidente per singola lista perché nullo o contestato quello di lista536 $isscr= $result->rowCount();537 list( $voti_sez, $validi2, $sg,$cont2,$vnulli2,$bia2,$nul2,$con2,$vnul2,$sgpl) = $result->fetch(PDO::FETCH_NUM);538 if(($genere==5 and !$disgiunto and $voti_sez and $flagsg and ($tipo_cons==18 or $tipo_cons==19))){539 $sql="SELECT sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_cons=$id_cons and id_sez=$id_sez";540 $resg = $dbi->prepare("$sql");541 $resg->execute();542 543 544 list($sgpl)=$resg->fetch(PDO::FETCH_NUM);545 if ($sg != $sgpl) echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_UNI." ".$sgpl." "._ATT_TOT_UNI." ".$sg."</b><br></td></table>";546 }547 $valista=$validi2;548 if(!$id_lista or $genere==3){ //controllo di congruenza549 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez'";550 $res2 = $dbi->prepare("$sql");551 $res2->execute();552 553 554 list($tot) = $res2->fetch(PDO::FETCH_NUM);555 ####### controlli556 $sql="select * from ".$prefix."_ele_controlli where id_cons='$id_cons' and id_sez='$id_sez' ";557 $resc = $dbi->prepare("$sql");558 $resc->execute();559 if($resc->rowCount()){ if ($validi2+$vnulli2+$cont2+$sg+$bia2+$nul2+$con2+$vnul2!=$tot and $validi+$sg>0){560 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi2+$vnulli2+$cont2+$sg+$bia2+$nul2+$con2+$vnul2)."</b><br></td></table>";561 }562 563 if((($voti_sez)!=$validi2) and ($voti_sez>0)){564 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".($voti_sez)." "._NO_VAL_VOTI." ".$validi2."</b><br></td></tr></table>";565 }566 }elseif($genere==5){567 $sql="SELECT sum(t1.voti) from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on (t1.id_cand=t2.id_cand) where t1.id_sez=$id_sez and t2.id_lista=$id_lista";568 $result = $dbi->prepare("$sql");569 $result->execute();570 571 572 list($votisezcand)=$result->fetch(PDO::FETCH_NUM);573 if(($fascia>$limite or $disgiunto) or !$id_conf){574 $sql="SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_lista'";575 $result = $dbi->prepare("$sql");576 $result->execute();577 578 579 }else{580 581 $sql="SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_lista'";582 $result = $dbi->prepare("$sql");583 $result->execute();584 585 586 list($id_gruppo)=$result->fetch(PDO::FETCH_NUM);587 $sql="SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";588 $result = $dbi->prepare("$sql");589 $result->execute();590 591 592 }593 list($votisezlis)=$result->fetch(PDO::FETCH_NUM);594 if($votisezcand>($votisezlis*$numprefs))595 {596 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti di preferenza $votisezcand <br/>superano i voti di lista $votisezlis</b><br></td></tr></table>";597 }598 }599 #controllo voti a liste collegate <= voto di gruppo per voto non disgiunto600 $errgrulis=array();601 if($genere==5 and !$disgiunto and ($tipo_cons==18 or $tipo_cons==19)){602 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo";603 $resref = $dbi->prepare("$sql");604 $resref->execute();605 606 607 $sql="SELECT count(0) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez'";608 $res4 = $dbi->prepare("$sql");609 $res4->execute();610 611 612 list($sezscrl)=$res4->fetch(PDO::FETCH_NUM);613 if ($sezscrl)614 615 while ( list($id_gruppo)=$resref->fetch(PDO::FETCH_NUM))616 {617 $sql="SELECT sum(voti-solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";618 $res3 = $dbi->prepare("$sql");619 $res3->execute();620 621 622 $sql="SELECT sum(voti+nulli_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";623 $res4 = $dbi->prepare("$sql");624 $res4->execute();625 626 627 list($vgruppo)=$res3->fetch(PDO::FETCH_NUM);628 list($vliste)=$res4->fetch(PDO::FETCH_NUM);629 if($vliste>$vgruppo)630 {631 $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";632 $result = $dbi->prepare("$sql");633 $result->execute();634 635 636 list($dgruppo)=$result->fetch(PDO::FETCH_NUM);637 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti delle liste collegate<br/> superano i voti assegnati al gruppo $dgruppo </b><br></td></tr></table>";638 $errgrulis[$id_gruppo]=1;639 }640 elseif($vliste<$vgruppo)641 {642 $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";643 $result = $dbi->prepare("$sql");644 $result->execute();645 646 647 list($dgruppo)=$result->fetch(PDO::FETCH_NUM);648 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti assegnati al gruppo $dgruppo<br/> superano i voti delle liste collegate </b><br></td></tr></table>";649 $errgrulis[$id_gruppo]=1;650 }651 }652 }653 }654 655 656 echo "\n<form name=\"sezioni\" action=\"modules/Elezioni/salva_liste.php\">"657 ."<input type=\"hidden\" name=\"op\" value=\"rec_voti\">"658 ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"659 ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"660 ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"661 ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"662 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"663 ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"664 ."<input type=\"hidden\" name=\"tabella\" value=\"$tab\">"665 ."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n"666 ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">\n";667 echo "<table class=\"table-menu\" style=\"width: 90%; color: black\">";668 echo "<tr><td bgcolor=\"$bgcolor1\" align=\"left\" width=\"32\">";669 if ($genere<4){670 // echo "<td bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._LISTA."</b></td>";671 }672 echo "<b>"._NUM."</b></td>";673 if($id_lista){674 echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._CANDIDATO."</b></td>"675 ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>";676 }else{677 echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>"678 ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>";679 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)680 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";681 if($disgiunto){682 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLOLIS."</b></td>";683 }684 }685 echo "</tr>\n";686 687 688 689 690 691 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 $circo ORDER BY t2.num_lista,t1.num_cand";692 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 $circo ORDER BY t2.num_lista";693 $result = $dbi->prepare("$sql");694 $result->execute();695 696 697 $max = $result->rowCount();698 $tot_pref=0;699 $i=1;700 701 if($id_lista) {702 while(list($id_cand,$id_cons2,$id_lista2,$nl, $cognome, $nome, $note, $simbolo, $num_cand) = $result->fetch(PDO::FETCH_NUM)){703 // dati lista704 $sql="select id_lista, descrizione,simbolo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista2'";705 $result1 = $dbi->prepare("$sql");706 $result1->execute();707 708 709 list($id_lista3,$descr_lista,$simb_lista,$num_lista)=$result1->fetch(PDO::FETCH_NUM);710 // dati gruppo711 $sql="select descrizione,simbolo from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";712 $result2 = $dbi->prepare("$sql");713 $result2->execute();714 715 716 list($descr_gruppo,$simb_gruppo)=$result2->fetch(PDO::FETCH_NUM);717 718 echo "<tr bgcolor=\"$bgcolor2\">";719 if ($genere<4){720 echo "<td align=\"left\"><b><img src=\"images/lista/$simb_lista \" width=\"32\" heigth=\"32\" align=\"center\" ALT=\"$descr_lista\" > </b></td>";721 }722 echo "<td align=\"center\"><b> $num_cand </b></td>"723 ."<td align=\"left\"><b>$cognome $nome</b></td>";724 $cond_sele="and id_cand=$id_cand";725 $sql="SELECT voti FROM ".$prefix."$tab where id_cons='$id_cons' and id_sez='$id_sez' $cond_sele";726 $res = $dbi->prepare("$sql");727 $res->execute();728 729 730 list($voti)= $res->fetch(PDO::FETCH_NUM);731 if(in_array($num_cand,$errcand[$id_lista])) $errcolor="style=\"background-color: rgb(255, 0, 0);\""; else $errcolor='';732 echo "<td align=\"right\" $errcolor><input name=\"voti$num_cand\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">";733 echo "<input type=\"hidden\" name=\"id_cand$num_cand\" value=\"$id_cand\"></td></tr>\n";734 $i++;735 $tot_pref+=$voti;736 }737 }else {738 if($circo) $circot1=" and t1.id_circ=$id_circ"; else $circot1='';739 $sql="select t2.voti,t1.id_lista, descrizione,simbolo,t1.num_lista,t2.nulli_lista,t2.solo_lista,t1.id_gruppo740 from ".$prefix."_ele_lista as t1, ".$prefix."_ele_voti_lista as t2741 where t1.id_cons='$id_cons'742 and t1.id_lista=t2.id_lista743 and t2.id_sez=$id_sez744 $circot1745 order by t1.num_lista";746 747 try {748 $result1 = $dbi->prepare("$sql");749 $result1->execute();750 751 }752 catch(PDOException $e)753 {754 echo $sql . "<br>" . $e->getMessage();755 }756 757 $num_lista=$result1->rowCount();758 if (!$num_lista){759 $sql="select '0',id_lista, descrizione,simbolo,num_lista,'','',id_gruppo760 from ".$prefix."_ele_lista where id_cons='$id_cons' $circo761 order by num_lista";762 $result1 = $dbi->prepare("$sql");763 $result1->execute();764 }765 $tvnpl=0;766 $tslpl=0;767 while (list($voti,$id_lista3,$descr_lista,$simb_lista,$num_lista,$vnpl,$slpl,$rifgruppo)=$result1->fetch(PDO::FETCH_NUM)){768 echo "<tr bgcolor=\"$bgcolor2\">";769 // if ($genere<4 or $votoc){770 // }771 $errcolor='';772 if(isset($errgrulis[$rifgruppo])) $errcolor="style=\"background-color: rgb(255, 0, 0);\"";773 echo "<td align=\"center\"><b> $num_lista </b></td>"774 ."<td align=\"left\"><b> $descr_lista</b></td>";775 $cond_sele="and id_lista=$id_lista3";776 echo "<td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">";777 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\">"; $tvnpl+=$vnpl;}778 if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+=$slpl;}779 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>";780 // echo "<td align=\"right\">$sgpl";781 echo "</tr>\n";782 $i++;783 $tot_pref+=$voti;784 }785 }786 if(!$id_lista) {787 echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><font size=\"3\">"._TOT._VOTI_LISTA."</font></td><td align=\"center\"><font size=\"3\">$tot_pref</font></td>";788 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)789 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";790 if($disgiunto)791 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tslpl."</font></td>";792 echo "</tr>";793 }794 else echo "<tr bgcolor=\"$bgcolor1\"><td></td><td>"._TOTPREF."</td><td align=\"center\">$tot_pref</td></tr>";795 // toglie ai candidati la visual... del solo_gruppo796 if(!$votog) {797 if (($genere==3 OR $genere==5) and (!$id_lista) and (($disgiunto or $fascia>$limite) or !$id_conf)) { //gruppo e liste798 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._VALIDI_LISTA."</b></td><td align=\"center\"><input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"><input name=\"valista\" value=\"$valista\" size=\"5\" style=\"text-align:right\"></td></tr>";799 echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\"><input name=\"sg\" value=\"$sg\" size=\"5\" style=\"text-align:right\">";800 if(defined('_NULLISTA'))801 echo "<input type=\"hidden\" name=\"votinulli\" value=\"$votinulli\"><input type=\"hidden\" name=\"contestati\" value=\"$contestati\"></td></tr>";802 else803 echo "</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._NULLI_LISTE."</b></td><td align=\"center\"><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" style=\"text-align:right\">"804 ."</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._CONTESTATI_LISTE."</b></td><td align=\"center\"><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\"></td></tr>";805 806 }elseif (($genere==3 OR $genere==5) and !$votoc and (($disgiunto or $fascia>$limite) or !$id_conf)){ //}elseif ($tipo_cons!=10 and $tipo_cons!=11){807 echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\">$sg</td></tr>";808 }809 ######modifica del 16-04-2009 per visualizzare i voti al solo sindaco nei comuni con meno di 15000 abitanti810 elseif(($genere==3 OR $genere==5) and ($id_lista) and ($fascia<=$limite or !$id_conf) and $numprefs==1) {811 $sql="SELECT id_gruppo FROM ".$prefix."_ele_lista where id_lista='$id_lista'";812 $resvg = $dbi->prepare("$sql");813 $resvg->execute();814 815 816 list($id_gruppo) = $resvg->fetch(PDO::FETCH_NUM);817 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_gruppo='$id_gruppo' and id_sez='$id_sez'";818 $resvg = $dbi->prepare("$sql");819 $resvg->execute();820 821 822 list($voti_sind) = $resvg->fetch(PDO::FETCH_NUM);823 824 echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\">".($voti_sind - $tot_pref)."</td></tr>";825 }826 ###### fine modifica del 16-04-2009827 828 }829 echo "<tr>";830 echo "<td></td><td></td>";831 echo "<td align=\"center\"><input type=\"submit\" id=\"update\" name=\"update\" value=\""._OK."\"></td>";832 echo "</tr></table>";833 if(chisei($id_cons_gen)>=64){834 echo "<td></td><td> <input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"1\">"._DELETE."</td>";835 } # onclick=\"javascript:del_dati()\"836 echo "</form></tr></table>";837 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"838 ."document.sezioni.voti1.focus()\n"839 ."document.sezioni.voti1.select()\n"840 ."//-->\n";841 echo "function vai_lista() {\n";842 echo "window.document.location.href=document.liste.pag.value+document.liste.id_lista.value\n";843 echo "}\n";844 echo "</script>\n";845 }846 #if (!((!$votog) and ($genere==3 OR $genere==5) and ($fascia>$limite)))847 finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);848 }849 850 851 ////////////////////////////////////////////852 // da qua va la sezione per i votanti853 ///////////////////////////////////////////854 855 function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){856 //function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){857 global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen,$id_comune;858 $bgcolor1=$_SESSION['bgcolor2'];859 860 #OpenTable();861 $sql="SELECT vismf from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";862 $res = $dbi->prepare("$sql");863 $res->execute();864 865 866 if($res) list($vismf)= $res->fetch(PDO::FETCH_NUM); else $vismf=0;867 $sql="SELECT orario,data FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data,orario ";868 $res = $dbi->prepare("$sql");869 $res->execute();870 871 echo "<table><tr><td>";872 $num = $res->rowCount();873 $sql="SELECT maschi,femmine FROM ".$prefix."_ele_sezioni where id_sez=$id_sez";874 $ressez = $dbi->prepare("$sql");875 $ressez->execute();876 ##################877 echo "<style>";878 echo "DIV.table";879 echo "{880 display:table;881 }882 FORM.tr883 {884 display:table-row;885 text-align: center;886 }887 DIV.tr888 {889 display:table-row;890 background-color: #D3D3D3;891 text-align: center;892 }893 SPAN.tdm894 {895 display:table-cell;896 border: 1px solid black;897 padding: 5px;898 }899 SPAN.td900 {901 display:table-cell;902 }";903 echo "</style>";904 905 /*906 echo "<form class=\"tr\" name=\"votanti$y\" action=\"modules/Elezioni/salva_aff.php\">";907 echo "<span class=\"td\"><input type=\"text\"/></span>";908 <span class="td"><input type="text"/></span>909 </form>910 <div class="tr">911 <span class="td">(cell data)</span>912 <span class="td">(cell data)</span>913 </div>914 ...915 </div>916 */917 ##################918 919 list($maschi,$femmine)=$ressez->fetch(PDO::FETCH_NUM);920 $y=0;921 echo "<div class=\"table\">";922 #echo "<tr><td> </td></tr>";923 $riga=array();924 $rigat=array();925 while (list($ora,$giorno)= $res->fetch(PDO::FETCH_NUM)){926 $y++;927 $rigat[$y]='';928 $riga[$y]='';929 # echo "\n<tr><td>";930 # echo "<form name=\"votanti$y\" action=\"modules/Elezioni/salva_aff.php\">";931 # echo "<table class=\"table-menu\" style=\"width: 100%; color: black;\"><tr>";932 $rigat[$y]= "<div class=\"tr\">";933 if ($genere==0){ //e' un referendum934 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._NUM."</b></td>";935 $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._NUM."</b></span>";936 }937 $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._ORA."</b></span>"938 ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._DATA."</b></span>";939 $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIU."</b></span>";940 $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTID."</b></span>"941 ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIT."</b></span>";942 if ($genere==0){943 $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' ";944 $res2 = $dbi->prepare("$sql");945 $res2->execute();946 947 948 $max = $res2->rowCount();949 }else{ $max=1;}950 $op="rec_add_votanti";951 $rigat[$y].= "</div>";952 953 for ($i=1;$i<=$max;$i++){954 $query="SELECT * FROM ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2955 on (t1.id_gruppo=t2.id_gruppo) where t1.id_sez='$id_sez'956 and t1.id_cons='$id_cons' and t1.orario='$ora' and t1.data='$giorno'";957 if ($genere==0){958 $query.=" and t2.num_gruppo=$i";959 }960 $sql=$query;961 $result = $dbi->prepare("$sql");962 $result->execute();963 964 965 list($id_cons2,$id_sez2,$id_parz,$orario,$data, $voti_u, $voti_d, $voti_t,$id_gruppo) = $result->fetch(PDO::FETCH_NUM);966 $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo' ";967 $res2 = $dbi->prepare("$sql");968 $res2->execute();969 970 971 $sql="select count(0) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_gruppo='$id_gruppo'";972 $resril = $dbi->prepare("$sql");973 $resril->execute();974 975 976 list($numril)=$resril->fetch(PDO::FETCH_NUM);977 if ($res2)978 list($gruppo)= $res2->fetch(PDO::FETCH_NUM);979 else980 $gruppo=0;981 if (!$gruppo>0) {982 $gruppo=$i;983 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where num_gruppo=$gruppo and id_cons=$id_cons";984 $res3 = $dbi->prepare("$sql");985 $res3->execute();986 987 988 if ($res3)989 list($id_gruppo)=$res3->fetch(PDO::FETCH_NUM);990 }991 if(!isset($precede[$id_gruppo])) $precede[$id_gruppo]=0; if(!isset($error)) $error=0;992 if($precede[$id_gruppo]>($voti_t) and $voti_t!='') $error=1;993 $precede[$id_gruppo]=$voti_t;994 if (($voti_u+$voti_d and $voti_u+$voti_d!=$voti_t) or $error){995 # echo "</tr><tr styl.e=\"background-color: rgb(255, 0, 0); text-align: center\">"; $error=0;996 $riga[$y].= "<form class=\"tr\" style=\"background-color: rgb(255, 0, 0); text-align: center\" name=\"votanti\" action=\"modules/Elezioni/salva_aff.php\">";997 }else{998 $riga[$y].= "<form class=\"tr\" action=\"modules/Elezioni/salva_aff.php\">";999 }1000 if ($genere==0){ // e' un referendum1001 $riga[$y].= "<span class=\"td\" align=\"center\">$gruppo</span>";1002 }1003 1004 1005 $riga[$y].= "<span class=\"td\"><input type=\"hidden\" name=\"op\" value=\"rec_add_votanti\"/>";1006 $riga[$y].= "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"/>"1007 ."<input type=\"hidden\" name=\"genere\" value=\"$genere\"/>"1008 ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"/>"1009 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\"/>"1010 ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\"/>";1011 #$riga[$y].= "</span>";1012 list ($anno,$mese,$di)=explode('-',$giorno);1013 $riga[$y].= "$ora</span><span class=\"td\" align=\"center\">$di-$mese-$anno</span>";1014 if ($voti_u > $maschi) $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">";1015 else $riga[$y].= "<span class=\"td\" align=\"center\">";1016 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\"";1017 $riga[$y].= " size=\"5\"/></span>";1018 if ($voti_d > $femmine) $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\"/>";1019 else $riga[$y].= "<span class=\"td\" align=\"center\">";1020 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\"";1021 $riga[$y].= " size=\"5\"/></span>";1022 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\"/>";1023 else $riga[$y].= "<span class=\"td\" align=\"center\"><input id=\"voti_t$y$i\" name=\"voti_t\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\"/>";1024 $riga[$y].= "<input type=\"hidden\" name=\"id_parz\" value=\"$id_parz\"/>"1025 ."<input type=\"hidden\" name=\"data\" value=\"$giorno\"/>"1026 ."<input type=\"hidden\" name=\"orario\" value=\"$ora\"/>"1027 ."<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"/>"1028 ."<input type=\"hidden\" name=\"id_gruppo\" value=\"$id_gruppo\"/>";1029 $riga[$y].= "</span>";1030 1031 if (chisei($id_cons_gen)>=64 and $y==$numril) $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\">"._DELETE." <input type=\"checkbox\" name=\"delete\" value=\"true\"/></span>";1032 else $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\"><input type=\"hidden\" name=\"delete\" value=\"\"/></span>";1033 $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\"><input type=\"submit\" name=\"update\" value=\""._OK."\"/></span>";1034 $riga[$y].= "</form>";1035 1036 }1037 # echo "</table></form>";1038 echo "</div>";1039 1040 1041 $sql="select count(voti_complessivi) from ".$prefix."_ele_voti_parziale where data='$giorno' and orario='$ora' and id_sez=$id_sez";1042 $compl = $dbi->prepare("$sql");1043 $compl->execute();1044 1045 1046 list ($complessivi)= $compl->fetch(PDO::FETCH_NUM);1047 if (!$complessivi)1048 {1049 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n";1050 $numy=$y.'1';1051 if ($y==$num) {1052 echo "document.votanti$y.voti_u$numy.focus()\n";1053 echo "document.votanti$y.voti_u$numy.select()\n";1054 }else{1055 echo "this.voti_t$numy.focus()\n";1056 echo "this.voti_t$numy.select()\n";1057 }1058 echo "//-->\n"1059 ."</script>\n";1060 break;1061 }1062 # echo "</td></tr>";1063 }1064 #CloseTable();1065 foreach($riga as $key=>$val){1066 echo $rigat[$key];1067 echo $riga[$key];1068 }1069 echo "</div></td></tr></table>";1070 }1071 1072 1073 1074 function finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){1075 global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite;1076 ////////////////////////////////////////////1077 // da qua va la sezione per i voti finali1078 ///////////////////////////////////////////1079 $bgcolor1="#7777ff";1080 $bgcolor2=$_SESSION['bgcolor2'];1081 1082 1083 1084 echo "<form name=\"spogliovoti\" action=\"modules/Elezioni/salva_voti.php\">"1085 ."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";1086 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"1087 ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"1088 ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"1089 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"1090 ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";1091 1092 echo "<table border=\"0\" width=\"90%\" align=\"center\"><tr bgcolor=\"$bgcolor1\" align=\"center\">";1093 /* if($ops==3 and ($genere==3 or ($genere==5 and $fascia>$limite)) )1094 echo "<td width=\"32\"><b>"._VOTI_LISTA."</b></td>";1095 else */1096 echo "<td width=\"32\"><b>"._VALIDI."</b></td>";1097 echo "<td width=\"82\"><b>"._NULLI."</b></td>"1098 ."<td><b>"._BIANCHI."</b></td>"1099 ."<td width=\"32\"><b>"._VOTINULLI."</b></td>"1100 ."<td><b>"._CONTESTATI."</b></td>"1101 ."<td><b>"._TOTNON."</b></td>"1102 ."<td><b>"._TOTALEVOTI."</b></td>"1103 ."<td bgcolor=\"#ffffff\"></td> </tr>";1104 /*if($ops==3 and ($genere==3 or ($genere==5 and $fascia>$limite)) )1105 $result = mysql_query("select id_cons,id_sez,validi_lista,nulli,bianchi,contestati_lista,voti_nulli_lista,solo_gruppo,contestati,voti_nulli from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";1106 $res = $dbi->prepare("$sql");1107 $res->execute();1108 1109 1110 else */1111 $sql = "select id_cons,id_sez,validi,nulli,bianchi,contestati,voti_nulli,'0','0','0',solo_lista from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";1112 $result = $dbi->prepare("$sql");1113 $result->execute();1114 1115 1116 list($id_cons2,$id_sez2,$validi, $nulli, $bianchi, $contestati,$votinulli,$sg,$conts,$nullis,$sololista) = $result->fetch(PDO::FETCH_NUM);1117 $tot_nulli=$nulli+$bianchi+$contestati+$votinulli;1118 $tot_voti=$validi+$tot_nulli+$conts+$nullis;1119 // ."</td><td><input name=\"sololista\" value=\"$sololista\" size=\"5\" style=\"text-align:right\">" --- ."<td><b>"._SOLOLIS."</b></td>"1120 1121 1122 echo "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td align=\"left\"><input name=\"validi\" value=\"$validi\" size=\"5\" style=\"text-align:right\">";1123 /* if(($genere==3 or $genere==5) and !$votog and $ops==3){1124 echo "</td><td>$nulli"1125 ."</td><td>$bianchi";1126 echo "<input type=\"hidden\" name=\"nulli\" value=\"$nulli\"><input type=\"hidden\" name=\"bianchi\" value=\"$bianchi\">";1127 }else{ */1128 echo "</td><td><input name=\"nulli\" value=\"$nulli\" size=\"5\" style=\"text-align:right\">"1129 ."</td><td><input name=\"bianchi\" value=\"$bianchi\" size=\"5\" style=\"text-align:right\">";1130 // }1131 echo "</td><td><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" style=\"text-align:right\">"1132 ."</td><td><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\">"1133 ."</td><td>$tot_nulli"1134 ."</td><td>$tot_voti</td><td>"1135 ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"1136 ."<input type=\"hidden\" name=\"ops\" value=\"$ops\">"1137 ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"1138 ."</td></tr></table></form>"; //</td></tr>";1139 1140 1141 // echo "</table>";1142 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n";1143 if (!$validi) {1144 echo "document.spogliovoti.validi.focus()\n";1145 echo "document.spogliovoti.validi.select()\n";1146 }1147 echo "//-->\n"1148 ."</script>\n";1149 1150 1151 }1152 1153 1154 function preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){1155 global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli;1156 ////////////////////////////////////////////1157 // da qua va la sezione per le preferenze ai gruppi1158 ///////////////////////////////////////////1159 // Controllo immmissioni1160 1161 $bgcolor1="#7777ff";1162 $bgcolor2=$_SESSION['bgcolor2'];1163 $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ";1164 $res = $dbi->prepare("$sql");1165 $res->execute();1166 1167 1168 $max = $res->rowCount();1169 $max = $max-1;1170 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n";1171 if ($genere==0) {1172 echo "document.sezioni.si1.focus()\n";1173 echo "document.sezioni.si1.select()\n";1174 } else {1175 echo "document.sezioni.voti1.focus()\n"1176 ."document.sezioni.voti1.select()\n";1177 }1178 echo "//-->\n"1179 ."</script>\n";1180 // tabella votanti1181 echo "<center>";1182 if ($genere!=0){1183 $sql="SELECT voti_uomini,voti_donne, voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_cons='$id_cons' order by data desc,orario desc limit 0,1";1184 $result = $dbi->prepare("$sql");1185 $result->execute();1186 1187 1188 list( $voti_u, $voti_d, $voti_t) = $result->fetch(PDO::FETCH_NUM);1189 echo "<table class=\"table-menu\" style=\"width: 50%; color: black;\">"1190 ."<tr><td></td><td align=\"center\"></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIU."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTID."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIT."</td></tr>"1191 ."<tr><td></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._TOT_ULT."</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_u</td><td align=\"center\" bgcolor=\"$bgcolor2\">$voti_d</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_t</td></tr>";1192 echo "</table>";1193 }1194 echo "<table class=\"table-menu\" style=\"width: 50%; color: black\">";1195 if ($genere==0){1196 $sql="SELECT id_gruppo,si+no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez='$id_sez' ";1197 $res = $dbi->prepare("$sql");1198 $res->execute();1199 1200 1201 while (list($id_gruppo,$voti_parz,$validi,$nulli,$bianchi,$contestati) = $res->fetch(PDO::FETCH_NUM)){1202 if ($voti_parz!=$validi){1203 $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' and id_gruppo='$id_gruppo' ";1204 $res2 = $dbi->prepare("$sql");1205 $res2->execute();1206 1207 1208 list($num_gruppo) = $res2->fetch(PDO::FETCH_NUM);1209 echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI_REF." $num_gruppo: ".$voti_parz." "._NO_VAL_VOTI.": ".$validi."</b><br></td></tr>";1210 }1211 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";1212 $res2 = $dbi->prepare("$sql");1213 $res2->execute();1214 1215 1216 list($tot) = $res2->fetch(PDO::FETCH_NUM);1217 if (($validi+$nulli+$bianchi+$contestati)!= $tot ){1218 $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' and id_gruppo='$id_gruppo'";1219 $res2 = $dbi->prepare("$sql");1220 $res2->execute();1221 1222 1223 list($num_gruppo) = $res2->fetch(PDO::FETCH_NUM);1224 echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI_REF." $num_gruppo: ".$tot." "._NO_SOMMA." ".($validi+$nulli+$bianchi+$contestati)."</b><br></td></tr>";1225 }1226 }1227 }else{1228 $sql="select solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons' ";1229 $result = $dbi->prepare("$sql");1230 $result->execute();1231 1232 1233 list($flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM);1234 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'";1235 $res = $dbi->prepare("$sql");1236 $res->execute();1237 1238 1239 list($voti_parz) = $res->fetch(PDO::FETCH_NUM);1240 $sql="SELECT validi,nulli,bianchi,contestati,solo_lista,voti_nulli FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";1241 $res = $dbi->prepare("$sql");1242 $res->execute();1243 1244 1245 list($validi,$nulli,$bianchi,$contestati,$solo_lista,$votinulli) = $res->fetch(PDO::FETCH_NUM);1246 if ($voti_parz!=($validi-$solo_lista) and $voti_parz>0){1247 echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".$voti_parz." "._NO_VAL_VOTI." ".($validi-$solo_lista)."</b><br></td><tr>";1248 }1249 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez'";1250 $res2 = $dbi->prepare("$sql");1251 $res2->execute();1252 1253 1254 list($tot) = $res2->fetch(PDO::FETCH_NUM);1255 if ($validi+$nulli+$bianchi+$contestati+$votinulli!=$tot and $validi+$nulli+$bianchi+$contestati+$votinulli>0){1256 echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi+$nulli+$bianchi+$contestati+$votinulli)."</b><br></td></tr>";1257 }1258 $sql="SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_cons=$id_cons and id_sez=$id_sez";1259 $resg = $dbi->prepare("$sql");1260 $resg->execute();1261 1262 1263 list($voti_sez)=$resg->fetch(PDO::FETCH_NUM);1264 if(($genere==5 and !$disgiunto and $voti_sez and $flagsg and ($tipo_cons==18 or $tipo_cons==19))){1265 1266 $sql="SELECT sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_cons=$id_cons and id_sez=$id_sez";1267 $resg = $dbi->prepare("$sql");1268 $resg->execute();1269 1270 1271 list($sgpl)=$resg->fetch(PDO::FETCH_NUM);1272 $sql="SELECT solo_gruppo from ".$prefix."_ele_sezioni where id_cons=$id_cons and id_sez=$id_sez";1273 $resg = $dbi->prepare("$sql");1274 $resg->execute();1275 1276 1277 list($sg)=$resg->fetch(PDO::FETCH_NUM);1278 if ($sg != $sgpl) echo "<tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_UNI." ".$sgpl." "._ATT_TOT_UNI." ".$sg."</b><br></td></tr>";1279 }1280 #controllo voti a liste collegate <= voto di gruppo per voto non disgiunto1281 if($genere==5 and !$disgiunto and $flagsg and ($tipo_cons==18 or $tipo_cons==19)){1282 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo";1283 $resref = $dbi->prepare("$sql");1284 $resref->execute();1285 1286 1287 $errgrulis=array();1288 $sql="SELECT count(0) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez'";1289 $res4 = $dbi->prepare("$sql");1290 $res4->execute();1291 1292 1293 list($sezscrl)=$res4->fetch(PDO::FETCH_NUM);1294 if ($sezscrl)1295 while ( list($id_gruppo)=$resref->fetch(PDO::FETCH_NUM))1296 {1297 if($disgiunto || $flagsg){1298 $sql="SELECT sum(voti-solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";1299 $res3 = $dbi->prepare("$sql");1300 $res3->execute();1301 if($flagsg){1302 $sql="SELECT sum(voti+nulli_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";1303 $res4 = $dbi->prepare("$sql");1304 $res4->execute();1305 }else{1306 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";1307 $res4 = $dbi->prepare("$sql");1308 $res4->execute();1309 }1310 }else{1311 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";1312 $res3 = $dbi->prepare("$sql");1313 $res3->execute();1314 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";1315 $res4 = $dbi->prepare("$sql");1316 $res4->execute();1317 }1318 list($vgruppo)=$res3->fetch(PDO::FETCH_NUM);1319 list($vliste)=$res4->fetch(PDO::FETCH_NUM);1320 if($vliste>$vgruppo and !$disgiunto )1321 {1322 $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";1323 $result = $dbi->prepare("$sql");1324 $result->execute();1325 list($dgruppo)=$result->fetch(PDO::FETCH_NUM);1326 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti delle liste collegate $vliste<br/> superano i voti assegnati al gruppo $dgruppo $vgruppo</b><br></td></tr></table>";1327 $errgrulis[$id_gruppo]=1;1328 }1329 elseif($vliste<$vgruppo and $disgiunto )1330 {1331 $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";1332 $result = $dbi->prepare("$sql");1333 $result->execute();1334 list($dgruppo)=$result->fetch(PDO::FETCH_NUM);1335 echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti assegnati al gruppo $dgruppo<br/> superano i voti delle liste collegate </b><br></td></tr></table>";1336 $errgrulis[$id_gruppo]=1;1337 }1338 }1339 }1340 1341 }1342 if(!isset($votinulli)) $votinulli=0;1343 echo "<tr><td></td></tr></table>";1344 if ($validi+$nulli+$bianchi+$contestati+$votinulli>0 or $genere==0) {1345 if($genere==0) echo "<table class=\"table-menu\" style=\" width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" action=\"modules/Elezioni/salva_ref.php\">";1346 else echo "<table class=\"table-menu\" style=\" width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" action=\"modules/Elezioni/salva_gruppi.php\">";1347 echo "<input type=\"hidden\" name=\"op\" value=\"rec_voti_gruppiq\">"1348 ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"1349 ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"1350 ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"1351 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"1352 ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"1353 ."<input type=\"hidden\" name=\"circo\" value=\"$circo\">"1354 ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"1355 ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">";1356 echo "<br><br> <table class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"1357 ."<td width=\"3%\"><b>"._NUM."</b></td>"1358 ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";1359 if ($genere==0){1360 echo "<td><b>"._SI."</b></td>"1361 ."<td><b>"._NO."</b></td>"1362 ."<td><b>"._VALIDI."</b></td>"1363 ."<td><b>"._BIANCHI."</b></td>"1364 ."<td><b>"._CONTESTATI."</b></td>"1365 ."<td><b>"._NULLI."</b></td>"1366 ."<td><b>"._TOTNON."</b></td>"1367 ."<td><b>"._TOTALEVOTI."</b></td>"1368 ."<td><b>"._VOTANTI."</b></td>";1369 }else{1370 echo "<td width=\"5%\"><b>"._VOTI."</b></td>";1371 if($dettnulli) echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLO_GRUPPO."</b></td>";1372 }1373 echo "</tr>";1374 $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo ";1375 $res = $dbi->prepare("$sql");1376 $res->execute();1377 1378 1379 $max = $res->rowCount();1380 //echo "Massimo:$max - id=$id_cons - circo: $circo";1381 $sql="select * from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo ";1382 $result = $dbi->prepare("$sql");1383 $result->execute();1384 1385 1386 $i=1;1387 $tot_pref=0;1388 $totsg=0;1389 while(list($id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo) = $result->fetch(PDO::FETCH_NUM)){1390 1391 //echo "test: $id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo";1392 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"1393 1394 ."//-->\n";1395 echo "function controlloref$i() {\n";1396 echo "var a=Number(window.document.sezioni.si$i.value); var b=Number(window.document.sezioni.no$i.value); if(a=='NaN') {a=0} if(b=='NaN') {b=0} var c=a + b; window.document.sezioni.val$i.value=c\n";1397 echo "}\n";1398 echo "</script>\n";1399 1400 if ($num_gruppo != ''){1401 if ($genere==0){1402 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";1403 $res = $dbi->prepare("$sql");1404 $res->execute();1405 1406 1407 list($tot) = $res->fetch(PDO::FETCH_NUM);1408 $sql="SELECT * FROM ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";1409 $res = $dbi->prepare("$sql");1410 $res->execute();1411 1412 1413 $pro= $res->fetch(PDO::FETCH_BOTH);1414 1415 if ($pro['si']+$pro['no']!=$pro['validi'] or ($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=$tot and $pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0)){1416 echo "<tr style=\"background-color: rgb(255, 0, 0); text-align:center\">";1417 }else{1418 echo "<tr style=\"background-color: $bgcolor2; text-align:center\">";1419 }1420 $descr = explode('.',$descr_gruppo, 100);1421 echo "<td align=\"center\"><input type=\"hidden\" name=\"id_gruppo$i\" value=\"$id_gruppo\"><b>$num_gruppo</b>"1422 ."</td><td align=\"left\" width=\"50%\"><b> $descr[0] </b>";1423 $pro['si']=(isset($pro['si']) and $pro['si']>=0) ? $pro['si']:'';1424 $pro['no']=(isset($pro['no']) and $pro['no']>=0) ? $pro['no']:'';1425 $pro['validi']=(isset($pro['validi']) and $pro['validi']>=0) ? $pro['validi']:'';1426 $pro['bianchi']=(isset($pro['bianchi']) and $pro['bianchi']>=0) ? $pro['bianchi']:'';1427 $pro['contestati']=(isset($pro['contestati']) and $pro['contestati']>=0) ? $pro['contestati']:'';1428 $pro['nulli']=(isset($pro['nulli']) and $pro['nulli']>=0) ? $pro['nulli']:'';1429 $tot_nulli=intval($pro['nulli'])+intval($pro['bianchi'])+intval($pro['contestati']);1430 $tot_voti=intval($pro['validi'])+$tot_nulli;1431 echo "</td><td align=\"right\" width=\"3%\"><input name=\"si$i\" value=\"".$pro['si']."\" size=\"7\" style=\"text-align:right\" onchange=controlloref$i()></td>";1432 echo "</td><td align=\"right\" width=\"3%\"><input name=\"no$i\" value=\"".$pro['no']."\" size=\"7\" style=\"text-align:right\" onchange=controlloref$i()></td>";1433 echo "</td><td align=\"right\" width=\"3%\"><input name=\"val$i\" value=\"".$pro['validi']."\" size=\"7\" style=\"text-align:right\" ></td>";1434 echo "</td><td align=\"right\"><input name=\"bia$i\" value=\"".$pro['bianchi']."\" size=\"7\" style=\"text-align:right\"></td>";1435 echo "</td><td align=\"right\"><input name=\"con$i\" value=\"".$pro['contestati']."\" size=\"7\" style=\"text-align:right\"></td>";1436 echo "</td><td align=\"right\"><input name=\"nul$i\" value=\"".$pro['nulli']."\" size=\"7\" style=\"text-align:right\"></td>";1437 echo "</td><td align=\"right\">$tot_nulli</td>";1438 echo "</td><td align=\"right\">$tot_voti</td>";1439 echo "</td><td align=\"right\">$tot</td>";1440 }else{1441 echo "<tr style=\"background-color: $bgcolor2; text-align:center\"><td align=\"center\"><input type=\"hidden\" name=\"num_gruppo$i\" value=\"$num_gruppo\"><b>$num_gruppo</b>"1442 ."</td><td align=\"left\"><b> $descr_gruppo </b>";1443 $sql="SELECT * FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";1444 $res = $dbi->prepare("$sql");1445 $res->execute();1446 1447 $pro= $res->fetch(PDO::FETCH_BOTH);1448 if(!$res->rowCount()) {$pro['voti']=''; $pro['solo_gruppo']='';}1449 $errcolor='';1450 if(isset($errgrulis[$id_gruppo])) $errcolor="style=\"background-color: rgb(255, 0, 0);\"";1451 echo "</td><td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\"></td>";1452 1453 if($dettnulli) {echo "<td align=\"right\"><input name=\"solog$i\" value=\"".$pro['solo_gruppo']."\" size=\"7\" style=\"text-align:right\"></td>"; $totsg+=intval($pro['solo_gruppo']);}1454 $tot_pref += intval($pro['voti']);1455 echo "</tr>";1456 }1457 1458 $i++;1459 }1460 1461 }1462 if ($genere!=0) {1463 $sql="SELECT disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' ";1464 $res = $dbi->prepare("$sql");1465 $res->execute();1466 1467 1468 list($disgiunto)=$res->fetch(PDO::FETCH_NUM);1469 $sql="SELECT solo_lista FROM ".$prefix."_ele_sezioni where id_sez='$id_sez' ";1470 $res = $dbi->prepare("$sql");1471 $res->execute();1472 1473 1474 list($sololis)=$res->fetch(PDO::FETCH_NUM);1475 echo "<tr style=\"background-color: $bgcolor1; text-align:center\"><td></td><td>"._TOTPREF."</td><td>$tot_pref</td>";1476 if($dettnulli) echo "<td>$totsg</td>";1477 echo "</tr>";1478 if($disgiunto)1479 echo "<tr style=\"background-color: $bgcolor1; text-align:center\"><td></td><td>"._SOLOLIS."</td><td><input name=\"sololista\" value=\"".$sololis."\" size=\"7\" style=\"text-align:right\"></td></tr>";1480 }1481 1482 echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" id=\"update\" value=\" "._OK. "\"></td>";1483 1484 echo "</tr></table></form></td></tr>";1485 if(chisei($id_cons_gen)>=64){1486 echo "<tr><td><input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."";1487 }1488 1489 echo "</td></tr></table></center>";1490 }1491 if ($genere!=0){1492 finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);1493 }1494 }1495 413 1496 414 -
trunk/admin/modules/Elezioni/ele_widget.php
r344 r360 20 20 $currentlang=$_SESSION['lang']; 21 21 $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST; 22 $id_cons_gen= $param['id_cons_gen'];22 $id_cons_gen=intval($param['id_cons_gen']); 23 23 $perms=ChiSei($id_cons_gen); 24 24 if ($perms<32) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!"); … … 41 41 if (isset($param['attivo'])) $attivo=intval($param['attivo']); else $attivo=''; 42 42 43 43 /* 44 44 ############# controllo dei widget 45 45 make_db_widget(); // crea tabella se non esiste … … 103 103 } 104 104 105 105 */ 106 106 107 107 /******************************************************/ -
trunk/admin/modules/Elezioni/importa.php
r344 r360 35 35 elseif ($key==1) {$valori.= "null"; $oldidg=$campo;} 36 36 elseif ($key==6) $valori.= ",0"; 37 else $valori.= ",'$campo'"; 37 elseif($key==4 || $key==8) $valori.=",'".utf8_encode($campo)."'"; 38 elseif($key==9) $valori.=",''"; 39 else $valori.= ",'".$campo."'"; 38 40 if ($key==2) $numgruppo= $campo; 39 41 if ($key==8) $isnew=1; … … 43 45 44 46 $sql="insert into ".$prefix."_ele_gruppo values($valori)"; 47 try { 45 48 $res_gruppo = $dbi->prepare("$sql"); 46 49 $res_gruppo->execute(); 50 } 51 catch(PDOException $e) 52 { 53 echo $sql . "<br>" . $e->getMessage(); 54 } 47 55 $sql="select id_gruppo from ".$prefix."_ele_gruppo where num_gruppo='$numgruppo' and id_cons='$idcns'"; 48 56 $resnew = $dbi->prepare("$sql"); … … 60 68 { 61 69 global $prefix, $dbi; 62 global $ar_lista,$ ar_candi,$idcns;63 64 foreach ($ar_lista as $rigalista){ 70 global $ar_lista,$idcns; 71 72 foreach ($ar_lista as $rigalista){ 65 73 if(!isset($rigalista[3])) continue; 66 74 $oldidl=0; 67 75 $okl=0; 68 76 $oldidg=$rigalista[3]; 69 $newidg=$_SESSION['gruppi']['idg_'.$oldidg];77 if(isset($_SESSION['gruppi'])) $newidg=$_SESSION['gruppi']['idg_'.$oldidg]; else $newidg=0; 70 78 foreach($rigalista as $key=>$campo){ 71 if ($key==0) $valori="'$idcns',"; 72 elseif ($key==1) {$valori.= "null";$oldidl=$campo;} 73 elseif ($key==3) {$valori.= ",'$newidg'"; if ($campo!=$oldidg) $okl=1;} 74 elseif ($key==4) $valori.= ",0"; 75 else $valori.= ",'$campo'"; 76 if ($key==2) $numlista= $campo; 79 if ($key==0) $valori=$idcns.","; 80 /* elseif ($key==1) {$oldidl=$campo;} 81 elseif ($key==2) {$num_lista=$campo;$numlista=$campo;} 82 elseif ($key==3) {$id_gruppo=$newidg; if ($campo!=$oldidg) $okl=1;} 83 elseif ($key==5) $id_circ=$campo; 84 elseif ($key==7) $descr_lista=$campo; 85 elseif ($key==8) $stemmanome=$campo; 86 elseif ($key==9) $stemmablob=$campo; 87 */ 88 elseif ($key==1) {$valori.= "null,";$oldidl=$campo;} 89 elseif ($key==2) {$valori.="'$campo',";$numlista= $campo;} 90 elseif ($key==3) {$valori.= "'$newidg',"; if ($campo!=$oldidg) $okl=1;} 91 elseif ($key==4) $valori.= "0,"; 92 elseif ($key==9 ) $valori.= "'$campo'"; 93 # else $valori.= "'$campo',"; # htmlentities(stripslashes(utf8_decode($_POST['parola']))); 94 else $valori.="'".utf8_encode($campo)."',"; 95 # else $valori.= "'".htmlentities($campo, ENT_QUOTES, "UTF-8")."',"; htmlspecialchars($str, ENT_QUOTES) 77 96 } 78 if( isset($valori)){97 if($key==9){ 79 98 if ($okl) {$okl=0;continue;} 99 # $valori2=htmlentities($valori); 100 # $sql="insert into ".$prefix."_ele_lista (id_cons,num_lista,id_gruppo,id_circ,descrizione,simbolo,stemma) values ('$id_cons','$num_lista','$id_gruppo','$id_circ','$descr_lista','$stemmanome','$stemmablob')"; 80 101 $sql="insert into ".$prefix."_ele_lista values($valori)"; 102 try { 81 103 $res_lista = $dbi->prepare("$sql"); 82 $res_lista->execute(); 104 $res_lista->execute(); 105 } 106 catch(PDOException $e) 107 { 108 echo $sql . "<br>" . $e->getMessage(); 109 } 110 83 111 $sql="select id_lista from ".$prefix."_ele_lista where num_lista='$numlista' and id_cons='$idcns'"; 84 112 $reslnew = $dbi->prepare("$sql"); … … 86 114 list ($newidl) = $reslnew->fetch(PDO::FETCH_NUM); 87 115 unset($valori); 88 if($oldidl) 116 if($oldidl){ 89 117 $_SESSION['liste']['idl_'.$oldidl]=$newidl; 90 118 echo "id_lista:$oldidl:$newidl<br>"; 119 } 91 120 # inscandi($oldidl,$newidl); 92 121 } 93 }122 } 94 123 } 95 124 … … 109 138 elseif ($key==1) $valori.="'$idcns',"; 110 139 elseif ($key==2) {$valori.= "'$newidl'"; if ($campo!=$oldidl) $okc=1;} 111 else $valori.= ",' $campo'";140 else $valori.= ",'".utf8_encode($campo)."'"; 112 141 } 113 if(isset($valori) ){142 if(isset($valori) and $valori!=''){ 114 143 if ($okc) {$okc=0;continue;} 144 # $valori2=addslashes($valori); 115 145 $sql="insert into ".$prefix."_ele_candidati values($valori)"; 116 $res_lista = $dbi->prepare("$sql"); 117 $res_lista->execute(); 146 # $res_lista = $dbi->prepare("$sql"); 147 # $res_lista->execute(); 148 try { 149 $res_lista = $dbi->prepare("$sql"); 150 $res_lista->execute(); 151 } 152 catch(PDOException $e) 153 { 154 echo "<br>key:$key sql:".$sql . "<br>" . $e->getMessage(); 155 } 118 156 } 119 157 } … … 268 306 } 269 307 elseif ($numlista) { 270 inslista(0,0);308 # inslista(); 271 309 Header("Location: admin.php?op=lista&id_cons_gen=$id_cons_gen"); 272 310 } -
trunk/admin/modules/Elezioni/salva_liste.php
r358 r360 41 41 if (isset($_GET['valista'])) $validi=intval($_GET['valista']); else $validi='0'; 42 42 if (isset($_GET['nulli'])) $nulli=intval($_GET['nulli']); else $nulli='0'; 43 if (isset($_GET['bianchi'])) $bianchi= addslashes($_GET['bianchi']); else $bianchi='0';44 if (isset($_GET['contestati'])) $contestati= addslashes($_GET['contestati']); else $contestati='0';45 if (isset($_GET['votinulli'])) $votinulli= addslashes($_GET['votinulli']); else $votinulli='0';43 if (isset($_GET['bianchi'])) $bianchi=intval($_GET['bianchi']); else $bianchi='0'; 44 if (isset($_GET['contestati'])) $contestati=intval($_GET['contestati']); else $contestati='0'; 45 if (isset($_GET['votinulli'])) $votinulli=intval($_GET['votinulli']); else $votinulli='0'; 46 46 if (isset($_GET['id_comune'])) $id_comune=intval($_GET['id_comune']); else $id_comune='0'; 47 47 if (isset($_GET['ops'])) $ops=intval($_GET['ops']); else $ops='3'; -
trunk/admin/modules/Elezioni/scarica.php
r344 r360 29 29 if (isset($param['fase'])) $fase=intval($param['fase']); else $fase=0; 30 30 if (isset($param['id_cons_gen2'])) $id_cons_gen2=intval($param['id_cons_gen2']); else $id_cons_gen2='0'; 31 if (isset($param['indirizzoweb'])) $indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='http ://www.eleonline.it/client/';31 if (isset($param['indirizzoweb'])) $indirizzoweb=addslashes($param['indirizzoweb']); else $indirizzoweb='https://www.eleonline.it/client/'; 32 32 if (isset($param['id_comune2'])) $id_comune2=intval($param['id_comune2']); else $id_comune2='0'; 33 33 # htmlentities($param['indirizzoweb'], ENT_COMPAT, 'UTF-8') 34 34 /******************************************************/ 35 35 /*Funzione di visualizzazione globale */ … … 39 39 if (isset($help)) include("language/$language/ele_scarica.html"); 40 40 41 $bgcolor1=$_SESSION['bgcolor1']; 42 $bgcolor2=$_SESSION['bgcolor2']; 43 44 if ($fase=='0'){ 45 46 echo "<form name=\"import\" action=\"admin.php\">"; 47 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 48 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 49 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"1\"><input type=\"text\" name=\"indirizzoweb\" size=\"50\" value=\"".$indirizzoweb."\"></td></tr>"; 50 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>"; 51 echo "</tr></table><br>"; 52 echo "</form>"; 53 }elseif ($fase=='1'){ 54 $rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=1\"></script>"; 55 56 echo "<form name=\"import\" action=\"admin.php\">"; 57 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 58 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 59 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"2\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></tr>"; 60 echo "<tr><td><b>"._SCARICACONS."</b></td>"; 61 62 echo "<td>$rem_cons</td></tr>"; 63 41 $bgcolor1=$_SESSION['bgcolor1']; 42 $bgcolor2=$_SESSION['bgcolor2']; 43 if ($fase=='0'){ 44 echo "<form name=\"import\" action=\"admin.php\">"; 45 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 46 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 47 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"1\"><input type=\"text\" name=\"indirizzoweb\" size=\"50\" value=\"".$indirizzoweb."\"></td></tr>"; 48 echo "<td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>"; 49 echo "</tr></table><br>"; 50 echo "</form>"; 51 }elseif ($fase=='1'){ 52 $urlrem="$indirizzoweb/file.php?fase=1"; 53 $rem_cons="<script type=\"text/javascript\" src=\"$urlrem\" crossorigin=\"anonymous\"></script>"; 54 echo "<form name=\"import\" action=\"admin.php\">"; 55 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 56 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 57 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"2\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></tr>"; 58 echo "<tr><td><b>"._SCARICACONS."</b></td>"; 59 echo "<td>".$rem_cons."</td></tr>"; 64 60 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>"; 65 66 echo "</tr></table><br>"; 67 echo "</form>"; 61 echo "</tr></table><br>"; 62 echo "</form>"; 68 63 }elseif($fase=='2'){ 69 70 $sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2"; 71 $res = $dbi->prepare("$sql"); 72 $res->execute(); 73 list($descrcons) = $res->fetch(PDO::FETCH_NUM); 74 $rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>"; 75 76 echo "<form name=\"import\" action=\"admin.php\">"; 77 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 78 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 79 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"3\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></td></tr>"; 80 $cons_rem=addslashes($_GET[($id_cons_gen2)]); 81 echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>"; 82 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>"; 83 64 $sql="SELECT descrizione from ".$prefix."_ele_consultazione WHERE id_cons_gen=$id_cons_gen2"; 65 $res = $dbi->prepare("$sql"); 66 $res->execute(); 67 list($descrcons) = $res->fetch(PDO::FETCH_NUM); 68 $rem_cons="<script type=\"text/javascript\" src=\"$indirizzoweb/file.php?fase=2&id_cons_gen2=$id_cons_gen2\"></script>"; 69 echo "<form name=\"import\" action=\"admin.php\">"; 70 echo "<table border=\"0\" width=\"100%\"><tr bgcolor=\"$bgcolor2\">"; 71 echo "<td><b>"._INDIRIZZOWEB1."</b></td>"; 72 echo "<td><input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"op\" value=\"scarica\"><input type=\"hidden\" name=\"fase\" value=\"3\"><input type=\"hidden\" name=\"indirizzoweb\" value=\"$indirizzoweb\">$indirizzoweb</td></td></tr>"; 73 $cons_rem=addslashes($_GET[($id_cons_gen2)]); 74 echo "<tr><td><b>"._CONSULTA.":</b></td><td>$cons_rem</td></tr>"; 75 echo "<tr><td><b>"._SCELTACOMUNE."</b></td><td>$rem_cons</td></tr>"; 84 76 echo "<tr><td><input type=\"submit\" name=\"add\" value=\""._OK."\"></td>"; 85 86 echo "</tr></table><br>"; 87 echo "</form>"; 88 77 echo "</tr></table><br>"; 78 echo "</form>"; 89 79 }elseif ($fase=='3'){ 90 91 $id_cons_gen2=$_GET['id_cons_gen2']; 92 $id_comune2=$_GET['id_comune2']; 93 Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2"); 94 80 $id_cons_gen2=$_GET['id_cons_gen2']; 81 $id_comune2=$_GET['id_comune2']; 82 Header("Location: $indirizzoweb/modules.php?op=backup&id_cons_gen=$id_cons_gen2&id_comune=$id_comune2"); 95 83 } 96 84 }
Note:
See TracChangeset
for help on using the changeset viewer.