Ignore:
Timestamp:
Mar 12, 2018, 8:53:21 PM (6 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

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

    r241 r253  
    1515        $_GET : $_POST;
    1616
    17 
     17include("pdoquery.php");
    1818if (isset($param['rss'])) $rss=intval($param['rss']); else $rss='0';
    1919if (isset($param['xls'])) $xls=intval($param['xls']); else $xls='0';
     
    2424if (isset($param['id_cons_gen'])) $id_cons_gen=intval($param['id_cons_gen']); else
    2525{
    26         $res = mysql_query("SELECT id_cons FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
    27         list($id_cons_pred)=mysql_fetch_row($res);
    28         $res = mysql_query("SELECT id_cons_gen FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons_pred' ", $dbi);
    29         list($id_cons_gen)=mysql_fetch_row($res);
     26        $id_cons_gen=dbpredefinita();
     27       
    3028}       
    3129if (isset($param['op'])) $op=$param['op']; else $op='';
     
    6260$ordine=htmlentities($ordine);
    6361
    64 $res = mysql_query("SELECT id_conf FROM ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$id_comune'" , $dbi);
    65 list($hondt) = mysql_fetch_row($res);
    66 
    67 $sql = "SELECT t3.genere,t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t3 where t1.tipo_cons=t3.tipo_cons and t2.id_comune=$id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.chiusa!='2' ";
    68 $res = mysql_query("$sql",$dbi);
    69 $tot=mysql_num_rows($res);
    70 if ($tot>0 and $id_cons_gen>0) {
    71         $sql = "SELECT t3.genere,t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t3 where t1.tipo_cons=t3.tipo_cons and t2.id_comune=$id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.chiusa!='2'";
    72 }else{
    73         $sql = "SELECT t3.genere,t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t3 where t1.tipo_cons=t3.tipo_cons and t2.id_comune=$id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa!='2' order by t1.data_fine desc limit 0,1 ";
    74 }
    75 $res = mysql_query("$sql",$dbi);
    76 if ($res) list($genere,$tipo_cons,$descr_cons,$id_cons_gen) = mysql_fetch_row($res);
     62$hondt = dbvalorehondt();
     63
     64$res=dbselectcons();
     65
     66$genere=$res['genere'];
     67$tipo_cons=$res['tipo_cons'];
     68$descr_cons=$res['descrizione'];
     69$id_cons_gen=$res['id_cons_gen'];
     70echo "descr:$descr_cons";
     71
     72
     73
     74##########
    7775
    7876if ($tipo_cons!=3) $limite=0;
Note: See TracChangeset for help on using the changeset viewer.