Ignore:
Timestamp:
Mar 13, 2018, 9:26:23 PM (6 years ago)
Author:
roby
Message:

adeguata la funzione di installazione al php7

File:
1 edited

Legend:

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

    r253 r254  
    1515        $_GET : $_POST;
    1616
    17 include("pdoquery.php");
     17
    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         $id_cons_gen=dbpredefinita();
    27        
     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);
    2830}       
    2931if (isset($param['op'])) $op=$param['op']; else $op='';
     
    6062$ordine=htmlentities($ordine);
    6163
    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'];
    70 echo "descr:$descr_cons";
    71 
    72 
    73 
    74 ##########
     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);
     65list($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);
     70if ($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);
     76if ($res) list($genere,$tipo_cons,$descr_cons,$id_cons_gen) = mysql_fetch_row($res);
    7577
    7678if ($tipo_cons!=3) $limite=0;
     
    9092$res = mysql_query("SELECT limite FROM ".$prefix."_ele_conf where id_conf='$hondt'" , $dbi);
    9193list($limite) = mysql_fetch_row($res);
    92 $res = mysql_query("SELECT fascia FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ", $dbi);
     94$res = mysql_query("SELECT id_fascia FROM ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons='$id_cons'", $dbi);
    9395list($fascia) = mysql_fetch_row($res);
    9496if(!$id_circ){         
     
    190192    } else {
    191193        while (list($mid, $title, $preamble,$content,  $editimage) = mysql_fetch_row($result)) {
    192         if ($title != "" && $content != "") {
     194        if ($title != "" && $preamble != "") {
    193195               
    194196                if ($info=="link"){
     
    532534        $NicolaSezTot = mysql_fetch_row($NicolaSez);
    533535       
    534                 $resperc=mysql_query("select sum(validi),sum(nulli+bianchi+contestati+voti_nulli+solo_lista) from ".$prefix."_ele_sezioni where id_cons='$id_cons'",$dbi);
     536                $resperc=mysql_query("select sum(validi),sum(nulli+bianchi+contestati+voti_nulli) from ".$prefix."_ele_sezioni where id_cons='$id_cons'",$dbi);
    535537                list($scruvalidi,$scrunulli)=mysql_fetch_row($resperc);
    536538                $resperc = mysql_query("select sum(voti_complessivi) from ".$prefix."_ele_voti_parziale where id_cons='$id_cons' group by data,orario order by data desc, orario desc limit 0,1 ",$dbi);
     
    542544        echo "<table border=\"2\"><tr><td style=\"text-align:center; \">";
    543545        if(!$votog and $genere!=4){     echo "<h2><b>"._GRUPPO.": </b>";
    544         echo "Scrutinate ".($scruvalidi+$scrunulli)." schede su $totschede ($grpercscru %)  <br></h2>";
     546        echo "</br>Scrutinate ".($scruvalidi+$scrunulli)." schede su $totschede ($grpercscru %)  <br></h2>";
    545547        }
    546548#$numero sezioni su $sezioni<br> le schede scrutinate sono:  $grpercscru %
     
    572574        $go="gruppo";
    573575   if(!$votog and $genere!=4)   echo "<div><h2><b>"._GRUPPO." </b><br /></h2></div>";
     576   if ($tipo_cons==18 or $tipo_cons==19) echo "<div><b>I voti di lista subiranno una integrazione al termine delle operazioni sul collegio con la ripartizione pro-quota derivata dai voti sull'uninominale</b></div>";
    574577/*   
    575578        if ($circo){ // circoscrizione
     
    886889                        $res1 = mysql_query("select *  from ".$prefix."_ele_voti_".$tab." where id_cons='$id_cons' group by id_sez ",$dbi);
    887890                        $numero=mysql_num_rows($res1);
    888                         $res2 = mysql_query("select *  from ".$prefix."_ele_sezioni where id_cons='$id_cons'",$dbi);
    889                         $sezioni=mysql_num_rows($res2);
     891                        $res2 = mysql_query("select max(num_sez)  from ".$prefix."_ele_sezioni where id_cons='$id_cons'",$dbi);
     892                        list($sezioni)=mysql_fetch_row($res2);
    890893                }
    891894 
     
    954957// funzione visualizzazione delle liste per camera e senato con raggruppamenti/coalizioni
    955958function liste(){
    956 global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo;
     959global $id_cons,$id_cons_gen,$prefix,$dbi,$min,$offset,$op,$tipo_cons,$prev,$next,$votog,$votol,$circo,$genere,$id_comune;
    957960//dati();
    958961$offset=10;
Note: See TracChangeset for help on using the changeset viewer.