Changeset 265 for trunk/client/temi/blog/menu.php
- Timestamp:
- Apr 13, 2019, 8:05:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/temi/blog/menu.php
r254 r265 14 14 Funzione Menu a cascata 15 15 *************************/ 16 $sqlcomu="select descrizione from ".$prefix."_ele_comuni where id_comune=$id_comune"; 17 $rescomu= mysql_query("$sqlcomu",$dbi); 18 list($descr_com)=mysql_fetch_row($rescomu); 19 $sqlcomu="select id_fascia from ".$prefix."_ele_cons_comune where id_comune=$id_comune and id_cons='$id_cons'"; 20 $rescomu= mysql_query("$sqlcomu",$dbi); 21 list($fascia)=mysql_fetch_row($rescomu); 16 $sql="select descrizione from ".$prefix."_ele_comuni where id_comune=$id_comune"; 17 $rescomu = $dbi->prepare("$sql"); 18 $rescomu->execute(); 19 20 list($descr_com)=$rescomu->fetch(PDO::FETCH_NUM); 21 $sql="select id_fascia from ".$prefix."_ele_cons_comune where id_comune=$id_comune and id_cons='$id_cons'"; 22 $rescomu = $dbi->prepare("$sql"); 23 $rescomu->execute(); 24 25 list($fascia)=$rescomu->fetch(PDO::FETCH_NUM); 22 26 23 27 echo ' <table cellpadding="0" cellspacing="0" style="border:0px;text-align:left;"><tr><td> … … 38 42 if ($multicomune=='1') 39 43 { 40 $sqlcomu="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune and t2.chiusa!='2' group by t1.id_comune,t1.descrizione order by t1.descrizione asc"; 41 $rescomu= mysql_query("$sqlcomu",$dbi); 42 $esiste_multi=mysql_num_rows($rescomu); 43 if ($esiste_multi>=1) { 44 $sql="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune and t2.chiusa!='2' group by t1.id_comune,t1.descrizione order by t1.descrizione asc"; 45 $rescomu = $dbi->prepare("$sql"); 46 $rescomu->execute(); 47 48 $esiste_multi=$rescomu->rowCount(); 49 if ($esiste_multi>=1) { 44 50 echo " <li class=\"dropdown\"> 45 51 <a href=\"#\"><strong>"._COMUNI."</strong></a> … … 47 53 <ul class=\"drop-nav\">"; 48 54 49 while (list($id,$descrizione,)= mysql_fetch_row($rescomu)){55 while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){ 50 56 echo "<li><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id&file=index\"> 51 57 <img src=\"modules/Elezioni/images/logo.gif\" width=\"16\" height=\"16\" class=\"nobordo\"> $descrizione</a></li>"; … … 62 68 ***********************************/ 63 69 64 $res = mysql_query("SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc" , $dbi); 65 $esiste=mysql_num_rows($res); 70 $sql="SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc" ; 71 $res = $dbi->prepare("$sql"); 72 $res->execute(); 73 74 $esiste=$res->rowCount(); 66 75 //se esiste consultazione fa vedere i dati 67 76 if ($esiste>=1) { … … 70 79 <ul class=\"drop-nav\">"; 71 80 72 while(list($id,$descrizione) = mysql_fetch_row($res)) {81 while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) { 73 82 echo "<li class=\"icon matita\"><a href=\"modules.php?op=gruppo&name=Elezioni&id_comune=$id_comune&file=index&id_cons_gen=$id\"> 74 83 ".substr($descrizione,0,60)."</a></li>"; … … 111 120 ***********************************/ 112 121 113 $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi); 114 list($num_circ) = mysql_fetch_row($res); 122 $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' "; 123 $res = $dbi->prepare("$sql"); 124 $res->execute(); 125 126 list($num_circ) = $res->fetch(PDO::FETCH_NUM); 115 127 echo " <li class=\"dropdown\"><a href=\"#\"><strong>"._RISULTATI."</strong></a> 116 128 <ul class=\"drop-nav\">"; … … 140 152 } 141 153 } 142 $resc = mysql_query("SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" , $dbi); 143 list($chiusa)=mysql_fetch_row($resc); 154 $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ; 155 $resc = $dbi->prepare("$sql"); 156 $resc->execute(); 157 158 list($chiusa)=$resc->fetch(PDO::FETCH_NUM); 144 159 145 160 if ($hondt>=1 and $chiusa==1) {
Note:
See TracChangeset
for help on using the changeset viewer.