Ignore:
Timestamp:
Apr 13, 2019, 8:05:15 PM (5 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/modules/Elezioni/menu.php

    r254 r265  
    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        $rescomu = $dbi->prepare("$sql");
     23        $rescomu->execute();
     24
     25        list($descr_com,$fascia)=$rescomu->fetch(PDO::FETCH_NUM);
    2426       
    2527       
     
    5052        if ($multicomune=='1')
    5153        {
    52               $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";
    53                
    54               $rescomu= mysql_query("$sqlcomu",$dbi);
    55               $esiste_multi=mysql_num_rows($rescomu);
     54              $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";
     55               
     56              $sql="$sqlcomu";
     57        $rescomu = $dbi->prepare("$sql");
     58        $rescomu->execute();
     59
     60              $esiste_multi=$rescomu->rowCount();
    5661              if ($esiste_multi>=1) {
    5762                echo "  <td>
     
    6772                        ";
    6873                       
    69                 while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
     74                while (list($id,$descrizione,)=$rescomu->fetch(PDO::FETCH_NUM)){
    7075                            $sel=($id == $id_comune) ? "selected=\"selected\"":"";
    7176                            echo "<option value=\"$id\" $sel >$descrizione</option>";
     
    8489       
    8590        echo "<td  >";
    86         $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);
    87         $esiste=mysql_num_rows($res);
     91        $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" ;
     92        $res = $dbi->prepare("$sql");
     93        $res->execute();
     94 
     95        $esiste=$res->rowCount();
    8896        //se esiste consultazione fa vedere i dati
    8997        if ($esiste>=1) {       
     
    99107                <select name=\"id_cons_gen\" class=\"moduloform\" 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\">";
    100108       
    101             while(list($id,$descrizione) = mysql_fetch_row($res)) {
     109            while(list($id,$descrizione) = $res->fetch(PDO::FETCH_NUM)) {
    102110               
    103111                $sel = ($id == $id_cons_gen) ? "selected=\"selected\"":"";             
     
    149157                Scelta Dati
    150158                ***********************************/
    151         $res = mysql_query("SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi);
    152         list($num_circ) = mysql_fetch_row($res);
     159        $sql="SELECT count(0) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
     160        $res = $dbi->prepare("$sql");
     161        $res->execute();
     162
     163        list($num_circ) = $res->fetch(PDO::FETCH_NUM);
    153164         
    154165                echo "<td>";
     
    188199                        }
    189200                }
    190                 $resc = mysql_query("SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" , $dbi);
    191                 list($chiusa)=mysql_fetch_row($resc);
     201                $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'" ;
     202        $resc = $dbi->prepare("$sql");
     203        $resc->execute();
     204
     205                list($chiusa)=$resc->fetch(PDO::FETCH_NUM);
    192206                if ($hondt>=1 and $chiusa==1) {
    193207                        echo "<option value=\"consiglieri\" ".$temp['consiglieri']." >"._CALCONS."</option>";
Note: See TracChangeset for help on using the changeset viewer.