Changeset 424 for trunk/client/modules/Elezioni/consiglieri.php
- Timestamp:
- Jun 13, 2024, 7:18:22 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/consiglieri.php
r420 r424 132 132 elseif ($numgruppo>0){ 133 133 $sqllis = "SELECT t1.id_lista,t1.num_lista,t1.descrizione,t1.id_gruppo from ".$prefix."_ele_lista as t1, ".$prefix."_ele_gruppo as t2 where t1.id_cons='$id_cons' and t1.id_gruppo=t2.id_gruppo and t2.num_gruppo not in (".$_SESSION['ballo1'].",".$_SESSION['ballo2'].")"; 134 $res_lis = $dbi->prepare("$sqllis"); 135 $res_lis->execute(); 136 134 $res_lis = $dbi->prepare("$sqllis"); 135 $res_lis->execute(); 137 136 $yy=$res_lis->rowCount(); 138 $sql = "select sum(voti) from ".$prefix."_ele_voti_lista where id_cons='$id_cons'"; 139 $res_voti = $dbi->prepare("$sql"); 140 $res_voti->execute(); 141 142 list($validilista) = $res_voti->fetch(PDO::FETCH_NUM); 137 $sql = "select sum(voti) from ".$prefix."_ele_voti_lista where id_cons='$id_cons'"; 138 $res_voti = $dbi->prepare("$sql"); 139 $res_voti->execute(); 140 list($validilista) = $res_voti->fetch(PDO::FETCH_NUM); 143 141 if ($yy){ 144 while(list($id_lista,$num_lista,$descr,$pgrup) = $res_lis->fetch(PDO::FETCH_NUM)) { 145 $sql = "select sum(voti) from ".$prefix."_ele_voti_lista where id_lista='$id_lista'"; 146 $res_voti = $dbi->prepare("$sql"); 147 $res_voti->execute(); 148 149 list($votilista) = $res_voti->fetch(PDO::FETCH_NUM); 150 if(!isset($voti[$pgrup])) $voti[$pgrup]=0; 151 $voti[$pgrup]+=$votilista; 152 } 153 foreach ($voti as $key=>$val){if($val<($validilista*3/100)) unset($voti[$key]);} ################################################## 142 while(list($id_lista,$num_lista,$descr,$pgrup) = $res_lis->fetch(PDO::FETCH_NUM)) { 143 $sql = "select sum(voti) from ".$prefix."_ele_voti_lista where id_lista='$id_lista'"; 144 $res_voti = $dbi->prepare("$sql"); 145 $res_voti->execute(); 146 list($votilista) = $res_voti->fetch(PDO::FETCH_NUM); 147 if(!isset($voti[$pgrup])) $voti[$pgrup]=0; 148 $voti[$pgrup]+=$votilista; 149 } 150 $togli=array(); 151 foreach ($voti as $key=>$val){ 152 if($val<($validilista*3/100)) 153 $togli[]=$key; 154 } 155 foreach($togli as $key=>$val) 156 unset($voti[$val]); ################################################## 154 157 $res_lis = $dbi->prepare("$sqllis"); 155 158 $res_lis->execute(); … … 161 164 echo "<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"/></td>"; 162 165 163 echo "<td><b>".$_SESSION['grp1']."</b></td>";166 echo "<td><b>".$_SESSION['grp1']."</b></td>"; 164 167 echo "<td><b>".$_SESSION['grp2']."</b></td>"; 165 168 echo "<td><b>"._NONCOLLE."</b></td></tr>";
Note:
See TracChangeset
for help on using the changeset viewer.