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/Futura2/index.php

    r256 r265  
    88
    99$nometema=$tema;
    10 require_once("class/db/db.php"); //classe db
     10#require_once("class/db/db.php"); //classe db
    1111global $tema,$id_comune,$descr_cons,$genere,$tipo_cons,$multicomune;
    1212
     
    1919# descrizione comune
    2020if(!$id_comune or $id_comune=='') $id_comune=$siteistat;
    21 $res = $db->sql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ");
    22 list($descr_com) = $db->sql_fetchrow($res);
     21$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
     22        $res = $dbi->prepare("$sql");
     23        $res->execute();
     24
     25list($descr_com) = $res->fetch(PDO::FETCH_NUM);
    2326
    2427
     
    2730####################################
    2831
    29 global $op,$tema,$db,$nometema,$file,$bgcolor,$sitename,$dbi,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com;
     32global $op,$tema,$dbi,$nometema,$file,$bgcolor,$sitename,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com;
    3033
    3134include("temi/$tema/function_theme.php");
     
    3538$logo= "<img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"logo\" width=\"70\" align=\"left\"/>";
    3639
    37 $res = $db->sql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ");
    38         list($descr_com) = $db->sql_fetchrow($res);
     40$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
     41        $res = $dbi->prepare("$sql");
     42        $res->execute();
     43
     44        list($descr_com) = $res->fetch(PDO::FETCH_NUM);
    3945        $descr_com =stripslashes($descr_com);
    4046
     
    9197
    9298
    93         $res = $db->sql_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" );
    94         $esiste=$db->sql_numrows($res);
     99        $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";
     100        $res = $dbi->prepare("$sql");
     101        $res->execute();
     102       
     103        $esiste=$res->rowCount();
    95104
    96105                echo " <form  method=\"post\" action=\"modules.php\">
     
    102111                onchange=\"javascript:top.location.href='modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen='+this.options[this.options.selectedIndex].value\">";
    103112       
    104             while(list($id,$descrizione) = $db->sql_fetchrow($res)) {
     113            while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
    105114                $descrizione=substr(str_replace("+"," ",$descrizione),0,30);
    106115                $sel = ($id == $id_cons_gen) ? "selected=\"selected\"":"";             
     
    263272
    264273function grafvotanti_mob(){
    265         global $tema,$db,$prefix,$colortheme;
     274        global $tema,$dbi,$prefix,$colortheme;
    266275        echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
    267276       
     
    274283# gruppo per menu grafica
    275284function grafgruppo(){
    276         global $tema,$db,$prefix,$colortheme;
     285        global $tema,$dbi,$prefix,$colortheme;
    277286        echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
    278287        graf_gruppo_mob();     
     
    284293# gruppo per menu grafica
    285294function grafsezione(){
    286         global $tema,$db,$prefix,$colortheme;
     295        global $tema,$dbi,$prefix,$colortheme;
    287296        echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
    288297        graf_sezioni();
     
    348357
    349358function votanti_mob(){
    350         global $tema,$db,$prefix,$colortheme;
     359        global $tema,$dbi,$prefix,$colortheme;
    351360        echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
    352361        votanti_tabella();
     
    388397###############################################
    389398# scelta comune in caso di multicomune tema
    390 global $multicomune,$tema,$prefix,$db,$colortheme,$id_cons_gen,$info,$id_comune,$rss;
     399global $multicomune,$tema,$prefix,$dbi,$colortheme,$id_cons_gen,$info,$id_comune,$rss;
    391400
    392401echo "<center>
     
    399408        {
    400409
    401               $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";
    402                
    403               $rescomu= $db->sql_query($sqlcomu);
    404               $esiste_multi=$db->sql_numrows($rescomu);
     410              $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";
     411                                $rescomu = $dbi->prepare("$sql");
     412                                $rescomu->execute();
     413              $esiste_multi=$rescomu->rowCount();
    405414              if ($esiste_multi>=1) {
    406415               
     
    411420                        <option>Scegli il comune</option>";
    412421       
    413                 while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
    414                            // $sel=($id == $id_comune) ? "selected=\"selected\"":"";
     422                while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
     423                           $sel=($id == $id_comune) ? "selected=\"selected\"":"";
    415424                            echo "<option value=\"$id\" $sel >$descrizione</option>";
    416425                        }
     
    423432# colore del tema
    424433# la variabile rss, non usta in questo tema, Ú stata presa in prestito per determinare il colore del tema
    425 
     434$selez='';
    426435                echo "<select name=\"rss\" data-native-menu=\"false\"  > ";
    427436                echo "<option>Scegli il colore del tema</option>";                             
     
    441450###############################################
    442451# scelta comune in caso di multicomune tema
    443 global $tema,$db,$prefix,$colortheme,$id_comune,$descr_com;
     452global $tema,$dbi,$prefix,$colortheme,$id_comune,$descr_com;
    444453
    445454                echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
Note: See TracChangeset for help on using the changeset viewer.