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/facebook/menu.php

    r254 r265  
    2626        $button="<br /><object><noscript><div><input name=\"vai\" type=\"image\" src=\"modules/Elezioni/images/ok2.jpg\" alt=\"ok\" title=\"ok\" /></div></noscript></object>";
    2727       
    28         $sqlcomu="select descrizione from ".$prefix."_ele_comuni where id_comune=$id_comune";
    29         $rescomu= mysql_query("$sqlcomu",$dbi);
    30         list($descr_com)=mysql_fetch_row($rescomu);
    31         $sqlcomu="select id_fascia from ".$prefix."_ele_cons_comune where id_comune=$id_comune and id_cons='$id_cons'";
    32         $rescomu= mysql_query("$sqlcomu",$dbi);
    33         list($fascia)=mysql_fetch_row($rescomu);
     28        $sql="select descrizione from ".$prefix."_ele_comuni where id_comune=$id_comune";
     29        $rescomu = $dbi->prepare("$sql");
     30        $rescomu->execute();
     31
     32        list($descr_com)=$rescomu->fetch(PDO::FETCH_NUM);
     33        $sql="select id_fascia from ".$prefix."_ele_cons_comune where id_comune=$id_comune and id_cons='$id_cons'";
     34        $res = $dbi->prepare("$sql");
     35        $res->execute();
     36
     37        list($fascia)=$rescomu->fetch(PDO::FETCH_NUM);
    3438        echo '<style type="text/css">
    3539                html,body{margin:0;padding:0}
     
    6266        if ($multicomune=='1')
    6367        {
    64               $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";
    65               $rescomu= mysql_query("$sqlcomu",$dbi);
    66               $esiste_multi=mysql_num_rows($rescomu);
     68              $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";
     69        $rescomu = $dbi->prepare("$sql");
     70        $rescomu->execute();
     71
     72              $esiste_multi=$rescomu->rowCount();
    6773              if ($esiste_multi>=1) {
    6874                    echo " <li>
     
    7177                          <ul>";
    7278                       
    73                       while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
     79                      while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
    7480                            echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id&amp;file=index\">
    7581    <img src=\"modules/Elezioni/images/logo.gif\" width=\"16\" height=\"16\" class=\"nobordo\"> $descrizione</a></li>";
     
    8692        ***********************************/
    8793       
    88         $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);
    89         $esiste=mysql_num_rows($res);
     94        $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" ;
     95        $res = $dbi->prepare("$sql");
     96        $res->execute();
     97 
     98        $esiste=$res->rowCount();
    9099        //se esiste consultazione fa vedere i dati
    91100        if ($esiste>=1) {
     
    94103            <ul>";
    95104         
    96             while(list($id,$descrizione) = mysql_fetch_row($res)) {
     105            while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
    97106                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\">
    98107              ".substr($descrizione,0,33)."</a></li>";
     
    134143                ***********************************/
    135144
    136         $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
    137         list($num_circ) = mysql_fetch_row($res);
     145        $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
     146        $res = $dbi->prepare("$sql");
     147        $res->execute();
     148
     149        list($num_circ) = $res->fetch(PDO::FETCH_NUM);
    138150         echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
    139151            <ul>";
     
    163175                        }
    164176                }
    165                 $resc = mysql_query("SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" , $dbi);
    166                 list($chiusa)=mysql_fetch_row($resc);
     177                $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
     178        $resc = $dbi->prepare("$sql");
     179        $resc->execute();
     180
     181                list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
    167182
    168183                if ($hondt>=1 and $chiusa==1) {
Note: See TracChangeset for help on using the changeset viewer.