Changeset 165


Ignore:
Timestamp:
Feb 11, 2013, 10:17:15 AM (11 years ago)
Author:
roby
Message:

sistemato controllo di congruità per comuni fino a 15.000 abitanti

File:
1 edited

Legend:

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

    r164 r165  
    523523                        $result = mysql_query("SELECT sum(t1.voti) from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on (t1.id_cand=t2.id_cand) where t1.id_sez=$id_sez and t2.id_lista=$id_rif",$dbi);
    524524                        list($votisezcand)=mysql_fetch_row($result);
    525                         $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_rif'", $dbi);
     525                        if($fascia>$limite)
     526                                $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_lista'", $dbi);
     527                        else{
     528
     529                                $result = mysql_query("SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_rif'", $dbi);
     530                                list($id_gruppo)=mysql_fetch_row($result);
     531                                $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'", $dbi);
     532                        }
    526533                        list($votisezlis)=mysql_fetch_row($result);
    527534                        if($votisezcand>$votisezlis)
     
    565572                        $result = mysql_query("SELECT sum(t1.voti) from ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on (t1.id_cand=t2.id_cand) where t1.id_sez=$id_sez and t2.id_lista=$id_lista",$dbi);
    566573                        list($votisezcand)=mysql_fetch_row($result);
    567                         $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_lista'", $dbi);
     574                        if($fascia>$limite)
     575                                $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_lista'", $dbi);
     576                        else{
     577
     578                                $result = mysql_query("SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_lista'", $dbi);
     579                                list($id_gruppo)=mysql_fetch_row($result);
     580                                $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'", $dbi);
     581                        }
    568582                        list($votisezlis)=mysql_fetch_row($result);
    569583                        if($votisezcand>$votisezlis)
Note: See TracChangeset for help on using the changeset viewer.