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/realistic/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        $rescomu = $dbi->prepare("$sql");
     35        $rescomu->execute();
     36
     37        list($fascia)=$rescomu->fetch(PDO::FETCH_NUM);
    3438        echo '
    3539            <div id="contiene">
     
    5256        if ($multicomune=='1')
    5357        {
    54               $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";
    55               $rescomu= mysql_query("$sqlcomu",$dbi);
    56               $esiste_multi=mysql_num_rows($rescomu);
     58              $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";
     59                        $rescomu = $dbi->prepare("$sql");
     60                        $rescomu->execute();
     61
     62              $esiste_multi=$rescomu->rowCount();
    5763              if ($esiste_multi>=1) {
    5864                    echo " <li>
     
    6167                          <ul>";
    6268                       
    63                       while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
     69                      while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
    6470                            echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id&amp;file=index\">
    6571    <img src=\"modules/Elezioni/images/logo.gif\" width=\"16\" height=\"16\" class=\"nobordo\"> $descrizione</a></li>";
     
    7682        ***********************************/
    7783       
    78         $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);
    79         $esiste=mysql_num_rows($res);
     84        $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" ;
     85        $res = $dbi->prepare("$sql");
     86        $res->execute();
     87 
     88        $esiste=$res->rowCount();
    8089        //se esiste consultazione fa vedere i dati
    8190        if ($esiste>=1) {
     
    8493            <ul>";
    8594         
    86             while(list($id,$descrizione) = mysql_fetch_row($res)) {
     95            while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
    8796                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\">
    8897              ".substr($descrizione,0,60)."</a></li>";
     
    124133                ***********************************/
    125134
    126         $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
    127         list($num_circ) = mysql_fetch_row($res);
     135        $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
     136        $res = $dbi->prepare("$sql");
     137        $res->execute();
     138
     139        list($num_circ) = $res->fetch(PDO::FETCH_NUM);
    128140         echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
    129141            <ul>";
     
    153165                        }
    154166                }
    155                 $resc = mysql_query("SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" , $dbi);
    156                 list($chiusa)=mysql_fetch_row($resc);
     167                $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
     168        $resc = $dbi->prepare("$sql");
     169        $resc->execute();
     170
     171                list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
    157172
    158173                if ($hondt>=1 and $chiusa==1) {
Note: See TracChangeset for help on using the changeset viewer.