Changeset 260 for trunk/admin/modules
- Timestamp:
- Apr 6, 2019, 6:32:47 PM (6 years ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_colora_sez.php
r259 r260 11 11 if($perr) { 12 12 $sezstat=1; 13 $sql="UPDATE ".$prefix."_ele_sezioni set colore=' style=\" background: #FF3300;' where id_cons='$id_cons' and id_sez='$id_sez'"; #ROSSO13 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#FF3300' where id_cons='$id_cons' and id_sez='$id_sez'"; #ROSSO 14 14 $res = $dbi->prepare("$sql"); 15 15 $res->execute(); … … 25 25 if($liste && $liste==$res->rowCount()){ 26 26 $sezstat=2; 27 $sql="UPDATE ".$prefix."_ele_sezioni set colore=' style=\" background: #99CC33;' where id_cons='$id_cons' and id_sez='$id_sez'"; #VERDE27 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#99CC33' where id_cons='$id_cons' and id_sez='$id_sez'"; #VERDE 28 28 $res = $dbi->prepare("$sql"); 29 29 $res->execute(); … … 35 35 if($res->rowCount()>0){ 36 36 $sezstat=3; 37 $sql="UPDATE ".$prefix."_ele_sezioni set colore=' style=\" background: #48D1CC;' where id_cons='$id_cons' and id_sez='$id_sez'"; #"MEDIUMTORQUOISE"37 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#48D1CC' where id_cons='$id_cons' and id_sez='$id_sez'"; #"MEDIUMTORQUOISE" 38 38 $res = $dbi->prepare("$sql"); 39 39 $res->execute(); 40 40 }elseif(!$sezstat){ #gruppi 41 41 if($genere) 42 $sql="SELECT id_gruppo FROM ".$prefix."_ele_voti_gruppo where id_ cons='$id_cons' and id_sez='$id_sez'";42 $sql="SELECT id_gruppo FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'"; 43 43 else 44 $sql="SELECT id_gruppo FROM ".$prefix."_ele_voti_ref where id_ cons='$id_cons' and id_sez='$id_sez'";44 $sql="SELECT id_gruppo FROM ".$prefix."_ele_voti_ref where id_sez='$id_sez'"; 45 45 $res = $dbi->prepare("$sql"); 46 46 $res->execute(); … … 48 48 if($righe){ 49 49 $sezstat=4; 50 $sql="UPDATE ".$prefix."_ele_sezioni set colore=' style=\" background: #B0C4DE;' where id_cons='$id_cons' and id_sez='$id_sez'"; #"LIGHTSTEELBLUE"50 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#B0C4DE' where id_cons='$id_cons' and id_sez='$id_sez'"; #"LIGHTSTEELBLUE" 51 51 $res = $dbi->prepare("$sql"); 52 52 $res->execute(); … … 58 58 if($voti) { 59 59 $sezstat=5; 60 $sql="UPDATE ".$prefix."_ele_sezioni set colore=' style=\" background: #F5F5F5;' where id_cons='$id_cons' and id_sez'=$id_sez'"; #whitesmoke60 $sql="UPDATE ".$prefix."_ele_sezioni set colore='#F5F5F5' where id_cons='$id_cons' and id_sez='$id_sez'"; #whitesmoke 61 61 $res = $dbi->prepare("$sql"); 62 62 $res->execute(); … … 68 68 $num_ril=$righe % 4; 69 69 70 if($num_ril==0) {$cursez=" style=\" background: #7FFFD4;";}#aquamarine71 elseif($num_ril==1) {$cursez=" style=\" background: #ADD8E6;";}#lightblue72 elseif($num_ril==2) {$cursez=" style=\" background: #DCDCDC;";}#gainsboro73 elseif($num_ril==3) {$cursez=" style=\" background: #E0FFFF;";}#lightcyan70 if($num_ril==0) {$cursez="#DCDCDC";}#gainsboro 71 elseif($num_ril==1) {$cursez="#ADD8E6";}#lightblue 72 elseif($num_ril==2) {$cursez="#7FFFD4";} #aquamarine 73 elseif($num_ril==3) {$cursez="#E0FFFF";}#lightcyan 74 74 $sql="UPDATE ".$prefix."_ele_sezioni set colore='$cursez' where id_cons='$id_cons' and id_sez='$id_sez'"; 75 75 $res = $dbi->prepare("$sql"); -
trunk/admin/modules/Elezioni/ele_sezione.php
r257 r260 215 215 }elseif ($do == "add") { 216 216 if ($num_sez) { 217 $sql="insert into ".$prefix."_ele_sezioni (id_cons,id_sede,num_sez,maschi,femmine, autorizzati_m,autorizzati_f ) values ('$id_cons', '$id_sede', '$num_sez','$maschi','$femmine','$aut_m', '$aut_f')";217 $sql="insert into ".$prefix."_ele_sezioni (id_cons,id_sede,num_sez,maschi,femmine, autorizzati_m,autorizzati_f,colore) values ('$id_cons', '$id_sede', '$num_sez','$maschi','$femmine','$aut_m', '$aut_f','#FAFAD2')"; 218 218 $res = $dbi->prepare("$sql"); 219 219 $res->execute(); … … 241 241 242 242 243 if ($op=="sezione") 243 if ($op=="sezione"){ 244 244 sezione($ok, $do,$id_sede,$id_sez, $num_sez, $aut_m, $aut_f, $maschi, $femmine, $id_sez2, $min); 245 } 245 246 ele(); 246 247 all(); -
trunk/admin/modules/Elezioni/ele_voti.php
r258 r260 111 111 } 112 112 113 function stato_rilevazione($id_sez,$solosede){114 global $id_cons, $prefix, $dbi, $id_cons_gen,$status,$genere,$votol, $votog, $votoc,$idrefgruppo,$num_ril,$circo,$dettnulli,$tipo_cons;115 116 if($idrefgruppo and $genere==0) $perref= "and id_gruppo='$idrefgruppo'";117 else $perref="";118 $ops=0;119 $status=0;120 $stret=0; $contains=0;121 ###########122 $sql="SELECT data,orario FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data asc,orario asc";123 $res = $dbi->prepare("$sql");124 $res->execute();125 126 127 $num_ril=$res->rowCount();128 $sql="SELECT stato_aff, stato_val,stato_gru,stato_lis,stato_can,status FROM ".$prefix."_ele_controllosez where id_sez='$id_sez' and id_cons='$id_cons'";129 $res3 = $dbi->prepare("$sql");130 $res3->execute();131 132 133 134 if($res3->rowCount()){135 list($aff,$val,$gru,$lis,$can,$status)=$res3->fetch(PDO::FETCH_NUM);136 if ($can) {$ops=-5;}137 elseif ($lis) {$ops=-3;}138 elseif($gru) {$ops=-4;}139 elseif ($val) {$ops=-2;}140 elseif($aff) {$ops=-1;}141 # if($can==1) $status=1;142 }else{143 $aff=0;$lis=0;$val=0;$gru=0;$can=0;$stret=0;$status=0;144 ##########################145 if($ops==0){146 #controllo congruenza affluenze147 $sql="SELECT count(num_sez) FROM ".$prefix."_ele_sezioni where id_cons='$id_cons'";148 $res3 = $dbi->prepare("$sql");149 $res3->execute();150 151 152 list($numtot) = $res3->fetch(PDO::FETCH_NUM);153 $test_ril=0;$pre_rilc=0;$pre_rilm=0;$pre_rilf=0;154 if($res->rowCount())155 while (list($giorno,$ora) = $res->fetch(PDO::FETCH_NUM)){156 $test_ril++;157 $query="SELECT voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' $perref and orario='$ora' and data='$giorno'";158 $sql="$query";159 $res2 = $dbi->prepare("$sql");160 $res2->execute();161 162 163 $numscru=$res2->rowCount();164 $query="SELECT sum(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' $perref and orario='$ora' and data='$giorno'";165 $sql="$query";166 $res2 = $dbi->prepare("$sql");167 $res2->execute();168 169 170 list($voti)=$res2->fetch(PDO::FETCH_NUM);171 if($numscru) {172 if(isset($ora)){173 $query="SELECT count(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' $perref and orario='$ora' and data='$giorno'";174 # $res3 = mysql_query("$query";175 # list($numscru)=mysql_fetch_row($res3);176 $sql="SELECT maschi+autorizzati_m,femmine+autorizzati_f FROM ".$prefix."_ele_sezioni where id_sez='$id_sez'";177 $res3 = $dbi->prepare("$sql");178 $res3->execute();179 180 181 list($iscrittim,$iscrittif) = $res3->fetch(PDO::FETCH_NUM);182 $iscritti=$iscrittim+$iscrittif;183 184 $query="SELECT voti_complessivi, voti_uomini, voti_donne FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' $perref and orario='$ora' and data='$giorno'";185 $sql="$query";186 $res3 = $dbi->prepare("$sql");187 $res3->execute();188 189 190 list($voti, $uomini, $donne)=$res3->fetch(PDO::FETCH_NUM);191 if (((($uomini+$donne)==0 and ($voti<=$iscritti) and $voti>=$pre_rilc) or ((($uomini+$donne)==$voti) and ($uomini<=$iscrittim) and ($donne<=$iscrittif) )) and $uomini>=$pre_rilm and $donne>=$pre_rilf and $voti>=$pre_rilc)192 {193 $ops=-1;$aff=1; $status=$test_ril;194 }elseif($numscru) {$aff=-1;$stret=1;break;}195 else {$status=0;$ops=-1;break;}196 }197 } else {$stret=-1;$aff=0;}198 $pre_rilc=$voti; $pre_rilm=$uomini;$pre_rilf=$donne;199 }200 #if(isset($num_ril) and $num_ril==$test_ril) $status=1;201 202 #controllo congruenza voti espressi203 #per referendum204 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'";205 $resref = $dbi->prepare("$sql");206 $resref->execute();207 208 209 if($genere==0){210 $numscru=$resref->rowCount(); $rifscru=0;211 while(list($idrefgruppo)=$resref->fetch(PDO::FETCH_NUM)) {212 $sql="SELECT si,no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_sez='$id_sez' and id_gruppo='$idrefgruppo'";213 $res2 = $dbi->prepare("$sql");214 $res2->execute();215 216 217 $refscru=$res2->rowCount();218 if($refscru){219 $query="SELECT voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_gruppo='$idrefgruppo' order by data desc, orario desc";220 $sql="$query";221 $res3 = $dbi->prepare("$sql");222 $res3->execute();223 224 225 list($voti)=$res3->fetch(PDO::FETCH_NUM);226 227 $rifscru++;228 list($si,$no,$validi,$nulli,$bianchi,$contestati)=$res2->fetch(PDO::FETCH_NUM);229 if(($si+$no==$validi) and ($validi+$nulli+$bianchi+$contestati==$voti)) { if($rifscru==$numscru) $status=5; else $status=4; $ops=-4;$val=1;} #{$status=1;return (-4);}230 else {$val=-1;$stret=4;break;} #return (4);231 } else { $stret=4;break;}232 }233 }else{234 #per le altre consultazione235 $sql="SELECT validi FROM ".$prefix."_ele_sezioni where id_sez='$id_sez' and id_cons='$id_cons' ";236 $res2 = $dbi->prepare("$sql");237 $res2->execute();238 239 240 if($res2){241 list($validi) = $res2->fetch(PDO::FETCH_NUM);242 if($validi) {243 $status=0;244 $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'";245 $sql="$query";246 $res4 = $dbi->prepare("$sql");247 $res4->execute();248 249 250 list($validi, $nulli, $bianchi,$contestati,$votinulli,$sologruppo,$validilista,$contestatilista,$votinullilista,$sololista)=$res4->fetch(PDO::FETCH_NUM);251 if($validi>0) {252 if (($validi+$nulli+$bianchi+$contestati+$votinulli)==$voti)253 {$status=2;$ops=(-4+$votog);$val=1;}254 else {$val=-1;$stret=(4-$votog);}255 } #else return 0;256 }257 }258 #controllo congruenza voti di gruppo259 if($genere!=4){260 $sql="SELECT sum(voti),sum(solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_cons='$id_cons'";261 $res3 = $dbi->prepare("$sql");262 $res3->execute();263 264 265 if($res3->rowCount() and !$votog){#$status=0;$ops=-4;266 list($votigs,$votisolog) = $res3->fetch(PDO::FETCH_NUM);267 if($votigs and $genere!=2) {268 # $status=0;269 # $query="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'";270 # $res4 = mysql_query("$query";271 # list($votigs)=mysql_fetch_row($res4);272 if($votigs>0||$sololista==$validi) {273 if (($votigs+$sololista)==$validi && (!$sologruppo || $votisolog==($sologruppo*$dettnulli) || ($sologruppo<$validi and $validilista+$contestatilista+$votinullilista==0)))274 {$status=3;$ops=-3;$gru=1;}275 else {$gru=-1; $stret=4;}276 } #else return 0;277 }278 }279 }#else {$gru=1;echo "--$votigs -- $votog";}280 if(($genere>1 and !$votol)){#$status=0;281 $sql="SELECT t1.preferenze,t1.id_fascia,t2.limite,t1.disgiunto FROM ".$prefix."_ele_cons_comune as t1 left join ".$prefix."_ele_conf as t2 on t1.id_conf=t2.id_conf where t1.id_cons='$id_cons'";282 $res4 = $dbi->prepare("$sql");283 $res4->execute();284 285 286 if($res4) list($testpref,$fascia,$limite,$disgiunto)=$res4->fetch(PDO::FETCH_NUM); else {$testpref=0;$fascia=0;$limite=0;}287 288 #controllo congruenza voti di lista289 # $res3= mysql_query("SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_cons='$id_cons'";290 # list($votil) = mysql_fetch_row($res3);291 $tablg=($fascia<=$limite && !$disgiunto) ? "gruppo":"lista";292 $query="SELECT sum(voti),sum(solo_".$tablg.") FROM ".$prefix."_ele_voti_$tablg where id_sez='$id_sez' and id_cons='$id_cons'";293 $sql=$query;294 $res4 = $dbi->prepare("$sql");295 $res4->execute();296 297 298 list($votils,$votisolols)=$res4->fetch(PDO::FETCH_NUM);299 $query="SELECT voti FROM ".$prefix."_ele_voti_$tablg where id_sez='$id_sez' and id_cons='$id_cons'";300 $sql=$query;301 $res4 = $dbi->prepare("$sql");302 $res4->execute();303 304 305 $sezscru=$res4->rowCount();306 if($sezscru) {307 if($genere==4 or $votog) {$contrlis= ($votisolols==$sololista || $votisolols==0) ? 1:0; }308 #################309 else {310 $contrlis=($sologruppo+$validilista+$contestatilista+$votinullilista)==$validi ? 1:0;311 if($contrlis and $disgiunto and ($sologruppo+$validilista+$contestatilista+$votinullilista)==0)312 $contrlis=($votisolols==$sololista || $votisolols==0) ? 1:0;313 if($contrlis and $tipo_cons==18 or $tipo_cons==19)314 while ( list($id_gruppo)=$resref->fetch(PDO::FETCH_NUM))315 {316 $sql="SELECT sum(voti-solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";317 $res3 = $dbi->prepare("$sql");318 $res3->execute();319 320 321 $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')";322 $res4 = $dbi->prepare("$sql");323 $res4->execute();324 325 326 list($vgruppo)=$res3->fetch(PDO::FETCH_NUM);327 list($vliste)=$res4->fetch(PDO::FETCH_NUM);328 if($vliste>$vgruppo) {$contrlis=0 ;}329 if($vliste<$vgruppo) {$contrlis=0 ;}330 }331 }332 #################333 334 if((($contrlis) and $validilista==$votils) or ($fascia<=$limite and $fascia)) {$status=4;$lis=1;$ops=-4;}335 elseif($sezscru) {$stret=3;$lis=-1;}336 337 # if($votils>0) {338 if($res4->rowCount()>0) {339 # $res4= mysql_query("SELECT count(0) FROM ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez' ";340 # list($contains)=mysql_fetch_row($res4);341 # if($contains==0) $tutte=1; else $tutte=0;342 343 $query="SELECT id_lista FROM ".$prefix."_ele_lista where id_cons='$id_cons' $circo";344 $sql="$query";345 $res3 = $dbi->prepare("$sql");346 $res3->execute();347 348 349 $contaliste=$res3->rowCount();350 $sql="SELECT preferenze FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'";351 $res4 = $dbi->prepare("$sql");352 $res4->execute();353 354 355 if($res4->rowCount()) list($testpref)=$res4->fetch(PDO::FETCH_NUM); else $testpref=0;356 while(list($testlista)=$res3->fetch(PDO::FETCH_NUM)){357 if($fascia<=$limite and !$disgiunto and !$dettnulli)358 {359 $sql="SELECT id_gruppo FROM ".$prefix."_ele_lista where id_cons='$id_cons' and id_lista='$testlista'";360 $res4 = $dbi->prepare("$sql");361 $res4->execute();362 363 364 list($idgruppo)=$res4->fetch(PDO::FETCH_NUM);365 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$idgruppo'";366 $res4 = $dbi->prepare("$sql");367 $res4->execute();368 369 370 371 }else{372 $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez' and id_lista='$testlista'";373 $res4 = $dbi->prepare("$sql");374 $res4->execute();375 376 377 }378 if($res4) list($testvotil)=$res4->fetch(PDO::FETCH_NUM); else $testvotil=0;379 $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_cons='$id_cons' and t1.id_sez='$id_sez' and t2.id_lista='$testlista'";380 $res4 = $dbi->prepare("$sql");381 $res4->execute();382 383 384 if($res4) list($testvotic)=$res4->fetch(PDO::FETCH_NUM); else $testvotic=0;385 $sql="SELECT 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_cons='$id_cons' and t1.id_sez='$id_sez' and t2.id_lista='$testlista'";386 $res4 = $dbi->prepare("$sql");387 $res4->execute();388 389 390 if($res4->rowCount()) $contains++;391 $totvotic=0;392 while(list($testvotic)=$res4->fetch(PDO::FETCH_NUM))393 {394 $totvotic+=$testvotic;395 if($testvotil<$testvotic) { $can=-1;break;}396 }397 if(($testvotil*$testpref)<$totvotic) { $can=-1;break;}398 }399 if($contains==$contaliste and $can==0) {$status=5;$can=1;$ops=-3;}400 elseif($can==-1) {$stret=3;}401 }402 }403 }elseif($ops==-3){ $ops=-4;}404 }405 if(isset($can)){406 $sql="insert into ".$prefix."_ele_controllosez values('$id_sez','$id_cons','$aff','$val','$gru','$lis','$can','$status')";407 $res4 = $dbi->prepare("$sql");408 $res4->execute();409 410 411 }412 }413 }414 if($aff==-1) {$stret=1;}415 elseif($val==-1) {$stret=(4-$votog);}416 elseif($gru==-1) {$stret=4;}417 elseif($lis==-1) {$stret=3;}418 elseif($can==-1) {$stret=3;}419 elseif($can==1) {$stret=-3;}420 elseif($lis==1) {$stret=-3;}421 elseif($gru==1) {$stret=-4;}422 elseif($val==1) {$stret=-(4-$votog);}423 else ($stret=-1);424 if($stret) return($stret);425 return ($ops);426 427 428 }429 430 113 // Offset - visualizza il numero di elementi per pagina 431 114 $offset=2; … … 461 144 462 145 echo "<div id=\"navmenu\"> <ul>"; 463 while(list($sez_num, $sez_id ,$sede_id,$c ursez) = $res->fetch(PDO::FETCH_NUM)) {146 while(list($sez_num, $sez_id ,$sede_id,$colore) = $res->fetch(PDO::FETCH_NUM)) { 464 147 $ops=''; 465 148 if(!$id_sez) {$id_sez=$sez_id; $id_sede=$sede_id;} … … 471 154 472 155 list($circ_id) = $result->fetch(PDO::FETCH_NUM); 473 /* 474 //colora la sezione 475 $sezstat=0; #die($ops); 476 $sezstat=stato_rilevazione($sez_id,$solosede); 477 $cursez="style=\" background: #bbbbbb;"; 478 $bgsez=""; 479 if ($sezstat>0) { 480 $cursez="style=\" background: #FF3300;";#rosso; 481 }else{ 482 if($sezstat==-5 or ($sezstat==-3 and $votoc)) 483 if($status<$num_ril or ($votoc and $status==0) or ($genere==5 and $status==2)) {$cursez="style=\" background: #ADFF2F;";}#verde-giallo 484 else $cursez="style=\" background: #99CC33;"; #verde 485 elseif($sezstat==-3){ 486 if($status==0) {$cursez="style=\" background: #B0E0E6;";}#powder-blue 487 elseif(($genere==4 and $status==5) or $votoc or $status==5 or ($genere==3 and $status==4)) $cursez="style=\" background: #99CC33;"; #verde 488 else $cursez="style=\" background: #00BFFF;"; #deepsky-blue 489 } 490 elseif($sezstat==-4){ 491 if($status==2) {$cursez="style=\" background: #F5F5F5;";}#whitesmoke 492 elseif ($genere>1 or ($genere==0 and $status<5)) $cursez="style=\" background: #98FB98;"; #palegreen 493 elseif ($genere==0 and $status==0) {$cursez="style=\" background: #DAA520;";} #gold 494 else $cursez="style=\" background: #99CC33;"; #verde 495 } 496 elseif($sezstat==-2){ 497 if($status==0) {$cursez="style=\" background: #B0E0E6;";}#powder-blue 498 else $cursez="style=\" background: #00BFFF;"; #deepsky-blue 499 } 500 elseif($sezstat==-1){ 501 if($status==0 and $status<$num_ril) {$cursez="style=\" background: #F5F5DC;";}#beige 502 elseif($status==1 and $status<$num_ril) {$cursez="style=\" background: #D3D3D3;";}#lightgray 503 elseif($status==2 and $status<$num_ril) {$cursez="style=\" background: #E0FFFF;";}#lightcyan 504 elseif($status==3 and $status<$num_ril) {$cursez="style=\" background: #F0E68C;";}#kaki 505 else {$sezstat=-4;$cursez="style=\" background: #DAA520;";} #gold 506 } 507 } 508 509 if ($sezstat) $ops=abs($sezstat); else $ops=1; 510 */ 156 511 157 if(!$ops) $ops=1; 512 158 $sql="SELECT num_sez FROM ".$prefix."_ele_sezioni where id_sez='$id_sez'"; … … 516 162 517 163 list($numero_sez) = $res2->fetch(PDO::FETCH_NUM); 518 if ($sez_num==$numero_sez) {$cursez.= " border: solid; border-color: YELLOW; border-width: 4px; border-left: solid gray 4px; border-top: solid gray 4px; \"";} else $cursez.=" \""; 164 if ($sez_num==$numero_sez) { 165 $cursez= "style=\" background: $colore; border: solid; border-color: YELLOW; border-width: 4px; border-left: solid gray 4px; border-top: solid gray 4px; \"";} 166 else $cursez="style=\" background: $colore; \""; 519 167 echo "\n<li $cursez><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$circ_id&id_sede=$sede_id&id_sez=$sez_id&ops=$ops&do=spoglio&id_lista=$id_lista\">$sez_num</a></b></li>\n"; 520 168 } … … 998 646 ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">" 999 647 ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">" 648 ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">" 1000 649 ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">" 1001 650 ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">" -
trunk/admin/modules/Elezioni/language/lang-it.php
r254 r260 76 76 define("_GRUPPO","Lista"); 77 77 define("_CANDIDATO","Candidato"); 78 define("_LISTA","Lista"); 78 79 define("_GRUPPOLOGO","Logo della Lista"); 79 80 define("_CONSI","Candidato Lista"); -
trunk/admin/modules/Elezioni/salva_gruppi.php
r259 r260 103 103 104 104 105 controllo_votig($id_cons,$id_sez,$genere ,$id_gruppo);105 controllo_votig($id_cons,$id_sez,$genere); 106 106 107 107 if ($fileout) fclose($fp); … … 117 117 global $prefix,$dbi,$id_sede,$id_cons_gen; 118 118 ############################## 119 $sql="select * from ".$prefix."_ele_controllosez where id_cons='$id_cons' and id_sez='$id_sez'";120 $resc = $dbi->prepare("$sql");121 $resc->execute();122 $conta=$resc->rowCount();123 119 $err=0; $err2=0; 124 120 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'"; -
trunk/admin/modules/Elezioni/salva_liste.php
r259 r260 25 25 26 26 if (isset($_GET['genere'])) $genere=intval($_GET['genere']); else $genere=''; 27 if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']); else $id_cons_gen=' ';28 if (isset($_GET['id_cons'])) $id_cons=intval($_GET['id_cons']); else $id_cons=' ';29 if (isset($_GET['op'])) $op=intval($_GET['op']); else $op=' ';30 if (isset($_GET['id_circ'])) $id_circ=intval($_GET['id_circ']); else $id_circ=' ';31 if (isset($_GET['id_sez'])) $id_sez=intval($_GET['id_sez']); else $id_sez=' ';32 if (isset($_GET['id_sede'])) $id_sede=intval($_GET['id_sede']); else $id_sede=' ';33 if (isset($_GET['id_lista'])) $id_lista=intval($_GET['id_lista']); else $id_lista=' ';34 if (isset($_GET['valista'])) $valista=intval($_GET['valista']); else $valista=' ';35 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=' ';36 if (isset($_GET['votinulli'])) $votinulli=intval($_GET['votinulli']); else $votinulli=' ';37 if (isset($_GET['contestati'])) $contestati=intval($_GET['contestati']); else $contestati=' ';38 if (isset($_GET['update'])) $update=intval($_GET['update']); else $update=' ';39 if (isset($_GET['pwd3'])) $pwd3=intval($_GET['pwd3']); else $pwd3=' ';40 if (isset($_GET['do'])) $do=intval($_GET['do']); else $do=' ';27 if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']); else $id_cons_gen='0'; 28 if (isset($_GET['id_cons'])) $id_cons=intval($_GET['id_cons']); else $id_cons='0'; 29 if (isset($_GET['op'])) $op=intval($_GET['op']); else $op='0'; 30 if (isset($_GET['id_circ'])) $id_circ=intval($_GET['id_circ']); else $id_circ='0'; 31 if (isset($_GET['id_sez'])) $id_sez=intval($_GET['id_sez']); else $id_sez='0'; 32 if (isset($_GET['id_sede'])) $id_sede=intval($_GET['id_sede']); else $id_sede='0'; 33 if (isset($_GET['id_lista'])) $id_lista=intval($_GET['id_lista']); else $id_lista='0'; 34 if (isset($_GET['valista'])) $valista=intval($_GET['valista']); else $valista='0'; 35 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg='0'; 36 if (isset($_GET['votinulli'])) $votinulli=intval($_GET['votinulli']); else $votinulli='0'; 37 if (isset($_GET['contestati'])) $contestati=intval($_GET['contestati']); else $contestati='0'; 38 if (isset($_GET['update'])) $update=intval($_GET['update']); else $update='0'; 39 if (isset($_GET['pwd3'])) $pwd3=intval($_GET['pwd3']); else $pwd3='0'; 40 if (isset($_GET['do'])) $do=intval($_GET['do']); else $do='0'; 41 41 if (isset($_GET['valista'])) $validi=intval($_GET['valista']); else $validi='0'; 42 if (isset($_GET['nulli'])) get_magic_quotes_gpc() ? $nulli=$_GET['nulli']:$nulli=intval($_GET['nulli']); else $nulli='';43 if (isset($_GET['bianchi'])) get_magic_quotes_gpc() ? $bianchi=$_GET['bianchi']:$bianchi=addslashes($_GET['bianchi']); else $bianchi='';44 if (isset($_GET['contestati'])) get_magic_quotes_gpc() ? $contestati=$_GET['contestati']:$contestati=addslashes($_GET['contestati']); else $contestati='';45 if (isset($_GET['votinulli'])) get_magic_quotes_gpc() ? $votinulli=$_GET['votinulli']:$votinulli=addslashes($_GET['votinulli']); else $votinulli='01-01-1900';46 if (isset($_GET['id_comune'])) $id_comune=intval($_GET['id_comune']); else $id_comune=' ';47 if (isset($_GET['ops'])) $ops=intval($_GET['ops']); else $ops=' ';48 if (isset($_GET['delete'])) $delete=intval($_GET['delete']); else $delete=' ';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'; 46 if (isset($_GET['id_comune'])) $id_comune=intval($_GET['id_comune']); else $id_comune='0'; 47 if (isset($_GET['ops'])) $ops=intval($_GET['ops']); else $ops='3'; 48 if (isset($_GET['delete'])) $delete=intval($_GET['delete']); else $delete='0'; 49 49 if (isset($_GET['circo'])) get_magic_quotes_gpc() ? $circo=$_GET['circo']:$circo=addslashes($_GET['circo']); else $circo=''; 50 50 … … 82 82 # if($id_lista){ 83 83 if($pwd3==1) { 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="delete from ".$prefix."_ele_controlli where tipo='candidato' and id_sez='$id_sez' "; 88 $res = $dbi->prepare("$sql"); 89 $res->execute(); 84 90 $sql="delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 85 91 $res = $dbi->prepare("$sql"); 86 92 $res->execute(); 87 $sql="delete from ".$prefix."_ele_ voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'";93 $sql="delete from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' "; 88 94 $res = $dbi->prepare("$sql"); 89 95 $res->execute(); … … 91 97 $res = $dbi->prepare("$sql"); 92 98 $res->execute(); 99 93 100 }elseif($id_lista){ 94 101 $sql="SELECT disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; … … 155 162 156 163 function controllo_votil($id_cons,$id_sez,$id_lista){ 157 global $prefix,$dbi,$id_sede,$id_cons_gen ;164 global $prefix,$dbi,$id_sede,$id_cons_gen,$validi; 158 165 ############################## 159 $sql="select * from ".$prefix."_ele_controllosez where id_cons='$id_cons' and id_sez='$id_sez'";160 $resc = $dbi->prepare("$sql");161 $resc->execute();162 $conta=$resc->rowCount();163 166 $err=0; $err2=0; 164 167 if($id_lista){ … … 185 188 $resref = $dbi->prepare("$sql"); 186 189 $resref->execute(); 190 $totlis=0; 191 $totgru=0; 192 $totsg=0; 193 $totsl=0; 194 $sql="SELECT validi,validi_lista,contestati_lista,voti_nulli_lista,solo_lista FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'"; 195 $res = $dbi->prepare("$sql"); 196 $res->execute(); 197 list($votiv,$validil,$contestatil,$nullil,$solol) = $res->fetch(PDO::FETCH_NUM); 187 198 while (list($idg,$votig,$svg)=$resref->fetch(PDO::FETCH_NUM)) { 188 199 $sql="SELECT sum(voti), sum(solo_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='$idg')"; 189 200 $res2 = $dbi->prepare("$sql"); 190 201 $res2->execute(); 202 $totgru+=$votig; 203 $totsg+=$svg; 191 204 if($res2->rowCount()){ 192 list($votil,$svl)=$res2->fetch(PDO::FETCH_NUM); 193 if(($votig+$svl)!=($votil+$svg)) 194 $err=1;include("if(($votig+$svl)!=($votil+$svg))"); 205 list($votil,$svl)=$res2->fetch(PDO::FETCH_NUM); 206 $totlis+=$votil; 207 $totsl+=$svl; 208 if(($votig+$svl)<($votil+$svg)) 209 $err=1; 195 210 } 196 } 197 211 212 } 213 if ($validil+$contestatil+$nullil+$solol+$totsg!=$votiv and $validil+$contestatil+$nullil+$solol>0) $err=1; 198 214 } 199 215
Note:
See TracChangeset
for help on using the changeset viewer.