Changeset 199


Ignore:
Timestamp:
Apr 23, 2014, 12:08:28 AM (11 years ago)
Author:
roby
Message:
  • aggiornamento consiglieri per comuni fino a 10.000 abitanti
  • inserita cancellazione voti di gruppi e liste (a caduta comprende le preferenze) per sezione
Location:
trunk
Files:
1 added
6 edited

Legend:

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

    r192 r199  
    183183                                list($fasciacom)=mysql_fetch_row($rescomu);
    184184                } else $fasciacom=0;
    185                 $rescomu = mysql_query("SELECT id_conf, descrizione from ".$prefix."_ele_conf order by descrizione asc", $dbi);
     185                $rescomu = mysql_query("SELECT id_conf, descrizione from ".$prefix."_ele_conf order by id_conf desc", $dbi);
    186186                echo "<td><select name=\"id_conf\" id=\"id_conf\" onchange=\"javascript:showdate('modules/Elezioni/ele_desc_fasce.php?fascia=$fasciacom&id_conf=' + model.id_conf.options[model.id_conf.selectedIndex].value,'fasceconf');\">";
    187187                echo "<option value=\"0\"> ";
  • trunk/admin/modules/Elezioni/ele_voti.php

    r197 r199  
    4040if (isset($param['prev_sez'])) $prev_sez=intval($param['prev_sez']); else $prev_sez='';
    4141if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='';
     42if (isset($param['update'])) $update=intval($param['update']); else $update='';
    4243include("modules/Elezioni/funzionidata.php");
    4344include("modules/Elezioni/ele.php");
     
    455456                if ($ops == 1) {
    456457                        votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
    457                 }
     458                }else{
     459############# Controllo flag per cancellazione consultazione
     460        echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
     461     ."//-->\n";
     462     echo "function del_dati() {\n";
     463     echo "if (document.getElementById('pwd3').checked==false) {\n";
     464     echo "document.getElementById('update').value=\""._OK."\" \n";
     465     echo "document.getElementById('do').value=\"0\" \n";
     466     echo "}else{\n";
     467     echo "document.getElementById('update').value=\""._DELETE."\" \n";
     468     echo "document.getElementById('do').value=\"1\" \n";
     469     echo "} \n";
     470     echo "} \n";
     471     echo "</script>\n";
     472                }
    458473        /*
    459474                if ($ops == 2) {
     
    597612                ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
    598613                ."<input type=\"hidden\" name=\"tabella\" value=\"$tab\">"
    599                 ."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n";
     614                ."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n"
     615                ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">\n";
    600616                echo "<table class=\"table-menu\" style=\"width: 90%; color: black\">";
    601617                echo "<tr><td bgcolor=\"$bgcolor1\" align=\"left\" width=\"32\">";
     
    696712
    697713        }
    698                 echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" value=\" "._OK. "\"></td>";
    699                 echo "</tr></table></form></tr></table>";
     714                echo "<tr>";
     715                echo "<td></td><td></td>";
     716                echo "<td align=\"center\"><input type=\"submit\" id=\"update\" name=\"update\" value=\""._OK."\"></td>";
     717                echo "</tr></table></form></tr>";
     718                if(chisei()>=64){
     719                        echo "<td></td><td> <input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."</td>";
     720                }
     721                echo "</table>";
    700722                echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
    701723                ."document.sezioni.voti1.focus()\n"
     
    716738
    717739function rec_voti() {
    718         global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite;
     740        global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite,$update;
    719741        $sqlcomu="select id_fascia from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";
    720742        $res = mysql_query($sqlcomu);
     
    735757        $tab = $arg[5];
    736758        $id_lista = intval($arg[6]);
     759        $do= intval($arg[7]);
    737760        if ($tab=="_ele_voti_candidati") {
    738761                $condizione="id_cand";
     
    742765        if ((($genere==3) OR ($genere==5)) and !$id_lista and !$votog and ($fascia>$limite)) $y = (count($arg)-4);
    743766        else $y=count($arg);
    744         for($i=7,$y--;$i< $y;$i++) {
     767        if($do==1) {
     768                        mysql_query("delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     769                        mysql_query("delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     770                        mysql_query("update  ".$prefix."_ele_sezioni set validi_lista='',contestati_lista='',voti_nulli_lista='',solo_gruppo='' where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     771       
     772        }else{
     773        for($i=8,$y--;$i< $y;$i++) {
    745774                $voti = intval($arg[$i++]);
    746775                $id_cand = intval($arg[$i]);
     
    788817           }   
    789818        }
    790 
     819        }
    791820       
    792821//      $ops = $arg[$argc];
     
    11821211        echo "<td></td></tr></table>";
    11831212        if ($validi+$nulli+$bianchi+$contestati+$votinulli>0 or $genere==0) {
    1184     echo "<form name=\"sezioni\" action=\"admin.php\">";
     1213    echo "<table class=\"table-menu\" style=\"width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" action=\"admin.php\">";
    11851214        echo "<input type=\"hidden\" name=\"op\" value=\"rec_voti_gruppi\">"
    11861215    ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
    11871216    ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
    11881217    ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
    1189      ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
    1190         echo "<br><br> <table  class=\"table-menu\" style=\"width: 60%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
     1218    ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
     1219    ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">";
     1220        echo "<br><br> <table  class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
    11911221        ."<td width=\"3%\"><b>"._NUM."</b></td>"
    11921222    ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";
     
    12651295        }
    12661296
    1267    echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" value=\" "._OK. "\"></td>";
    1268 
    1269     echo "</tr></table></form><br><br> ";
     1297   echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" id=\"update\" value=\" "._OK. "\"></td>";
     1298
     1299    echo "</tr></table></form></td></tr>";
     1300                if(chisei()>=64){
     1301                        echo "<tr><td><input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."";
     1302                }
     1303
     1304        echo "</td></tr></table>";
    12701305        }
    12711306    if ($genere!=0){
     
    12951330$id_circ = intval($arg[3]);
    12961331$id_sede = intval($arg[4]);
    1297 $y=count($arg)-1;
     1332$do = intval($arg[5]);
     1333$y=count($arg)-1;
     1334        if($do==1) {
     1335                        mysql_query("delete from ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     1336                        mysql_query("delete from ".$prefix."_ele_voti_lista where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     1337                        mysql_query("delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     1338                        mysql_query("update  ".$prefix."_ele_sezioni set validi_lista='',contestati_lista='',voti_nulli_lista='',solo_gruppo='',solo_lista='' where id_cons='$id_cons' and id_sez='$id_sez'", $dbi);
     1339       
     1340        }else{
     1341
    12981342if ($genere==0) {
    12991343        $tab="_ele_voti_ref";
     
    13061350}
    13071351
    1308 for($i=5;$i< $y;) {
     1352for($i=6;$i< $y;) {
    13091353        $id_gruppo = intval($arg[$i++]);
    13101354        $testval=0;
     
    13671411
    13681412}
     1413}
    13691414//$ops = $arg[$argc];
    13701415if ($fileout) fclose($fp);
  • trunk/admin/versione.php

    r198 r199  
    11<?php
    2 $versione="2.0 rev 198";
     2$versione="2.0 rev 199";
    33?>
  • trunk/client/modules/Elezioni/consiglieri.php

    r198 r199  
    4747$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);
    4848if (mysql_num_rows($res)){
    49 #       list($tipo_cons,$id_cons,$fascia,$conf) = mysql_fetch_row($res);
     49        list($tipo_cons,$id_cons,$fascia,$conf) = mysql_fetch_row($res);
    5050        $result = mysql_query("select capoluogo from ".$prefix."_ele_comuni where id_comune='$id_comune'", $dbi);
    5151        list($capoluogo) = mysql_fetch_row($result);
    52         if($fascia<6 and $capoluogo) {
    53         $resfascia = mysql_query("SELECT fascia_capoluogo from ".$prefix."_ele_conf where id_conf=$id_conf", $dbi);
    54         list ($fascia)= mysql_fetch_row($resfascia);
    55         }
     52        $result = mysql_query("select fascia_capoluogo from ".$prefix."_ele_conf where id_conf='$conf'", $dbi);
     53        list($fascia2) = mysql_fetch_row($result);
     54        if($fascia<$fascia2 and $capoluogo) $fascia=$fascia2;
    5655
    5756                $result = mysql_query("SELECT seggi from ".$prefix."_ele_fasce where id_fascia='$fascia' and id_conf=$id_conf",$dbi);
  • trunk/client/versione.php

    r198 r199  
    11<?php
    2 $versione="2.0 rev 198";
     2$versione="2.0 rev 199";
    33?>
  • trunk/install/sql/eleonline.sql

    r189 r199  
    325325(5, 'Legge Italiana 267/2000 con riduzione 2011', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7),
    326326(6, 'Legge Italiana 267/2000 con riduzione 2012', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 7);
     327(7, 'Legge Italiana 267/2000 con modifiche 2014', 3, '1', 67, 3, 60, 3, '1', '1', 40, 40, '0', '0', '0', '0', '0', 6);
    327328UNLOCK TABLES;
    328329/*!40000 ALTER TABLE `soraldo_ele_conf` ENABLE KEYS */;
     
    434435(8, 1000000, 50, 1),
    435436(9, 100000000, 60, 1),
    436 (1, 3000, 9, 5),
    437 (2, 5000, 9, 5),
    438 (3, 10000, 12, 5),
    439 (4, 15000, 16, 5),
    440 (5, 30000, 16, 5),
    441 (6, 100000, 24, 5),
    442 (7, 250000, 32, 5),
    443 (8, 500000, 36, 5),
    444 (9, 1000000, 40, 5),
    445 (10, 100000000, 48, 5),
    446 (1, 3000, 6, 6),
    447 (2, 5000, 7, 6),
    448 (3, 10000, 10, 6),
    449 (4, 15000, 16, 6),
    450 (5, 30000, 16, 6),
    451 (6, 100000, 24, 6),
    452 (7, 250000, 32, 6),
    453 (8, 500000, 36, 6),
    454 (9, 1000000, 40, 6),
    455 (10, 100000000, 48, 6),
    456437(1, 3000, 12, 2),
    457438(2, 10000, 16, 2),
     
    482463(8, 500000, 36, 4),
    483464(9, 1000000, 40, 4),
    484 (10, 100000000, 48, 4);
     465(10, 100000000, 48, 4),
     466(1, 3000, 9, 5),
     467(2, 5000, 9, 5),
     468(3, 10000, 12, 5),
     469(4, 15000, 16, 5),
     470(5, 30000, 16, 5),
     471(6, 100000, 24, 5),
     472(7, 250000, 32, 5),
     473(8, 500000, 36, 5),
     474(9, 1000000, 40, 5),
     475(10, 100000000, 48, 5),
     476(1, 3000, 6, 6),
     477(2, 5000, 7, 6),
     478(3, 10000, 10, 6),
     479(4, 15000, 16, 6),
     480(5, 30000, 16, 6),
     481(6, 100000, 24, 6),
     482(7, 250000, 32, 6),
     483(8, 500000, 36, 6),
     484(9, 1000000, 40, 6),
     485(10, 100000000, 48, 6),
     486(1, 3000, 10, 7),
     487(2, 10000, 12, 7),
     488(3, 15000, 16, 7),
     489(4, 30000, 16, 7),
     490(5, 100000, 24, 7),
     491(6, 250000, 32, 7),
     492(7, 500000, 36, 7),
     493(8, 1000000, 40, 7),
     494(9, 100000000, 48, 7);
    485495/*!40000 ALTER TABLE `soraldo_ele_fasce` ENABLE KEYS */;
    486496UNLOCK TABLES;
Note: See TracChangeset for help on using the changeset viewer.