Changeset 288 for trunk/admin/modules/Elezioni/ele_controlli.php
- Timestamp:
- Apr 24, 2019, 10:44:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_controlli.php
r262 r288 269 269 $totsg=0; 270 270 $totsl=0; 271 $tnl=0; 272 $sql="SELECT sum(voti),sum(nulli_lista),sum(solo_lista) FROM ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'"; 273 $resl = $dbi->prepare("$sql"); 274 $resl->execute(); 271 275 $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'"; 272 276 $res = $dbi->prepare("$sql"); … … 274 278 list($votiv,$validil,$contestatil,$nullil,$solol) = $res->fetch(PDO::FETCH_NUM); 275 279 while (list($idg,$votig,$svg)=$resref->fetch(PDO::FETCH_NUM)) { 276 $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')";280 $sql="SELECT sum(voti), sum(nulli_lista),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')"; 277 281 $res2 = $dbi->prepare("$sql"); 278 282 $res2->execute(); … … 280 284 $totsg+=$svg; 281 285 if($res2->rowCount()){ 282 list($votil,$ svl)=$res2->fetch(PDO::FETCH_NUM);286 list($votil,$nl,$svl)=$res2->fetch(PDO::FETCH_NUM); 283 287 $totlis+=$votil; 284 288 $totsl+=$svl; 285 if(($votig+$svl)<($votil+$svg)) 289 $tnl+=$nl; 290 if(($votig+$svl)<($votil+$svg+$nl)) 286 291 $err=1; 287 292 } 288 293 289 294 } 290 if ($validil+$contestatil+$nullil+$solol+$totsg!=$votiv and $validil+$contestatil+$nullil+$solol>0) $err=1; 295 if ($validil+$contestatil+$nullil+$totsg!=$votiv and $validil+$contestatil+$nullil+$solol>0) $err=1; 296 if($tnl!=$nullil || $totsl!=$solol) $err=1; 291 297 } 292 298
Note:
See TracChangeset
for help on using the changeset viewer.