- Timestamp:
- Apr 7, 2019, 7:10:40 PM (6 years ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/ele_colora_sez.php
r263 r264 15 15 $res->execute(); 16 16 }else{ #candidati 17 $sql="SELECT count(t2.id_lista)FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista";17 $sql="SELECT t2.id_lista FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' group by t2.id_lista"; 18 18 $res = $dbi->prepare("$sql"); 19 19 $res->execute(); 20 list($liste)=$res->fetch(PDO::FETCH_NUM);20 $liste=$res->rowCount(); 21 21 22 22 $sql="SELECT count(id_lista) FROM ".$prefix."_ele_lista where id_cons='$id_cons'"; -
trunk/admin/modules/Elezioni/ele_voti.php
r262 r264 687 687 688 688 if($id_lista) { 689 while(list($id_cand,$id_cons2,$id_lista2, $cognome, $nome, $note, $simbolo, $num_cand) = $result->fetch(PDO::FETCH_NUM)){689 while(list($id_cand,$id_cons2,$id_lista2,$nl, $cognome, $nome, $note, $simbolo, $num_cand) = $result->fetch(PDO::FETCH_NUM)){ 690 690 // dati lista 691 691 $sql="select id_lista, descrizione,simbolo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista2'"; -
trunk/admin/modules/Elezioni/salva_liste.php
r262 r264 51 51 global $prefix,$id_parz,$fileout; 52 52 if($id_lista){ 53 $sql="select num_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista' ORDER BY num_cand ";53 $sql="select num_cand,id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista' ORDER BY num_cand "; 54 54 $result = $dbi->prepare("$sql"); 55 55 $result->execute(); 56 while(list($i )=$result->fetch(PDO::FETCH_BOTH)) {56 while(list($i,$y)=$result->fetch(PDO::FETCH_NUM)) { 57 57 $vot="voti$i";$cand="id_cand$i"; 58 if (isset($_GET[$cand])) $idcand[$i]=intval($_GET[$cand]); else $idcand[$i]= '0';58 if (isset($_GET[$cand])) $idcand[$i]=intval($_GET[$cand]); else $idcand[$i]=$y; 59 59 if (isset($_GET[$vot])) $voti[$i]=intval($_GET[$vot]); else $voti[$i]='0'; 60 60 # if (isset($_GET[$solo])) $solog[$i]=intval($_GET[$solo]); else $solog[$i]='0'; … … 66 66 $result->execute(); 67 67 $sololiste=0; 68 while(list($i)=$result->fetch(PDO::FETCH_ BOTH)) {68 while(list($i)=$result->fetch(PDO::FETCH_NUM)) { 69 69 $vot="voti$i";$vnp="vnpl$i";$slp="slpl$i";$idlist="id_lista$i"; 70 70 if (isset($_GET[$vnp])) $vnpl[$i]=intval($_GET[$vnp]); else $vnpl[$i]='0'; … … 101 101 102 102 }elseif($id_lista){ 103 $sql="SELECT disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' "; 104 $res = $dbi->prepare("$sql"); 105 $res->execute(); 106 list($disgiunto)=$res->fetch(PDO::FETCH_NUM); 107 if($disgiunto){ 108 } 109 foreach($idcand as $idkey=>$idc){ 110 103 foreach($idcand as $idkey=>$idc){ 111 104 $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'"; 112 105 $result = $dbi->prepare("$sql");
Note:
See TracChangeset
for help on using the changeset viewer.