Changeset 257 for trunk/admin/temi


Ignore:
Timestamp:
Feb 9, 2019, 8:45:24 PM (5 years ago)
Author:
roby
Message:
 
Location:
trunk/admin/temi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/temi/altro/index.php

    r2 r257  
    1313global $nometema,$id_comune,$id_cons_gen,$aid,$dbi,$prefix;
    1414$nometema=$tema;
    15 $res_com = mysql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune'",$dbi);
    16 $res_cons = mysql_query("SELECT descrizione FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'",$dbi);
    17 list($descr_comune) = mysql_fetch_row($res_com);
    18 list($descr_consultazione) = mysql_fetch_row($res_cons);
     15$res_com = "SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune'";
     16$sth = $dbi->prepare("$sql");
     17$sth->execute();       
     18list($descr_comune) = $sth->fetch(PDO::FETCH_NUM);
     19$sql="SELECT descrizione FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'";
     20$sth = $dbi->prepare("$sql");
     21$sth->execute();       
     22list($descr_consultazione) = $sth->fetch(PDO::FETCH_NUM);
    1923
    2024echo "<div class=\"container\"><table width=\"95%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"table-main\">
  • trunk/admin/temi/facebook/index.php

    r80 r257  
    9595// Blocco link
    9696
    97 $result = mysql_query("select mid, title, preamble, content,editimage from ".$prefix."_ele_link where id_cons='$id_cons' order by mid ", $dbi);
    98     if (mysql_num_rows($result) == 0) {
     97        $sql="select mid, title, preamble, content,editimage from ".$prefix."_ele_link where id_cons='$id_cons' order by mid";
     98        $sth = $dbi->prepare("$sql");
     99        $sth->execute();       
     100        $row = $sth->fetchAll();
     101    if ($sth->rowCount() == 0) {
    99102        echo "</td></tr></table>";
    100103        echo "</div></td><td>";
     
    103106    } else {
    104107        echo "<h5>"._LINK."</h5><p>";
    105         while (list($mid, $title, $preamble,$content,  $editimage) = mysql_fetch_row($result)) {
     108        foreach($row as $row2) {
     109                list($mid, $title,$preamble,$content,$editimage) = explode($row2)) {
    106110                if ($title != "" && $content != "") {
    107111                        $content = stripslashes($content);
  • 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.