Ignore:
Timestamp:
Apr 4, 2019, 11:16:00 PM (5 years ago)
Author:
roby
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/modules/Elezioni/controllo_voti.php

    r256 r258  
    1616
    1717$aid=$_SESSION['aid'];
    18 $dbi=$_SESSION['dbi'];
     18global $dbi;
    1919$prefix=$_SESSION['prefix'];
    2020$currentlang=$_SESSION['lang'];
     
    2929        $sth = $dbi->prepare("$sql");
    3030        $sth->execute();       
    31         $row = $sth->fetch(PDO::FETCH_BOTH);
    32         list($tipo_cons,$id_cons,$dettnulli,$disgiunto) = explode($row);
     31        list($tipo_cons,$id_cons,$dettnulli,$disgiunto) = $sth->fetch(PDO::FETCH_BOTH);
    3332        $sql="SELECT genere,voto_g,voto_l FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons'";
    3433        $sth = $dbi->prepare("$sql");
    3534        $sth->execute();       
    36         $row = $sth->fetch(PDO::FETCH_BOTH);
    37         list($genere,$votog,$votol) = explode($row);
     35        $row =
     36        list($genere,$votog,$votol) = $sth->fetch(PDO::FETCH_NUM);
    3837include("modules/Elezioni/funzionidata.php");
    3938include("modules/Elezioni/ele.php");
     
    5251        $sth = $dbi->prepare("$sql");
    5352        $sth->execute();       
    54         $row = $sth->fetch(PDO::FETCH_BOTH);
    55         list($totm,$totf) =  explode($row);
     53#       $row = $sth->fetch(PDO::FETCH_BOTH);
     54        list($totm,$totf) =  $sth->fetch(PDO::FETCH_NUM);
    5655        $totel=$totm+$totf;
    5756        if (!IsSet($pag)) {$pag=0;} //inizializza il numero di pagina
     
    6160                $sth = $dbi->prepare("$sql");
    6261                $sth->execute();       
    63                 $row = $sth->fetch(PDO::FETCH_BOTH);
    6462                $num_refs= $sth->rowCount(); //quante pagine?
     63#               $row = $sth->fetch(PDO::FETCH_BOTH);
    6564        }
    6665        if((($genere!=4) and $pag==0 and !$votog) or $genere==1 or $genere==2){ //diverso da liste a piu' candidati
     
    7372                $sth = $dbi->prepare("$sql");
    7473                $sth->execute();       
    75                 $row = $sth->fetch(PDO::FETCH_BOTH);
    76                 list($idg,$numg) = explode($row);
     74#               $row = $sth->fetch(PDO::FETCH_BOTH);
     75                list($idg,$numg) = $sth->fetch(PDO::FETCH_BOTH);
    7776                $sql="SELECT id_sez,num_sez,t1.id_sede as id_sede,t2.id_circ as id_circ FROM ".$prefix."_ele_sezioni as t1,".$prefix."_ele_sede as t2 where t1.id_cons='$id_cons' and t1.id_sede=t2.id_sede order by num_sez";
    7877                $sth = $dbi->prepare("$sql");
    7978                $sth->execute();
    8079                $num_sez = $sth->rowCount();  //quante sezioni?
     80                $sezione=array();
    8181for ($i=1;$i<=$num_sez;$i++){
    82                 $sezione[$i]== $sth->fetch(PDO::FETCH_BOTH); //inizializza l'array delle sezioni
     82                $sezione[$i]=array();
     83                $sezione[$i]= $sth->fetch(PDO::FETCH_BOTH); //inizializza l'array delle sezioni
    8384                $ar[$i]=0;
    8485        }
     
    127128//      if ($genere>1 and $pag==1) $ops=3;
    128129        $tot_u=0;$tot_d=0;$tot_voti=0; $tot_si=0;$tot_no=0;$tot_validi=0;$tot_nulli=0;$tot_bianchi=0;$tot_contestati=0;$tgrup_pref=0;$tot_voti_nulli=0;$tot_val_lista=0;$tot_vot_nul_lis=0;$tot_cont_lis=0;$tot_solog=0;$tot_solol=0;$errors=0;
    129         while ( $row = $sth->fetch(PDO::FETCH_BOTH)){
     130        while ( list($id_gruppo,$id,$num,$si,$no,$validi,$nulli,$bianchi,$contestati,$id_circ,$id_sede,$gruppo,$voti_nulli,$val_lista,$vot_nul_lis,$cont_lis,$solog,$solol) = $sth->fetch(PDO::FETCH_NUM)){
    130131//controllare
    131         list($id_gruppo,$id,$num,$si,$no,$validi,$nulli,$bianchi,$contestati,$id_circ,$id_sede,$gruppo,$voti_nulli,$val_lista,$vot_nul_lis,$cont_lis,$solog,$solol) = explode($row);
    132132        // inserimento numeri di sez non scrutinate
    133133                while ($scrutinate < $num) {
     
    141141                        $sth2 = $dbi->prepare("$sql");
    142142                        $sth2->execute();       
    143                         $row2 = $sth2->fetch(PDO::FETCH_BOTH);
    144                         list ($gruppref) = explode($row2);
     143                        list ($gruppref) = $sth2->fetch(PDO::FETCH_NUM);
    145144                        $tgrup_pref += $gruppref;
    146145                }
     
    149148                        $sth2 = $dbi->prepare("$tab2");
    150149                        $sth2->execute();       
    151                         $row2 = $sth2->fetch(PDO::FETCH_BOTH);
    152                         list($votid,$votiu,$voti) = explode($row2);
     150                        list($votid,$votiu,$voti) = $sth2->fetch(PDO::FETCH_NUM);
    153151//              $voti=$votiu+$votid;
    154152               
     
    185183                        $sth2 = $dbi->prepare("select stato_lis from ".$prefix."_ele_controllosez where id_cons='$id_cons' and id_sez='$id'");
    186184                        $sth2->execute();       
    187                         $row2 = $sth2->fetch(PDO::FETCH_BOTH);
    188                         list($crlis) = explode($row2);
     185                        list($crlis) = $sth2->fetch(PDO::FETCH_NUM);
    189186
    190187                if ($voti==$controllo1 and $validi==$controllo2 and !$g_err and $crlis!=-1){
Note: See TracChangeset for help on using the changeset viewer.