Changeset 262 for trunk/admin/modules/Elezioni/salva_ref.php
- Timestamp:
- Apr 7, 2019, 5:16:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/salva_ref.php
r261 r262 92 92 93 93 94 95 controllo_votir($id_cons,$id_sez ,$genere,$id_gruppo);96 94 include("ele_controlli.php"); 95 controllo_votir($id_cons,$id_sez); 96 include("ele_colora_sez.php"); 97 97 if ($fileout) fclose($fp); 98 98 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); … … 104 104 105 105 106 function controllo_votir($id_cons,$id_sez,$genere){107 global $prefix,$dbi,$id_sede,$id_cons_gen;108 ##############################109 $err=0; $err2=0;110 $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons'";111 $resref = $dbi->prepare("$sql");112 $resref->execute();113 $numscru=$resref->rowCount(); $rifscru=0;114 while(list($idrefgruppo)=$resref->fetch(PDO::FETCH_NUM)) {115 $sql="SELECT si,no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_sez='$id_sez' and id_gruppo='$idrefgruppo'";116 $res2 = $dbi->prepare("$sql");117 $res2->execute();118 $refscru=$res2->rowCount();119 $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_gruppo='$idrefgruppo'";120 $res3 = $dbi->prepare("$sql");121 $res3->execute();122 list($voti)=$res3->fetch(PDO::FETCH_NUM);123 $rifscru++;124 list($si,$no,$validi,$nulli,$bianchi,$contestati)=$res2->fetch(PDO::FETCH_NUM);125 if(($si+$no==$validi) and ($validi+$nulli+$bianchi+$contestati==$voti))126 continue;127 else {$err=1; break;}128 106 129 130 131 #############132 $tipo='referendum';133 $sql="select id from ".$prefix."_ele_controlli where tipo='$tipo' and id_sez='$id_sez' and id='$idrefgruppo' ";134 $res = $dbi->prepare("$sql");135 $res->execute();136 $righe=$res->rowCount();137 if($righe){138 if(!$err){139 $sql="delete from ".$prefix."_ele_controlli where tipo='$tipo' and id='$id_sez' ";140 $res = $dbi->prepare("$sql");141 $res->execute();142 }143 $err=0;144 }145 if($err){146 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_sez')";147 $res = $dbi->prepare("$sql");148 $res->execute();149 }150 #############151 }152 include("ele_colora_sez.php");153 }154 107 155 108 ?>
Note:
See TracChangeset
for help on using the changeset viewer.