Changeset 262 for trunk/admin/modules/Elezioni/salva_gruppi.php
- Timestamp:
- Apr 7, 2019, 5:16:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/salva_gruppi.php
r260 r262 102 102 103 103 104 104 include("ele_controlli.php"); 105 105 controllo_votig($id_cons,$id_sez,$genere); 106 include("ele_colora_sez.php"); 106 107 107 108 if ($fileout) fclose($fp); … … 114 115 115 116 116 function controllo_votig($id_cons,$id_sez,$genere){117 global $prefix,$dbi,$id_sede,$id_cons_gen;118 ##############################119 $err=0; $err2=0;120 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'";121 $resref = $dbi->prepare("$sql");122 $resref->execute();123 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez'";124 $res3 = $dbi->prepare("$sql");125 $res3->execute();126 list($voti)=$res3->fetch(PDO::FETCH_NUM);127 $sql="SELECT validi FROM ".$prefix."_ele_sezioni where id_sez='$id_sez' and id_cons='$id_cons' ";128 $res2 = $dbi->prepare("$sql");129 $res2->execute();130 list($validi) = $res2->fetch(PDO::FETCH_NUM);131 if($validi) {132 $status=0;133 $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'";134 $sql="$query";135 $res4 = $dbi->prepare("$sql");136 $res4->execute();137 list($validi, $nulli, $bianchi,$contestati,$votinulli)=$res4->fetch(PDO::FETCH_NUM);138 if (($validi+$nulli+$bianchi+$contestati+$votinulli)!=$voti)139 {$err=1;}140 }141 $tipo='gruppo';142 $sql="select id from ".$prefix."_ele_controlli where tipo='$tipo' and id_sez='$id_sez'";143 $res = $dbi->prepare("$sql");144 $res->execute();145 $righe=$res->rowCount();146 if($righe){147 if(!$err){148 $sql="delete from ".$prefix."_ele_controlli where tipo='$tipo' and id='$id_sez' ";149 $res = $dbi->prepare("$sql");150 $res->execute();151 }152 $err=0;153 }154 if($err){155 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_sez')";156 $res = $dbi->prepare("$sql");157 $res->execute();158 }159 include("ele_colora_sez.php");160 161 }162 117 163 118 ?>
Note:
See TracChangeset
for help on using the changeset viewer.