Ignore:
Timestamp:
Feb 9, 2019, 8:45:24 PM (5 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/temi/facebook/menu.php

    r34 r257  
    1919        $button="<br /><object><noscript><div><input name=\"vai\" type=\"image\" src=\"modules/Elezioni/images/ok2.jpg\" alt=\"ok\" title=\"ok\" /></div></noscript></object>";
    2020       
    21         $sqlcomu="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
    22         $rescomu= mysql_query("$sqlcomu",$dbi);
    23         list($descr_com,$fascia)=mysql_fetch_row($rescomu);
     21        $sql="select descrizione,fascia from ".$prefix."_ele_comuni where id_comune=$id_comune";
     22        $sth = $dbi->prepare("$sql");
     23        $sth->execute();       
     24        $row = $sth->fetch(PDO::FETCH_BOTH);
     25        list($descr_com,$fascia)=explode($row);
    2426        echo '<style type="text/css">
    2527                html,body{margin:0;padding:0}
     
    5254        if ($multicomune=='1')
    5355        {
    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 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);
     56              $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 group by t1.id_comune,t1.descrizione order by t1.descrizione asc";
     57        $sth = $dbi->prepare("$sql");
     58        $sth->execute();       
     59        $row = $sth->fetch(PDO::FETCH_BOTH);         
     60        $esiste_multi=mysql_num_rows($rescomu);
    5761              if ($esiste_multi>=1) {
    5862                    echo " <li>
     
    6165                          <ul>";
    6266                       
    63                       while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
     67                      while (list($id,$descrizione,)=$sth->fetch(PDO::FETCH_NUM)){
    6468                            echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id&amp;file=index\">$descrizione</a></li>";
    6569                        }
     
    7579        ***********************************/
    7680       
    77         $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);
    78         $esiste=mysql_num_rows($res);
     81        $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";
     82        $sth = $dbi->prepare("$sql");
     83        $sth->execute();       
     84        $esiste=$sth->rowCount();
    7985        //se esiste consultazione fa vedere i dati
    8086        if ($esiste>=1) {
     
    8389            <ul>";
    8490         
    85             while(list($id,$descrizione) = mysql_fetch_row($res)) {
     91            while(list($id,$descrizione) = $sth->fetch(PDO::FETCH_NUM)) {
    8692                echo "<li><a href=\"modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen=$id\">
    8793              ".substr($descrizione,0,31)."</a></li>";
     
    124130
    125131        $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
    126         list($num_circ) = mysql_fetch_row($res);
     132        $sql = "SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons'";
     133        $sth = $dbi->prepare("$sql");
     134        $sth->execute();       
     135        list($num_circ) = $sth->fetch(PDO::FETCH_NUM);
    127136         echo " <li><a href=\"#\"><strong>"._RISULTATI."</strong></a>
    128137            <ul>";
Note: See TracChangeset for help on using the changeset viewer.