Changeset 342 for trunk/client/modules/Elezioni/index.php
- Timestamp:
- Nov 18, 2020, 11:05:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/index.php
r340 r342 1062 1062 } 1063 1063 if ($votog) 1064 $sql="select id_sez from ".$prefix."_ele_voti_candidati where id_lista in (select id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $sqlcir) group byid_sez ";1064 $sql="select t1.id_sez from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t2.id_lista in (select id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $sqlcir) group by t1.id_sez "; 1065 1065 else 1066 1066 $sql="select id_sez from ".$prefix."_ele_voti_lista where id_lista in (select id_lista from ".$prefix."_ele_lista where id_cons='$id_cons' $sqlcir) group by id_sez "; 1067 1068 1067 $res1 = $dbi->prepare("$sql"); 1069 1068 $res1->execute(); … … 1149 1148 // funzione visualizzazione delle liste per camera e senato con raggruppamenti/coalizioni 1150 1149 function liste(){ 1151 global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo,$genere,$id_comune ;1150 global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo,$genere,$id_comune,$id_circ; 1152 1151 //dati(); 1153 1152 $offset=10; … … 1155 1154 1156 1155 // numero sezioni scrutinate sul gruppo 1157 if ($circo) $circos = "and id_circ=$id_circ" ; else $circos=''; 1158 if ($genere==0) $tab="ref"; else $tab="gruppo"; 1159 $sql="select * from ".$prefix."_ele_voti_".$tab." where id_cons='$id_cons' $circos group by id_sez "; 1160 $res = $dbi->prepare("$sql"); 1161 $res->execute(); 1162 1156 if ($circo) $circos = "and t2.id_circ=$id_circ" ; else $circos=''; 1157 if ($genere==0) { 1158 $sql="select * from ".$prefix."_ele_voti_ref where id_cons='$id_cons' group by id_sez "; 1159 }else{ 1160 $sql="select t1.* from ".$prefix."_ele_voti_gruppo as t1 left join ".$prefix."_ele_gruppo as t2 on t1.id_gruppo=t2.id_gruppo where t2.id_cons='$id_cons' $circos group by t1.id_sez "; 1161 } 1162 $res = $dbi->prepare("$sql"); 1163 $res->execute(); 1163 1164 $numero=$res->rowCount(); 1164 $sql="select * from ".$prefix."_ele_sezioni whereid_cons='$id_cons' $circos ";1165 $sql="select t1.* from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t2.id_cons='$id_cons' $circos "; 1165 1166 $res = $dbi->prepare("$sql"); 1166 1167 $res->execute(); 1167 1168 1168 1169 $sezioni=$res->rowCount(); 1169 $sql="select chiusa from ".$prefix."_ele_cons_comune where id_cons='$id_cons' $circos";1170 $sql="select chiusa from ".$prefix."_ele_cons_comune where id_cons='$id_cons'"; 1170 1171 $res = $dbi->prepare("$sql"); 1171 1172 $res->execute(); … … 1181 1182 1182 1183 // tot liste 1183 $sql="SELECT * FROM ".$prefix."_ele_lista where id_cons='$id_cons'";1184 $sql="SELECT t2.* FROM ".$prefix."_ele_lista as t2 where t2.id_cons='$id_cons' $circos "; 1184 1185 $res = $dbi->prepare("$sql"); 1185 1186 $res->execute(); … … 1194 1195 list($voti_lista_tutti) = $res_lista_tutti->fetch(PDO::FETCH_NUM); 1195 1196 1196 $sql="select id_cons ,id_lista ,id_gruppo, num_lista, descrizione from ".$prefix."_ele_lista where id_cons='$id_cons'ORDER BY num_lista LIMIT $min,$offset";1197 $sql="select id_cons ,id_lista ,id_gruppo, num_lista, descrizione from ".$prefix."_ele_lista as t2 where id_cons='$id_cons' $circos ORDER BY num_lista LIMIT $min,$offset"; 1197 1198 $result = $dbi->prepare("$sql"); 1198 1199 $result->execute();
Note:
See TracChangeset
for help on using the changeset viewer.