Ignore:
Timestamp:
Mar 2, 2014, 4:49:30 PM (10 years ago)
Author:
roby
Message:
  • modificato il db per gestire la modifica di fascia del comune per le elezioni comunali e per la rilevazione delle affluenze con distinzione per maschi e femmine.
File:
1 edited

Legend:

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

    r147 r189  
    4646        $x++;
    4747}
    48 $res = mysql_query("SELECT t1.tipo_cons,t2.id_cons,t1.data_fine FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
     48$res = mysql_query("SELECT t1.tipo_cons,t2.id_cons,t2.id_fascia,t2.id_conf FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'" , $dbi);
    4949if (mysql_num_rows($res)){
    50         list($tipo_cons,$id_cons,$datacons) = mysql_fetch_row($res);
    51         $result = mysql_query("select fascia, capoluogo from ".$prefix."_ele_comuni where id_comune='$id_comune'", $dbi);
    52         list($fascia,$capoluogo) = mysql_fetch_row($result);
    53 
    54                 $result = mysql_query("SELECT seggi from ".$prefix."_ele_fasce where id_fascia='$fascia' and (data_inizio<'$datacons' and data_fine>'$datacons')",$dbi);
    55                 if (mysql_num_rows($result)==0)
    56                         $result = mysql_query("SELECT seggi from ".$prefix."_ele_fasce where id_fascia='$fascia' and data_fine='0000-00-00'",$dbi);
     50        list($tipo_cons,$id_cons,$fascia,$conf) = mysql_fetch_row($res);
     51        $result = mysql_query("select capoluogo from ".$prefix."_ele_comuni where id_comune='$id_comune'", $dbi);
     52        list($capoluogo) = mysql_fetch_row($result);
     53        if($fascia<6 and $capoluogo) {
     54        $resfascia = mysql_query("SELECT fascia_capoluogo from ".$prefix."_ele_conf where id_conf=$conf", $dbi);
     55        list ($fascia)= mysql_fetch_row($resfascia);
     56        }
     57
     58                $result = mysql_query("SELECT seggi from ".$prefix."_ele_fasce where id_fascia='$fascia' and id_conf=$conf",$dbi);
    5759                list($numcons) = mysql_fetch_row($result);
    5860
     
    8183                        $numgruppo=$num_gruppo1;
    8284        }
    83         if($fascia<6 and $capoluogo) $fascia=6;
     85
    8486        if ($fascia<=$limite and $numgruppo) consmin($fascia,$numgruppo);
    8587        elseif ($gruppo>0) conssup($fascia,$gruppo,$collegate,$collperd,$primoturno);
Note: See TracChangeset for help on using the changeset viewer.