Ignore:
Timestamp:
Apr 13, 2019, 8:05:15 PM (5 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/temi/tour/menu.php

    r254 r265  
    1414Funzione Menu a cascata
    1515*************************/
    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);
    2226       
    2327        echo ' <table cellpadding="0" cellspacing="0" style="border:0px;text-align:left;"><tr><td>
     
    3842        if ($multicomune=='1')
    3943        {
    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);
     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();
    4349              if ($esiste_multi>=1) {
    4450                    echo " <li class=\"dropdown\">
     
    4753                           <ul class=\"drop-nav\">";
    4854                       
    49                       while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
     55                      while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
    5056                            echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id&amp;file=index\">
    5157    <img src=\"modules/Elezioni/images/logo.gif\" width=\"16\" height=\"16\" class=\"nobordo\"> $descrizione</a></li>";
     
    6268        ***********************************/
    6369       
    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();
    6675        //se esiste consultazione fa vedere i dati
    6776        if ($esiste>=1) {
     
    7079             <ul class=\"drop-nav\">";
    7180         
    72             while(list($id,$descrizione) = mysql_fetch_row($res)) {
     81            while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
    7382                echo "<li class=\"icon matita\"><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen=$id\">
    7483              ".substr($descrizione,0,31)."</a></li>";
     
    111120                ***********************************/
    112121
    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);
    115127         echo " <li class=\"dropdown\"><a href=\"#\"><strong>"._RISULTATI."</strong></a>
    116128             <ul class=\"drop-nav\">";
     
    140152                        }
    141153                }
    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);
    144159
    145160                if ($hondt>=1 and $chiusa==1) {
Note: See TracChangeset for help on using the changeset viewer.