- Timestamp:
- May 31, 2015, 1:59:14 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin
-
Property svn:ignore
set to
config.php
-
Property svn:ignore
set to
-
trunk/admin/modules/Elezioni/ele_associazioni.php
r226 r235 45 45 if (isset($_GET['preferenze'])) $preferenze=intval($_GET['preferenze']); else $preferenze=1; 46 46 if (isset($_GET['vismf'])) $vismf=intval($_GET['vismf']); else $vismf=0; 47 if (isset($_GET['sg'])) $sg=intval($_GET['sg']); else $sg=0; 47 48 48 49 $offset=15; … … 55 56 // 56 57 function all() { 57 global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf ;58 global $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help,$preferenze,$idfascia,$vismf,$sg; 58 59 $aid=$_SESSION['aid']; 59 60 $dbi=$_SESSION['dbi']; … … 131 132 } 132 133 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; 134 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._ASOLO_GRUPPO."</b></td>"; 133 135 # echo "<input type=\"hidden\" name=\"pag_cons\" value=\"admin.php?op=associazioni&id_cons_gen=\">"; 134 136 echo "</tr>"; … … 209 211 } 210 212 unset($sel); 211 $rescomu = mysql_query("SELECT vismf from ".$prefix."_ele_cons_comune where id_cons='$id_cons'", $dbi);212 list($vismf )=mysql_fetch_row($rescomu);213 $rescomu = mysql_query("SELECT vismf,solo_gruppo from ".$prefix."_ele_cons_comune where id_cons='$id_cons'", $dbi); 214 list($vismf,$sg)=mysql_fetch_row($rescomu); 213 215 echo "<td><select name=\"vismf\">"; 214 216 if ($vismf==0) $sel="selected"; else $sel=""; 215 217 echo "<option value=\"0\" $sel>No"; 216 218 if ($vismf==1) $sel="selected"; else $sel=""; 219 echo "<option value=\"1\" $sel>Si"; 220 echo "</select></td>"; 221 echo "<td><select name=\"sg\">"; 222 if ($sg==0) $sel="selected"; else $sel=""; 223 echo "<option value=\"0\" $sel>No"; 224 if ($sg==1) $sel="selected"; else $sel=""; 217 225 echo "<option value=\"1\" $sel>Si"; 218 226 echo "</select></td>"; … … 245 253 } 246 254 echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VISAFFMF."</b></td>"; 255 # echo "<td width=\"10%\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SG."</b></td>"; 247 256 echo "<td width=\"10\" bgcolor=\"$bgcolor1\"><b> "._FUNZIONI."</td></tr>"; 248 257 ############### … … 251 260 # $resmod = mysql_query("SELECT t1.id_collegio,t1.id_comune,t2.descrizione as descr,t1.id_cons, t3.descrizione, t4.chiusa,t4.id_conf FROM ".$prefix."_ele_comu_collegi as t1, ".$prefix."_ele_collegi as t2, ".$prefix."_ele_comuni as t3, ".$prefix."_ele_cons_comune as t4 where t1.id_cons_gen='$id_cons_gen' and t1.id_collegio=t2.id_collegio and t1.id_comune=t3.id_comune and t1.id_comune=t4.id_comune and t2.id_cons_gen=t4.id_cons_gen order by t2.descrizione, t3.descrizione", $dbi); 252 261 # else 253 $resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione", $dbi);262 $resmod = mysql_query("SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf, preferenze,t1.id_fascia,t1.vismf,t1.solo_gruppo FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione", $dbi); 254 263 while (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf,$preferenze2,$fasciacom,$vismf) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti 255 264 $resconf = mysql_query("SELECT descrizione FROM ".$prefix."_ele_conf where id_conf='$id_conf'", $dbi); … … 290 299 if ($vismf==0) $sel=_NO; else $sel=_SI; 291 300 echo "<td width=\"10%\">$sel</td>"; 301 # if ($sg==0) $sel=_NO; else $sel=_SI; 302 # echo "<td width=\"10%\">$sel</td>"; 292 303 echo "<td width=\"10\"><input type=\"hidden\" name=\"ok\" value=0><input type=\"submit\" name=\"edit$i\" value=\""._EDIT."\">" 293 304 ."</td></tr></table></form></td></tr>\n"; … … 300 311 301 312 function associazioni($ok, $do,$descr_comu,$id_cons_comu,$id_collegio,$id_comune,$chiusa,$id_conf,$preferenze) { 302 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf ;313 global $admin, $bgcolor1, $bgcolor2, $prefix, $dbi, $descr_cons,$genere,$id_cons_gen,$idcomunenew,$pwd4,$idfascia,$vismf,$sg; 303 314 $delcons=0; 304 315 if ($do !="" and $id_cons_gen>0 and $idcomunenew>0) { … … 307 318 list($delcons)=mysql_fetch_row($rescomu); 308 319 if (!$max){ //se no la inserisce 309 $result = mysql_query("insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf ) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error());320 $result = mysql_query("insert into ".$prefix."_ele_cons_comune (chiusa,id_comune,id_cons_gen,id_conf,preferenze,id_fascia,vismf,solo_gruppo) values ('0','$idcomunenew','$id_cons_gen','$id_conf','$preferenze','$idfascia','$vismf','$sg')", $dbi) || die("<br><br>Errore di inserimento: ".mysql_error()); 310 321 $rescomu = mysql_query("SELECT id_cons from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen' and id_comune='$idcomunenew'", $dbi); 311 322 list($id_cons_comu)=mysql_fetch_row($rescomu); … … 321 332 $result = mysql_query("update ".$prefix."_ele_comu_collegi set id_collegio= '$id_collegio' $newid where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi) || die(mysql_error()); 322 333 if (!$result) return; 323 $result = mysql_query("update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi)|| die(mysql_error());334 $result = mysql_query("update ".$prefix."_ele_cons_comune set id_conf='$id_conf', chiusa= '$chiusa', preferenze='$preferenze',id_fascia='$idfascia',vismf='$vismf',solo_gruppo='$sg' where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'", $dbi)|| die(mysql_error()); 324 335 Header("Location: admin.php?op=associazioni&id_cons_gen=$id_cons_gen"); 325 336 }elseif ($do == "add") { -
trunk/admin/modules/Elezioni/ele_riepilogo.php
r208 r235 58 58 ECHO "<TR><TH>".number_format($totel,0,',','.')."</TH><TH>".number_format($totm,0,',','.')."</TH><TH>".number_format($totf,0,',','.')."</TH><TH>".number_format($votm,0,',','.')."</TH><TH>".number_format($votf,0,',','.')."</TH><TH>".number_format($votc,0,',','.')."</TH></TR></table><br/>"; 59 59 ECHO "</fieldset><br/><br/><br/>"; 60 61 60 62 $totnulli=$nulli+$bianchi+$contestati+$votinulli; 61 63 if ($votog) echo "<fieldset><legend>"._VOTI_LISTA."</legend>"; … … 64 66 ECHO "<TR><TH>".number_format($validi,0,',','.')."</TH><TH>".number_format($nulli,0,',','.')."</TH><TH>".number_format($bianchi,0,',','.')."</TH><TH>".number_format($contestati,0,',','.')."</TH><TH>".number_format($votinulli,0,',','.')."</TH><TH>".number_format($totnulli,0,',','.')."</TH></TR></table><br/>"; 65 67 ECHO "</fieldset><br/><br/><br/>"; 68 69 66 70 if ($genere==5 and !$votog) { 67 71 $totnullil=$nullilista+$contestatilista; 68 72 $id_conf=0; 69 $res = mysql_query("SELECT t1.id_conf,t1.id_fascia, t2.limite from ".$prefix."_ele_cons_comune as t1 left join ".$prefix."_ele_conf as t2 on t1.id_conf=t2.id_conf where t1.id_cons='$id_cons'", $dbi);70 if($res) list($id_conf,$fascia,$limite ) = mysql_fetch_row($res);73 $res = mysql_query("SELECT t1.id_conf,t1.id_fascia, t2.limite, t1.solo_gruppo from ".$prefix."_ele_cons_comune as t1 left join ".$prefix."_ele_conf as t2 on t1.id_conf=t2.id_conf where t1.id_cons='$id_cons'", $dbi); 74 if($res) list($id_conf,$fascia,$limite,$dettnulli) = mysql_fetch_row($res); 71 75 if ($id_conf and $fascia<=$limite) { 72 76 echo "<fieldset><legend>"._VOTI_LISTA."</legend>"; … … 74 78 ECHO "<TR><TH>".number_format($validi,0,',','.')."</TH><TH>".number_format($nulli,0,',','.')."</TH><TH>".number_format($bianchi,0,',','.')."</TH><TH>".number_format($contestati,0,',','.')."</TH><TH>".number_format($votinulli,0,',','.')."</TH><TH>".number_format($totnulli,0,',','.')."</TH></TR></table><br/>"; 75 79 ECHO "</fieldset><br/><br/><br/>"; 80 76 81 }else{ 77 echo "<fieldset><legend>"._VOTI_LISTA."</legend>"; 82 if ($dettnulli){ 83 $res = mysql_query("SELECT id_gruppo,num_gruppo,descrizione from ".$prefix."_ele_gruppo where id_cons='$id_cons' order by num_gruppo", $dbi); 84 85 echo "<fieldset><legend>"._GRUPPO."</legend>"; 86 echo "<table border=\"1\" width=\"100%\"><tr><th colspan=\"2\" rowspan=\"2\" ALIGN=\"CENTER\"><b>Candidato</b></th><th rowspan=\"2\" ALIGN=\"CENTER\">"._VALIDI."</th><th colspan=\"2\" ALIGN=\"CENTER\">"._SOLO_GRUPPO."</th></tr><tr><th ALIGN=\"CENTER\">Senza indicazione di lista</th><th>"._VOTINULLI." di Lista</th></TR>"; 87 while(list($id_gruppo,$num_gruppo,$desc) = mysql_fetch_row($res)){ 88 $resv = mysql_query("SELECT sum(voti),sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_gruppo='$id_gruppo'", $dbi); 89 list($voti,$solo_gruppo)=mysql_fetch_row($resv); 90 $resv = mysql_query("SELECT sum(t1.nulli_lista) from ".$prefix."_ele_voti_lista as t1 left join ".$prefix."_ele_lista as t2 on t1.id_lista=t2.id_lista where t2.id_gruppo='$id_gruppo'", $dbi); 91 list($nulli_lista)=mysql_fetch_row($resv); 92 93 ECHO "<TR><TD>".$num_gruppo."</TD><TD>".$desc."</TD><TD ALIGN=\"RIGHT\">".number_format($voti,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($solo_gruppo,0,',','.')."</TD><TD ALIGN=\"RIGHT\">".number_format($nulli_lista,0,',','.')."</TD></TD></TR>"; 94 } 95 ECHO "</table><br/></fieldset><br/><br/><br/>"; 96 97 } 98 echo "<fieldset><legend>"._VOTI_LISTA."</legend>"; 78 99 echo "<table border=\"1\" width=\"100%\"><tr><th>"._VALIDI."</th><th>"._VOTINULLI."</th><th>"._CONTESTATI."</th>"; 79 100 // if ($genere==5 and !$votog) -
trunk/admin/modules/Elezioni/ele_voti.php
r227 r235 43 43 include("modules/Elezioni/funzionidata.php"); 44 44 include("modules/Elezioni/ele.php"); 45 global $votolista, $limite ;45 global $votolista, $limite, $dettnulli; 46 46 if(!isset($votolista)) $votolista=0; 47 47 $res = mysql_query("SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'" , $dbi); … … 50 50 $res = mysql_query("SELECT count(id_circ) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ", $dbi); 51 51 list($num_circ)=mysql_fetch_row($res); 52 $res = mysql_query("SELECT solo_gruppo FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' ", $dbi); 53 list($dettnulli)=mysql_fetch_row($res); 52 54 if ($conscirc){ // or $num_circ==1 53 55 if (!$id_circ){ … … 533 535 function preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){ 534 536 global $aid, $prefix, $dbi, $id_lista,$genere,$id_cons_gen,$id_gruppo,$sezi,$circo,$votog,$votol,$votoc,$conscirc; 535 global $tipo_cons,$limite; 537 global $tipo_cons,$limite,$dettnulli; 538 536 539 $bgcolor1="#7777ff"; 537 540 $bgcolor2=$_SESSION['bgcolor2']; … … 578 581 $result = mysql_query("SELECT count(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); 579 582 list($ctrvoticand)=mysql_fetch_row($result); 580 $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);583 $result = mysql_query("SELECT sum(t1.voti),0,0 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); 581 584 list($votisezcand)=mysql_fetch_row($result); 582 585 if(($fascia>$limite or !$id_conf) or $genere==4) 583 $result = mysql_query("SELECT sum(voti)from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_rif'", $dbi);586 $result = mysql_query("SELECT voti,nulli_lista from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_rif'", $dbi); 584 587 else{ 585 588 586 589 $result = mysql_query("SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_rif'", $dbi); 587 590 list($id_gruppo)=mysql_fetch_row($result); 588 $result = mysql_query("SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'", $dbi);591 $result = mysql_query("SELECT sum(voti),0,0 from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'", $dbi); 589 592 } 590 list($votisezlis )=mysql_fetch_row($result);593 list($votisezlis,$sgpl,$vnpl)=mysql_fetch_row($result); 591 594 if($votisezcand>($votisezlis*$numprefs)) 592 595 {$segna="style=\"background-color: #dd0000;\"";} … … 611 614 if ((!$id_lista)){$tab="_ele_voti_lista";} else {$tab="_ele_voti_candidati";} 612 615 if(($genere==4 or ($genere==5 and $votog)) and !$id_lista) 613 $result = mysql_query("SELECT sum(t1.voti),t2.validi, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli,t2.bianchi,t2.nulli,0,0 from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez=$id_sez group by t1.id_sez",$dbi);616 $result = mysql_query("SELECT sum(t1.voti),t2.validi, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli,t2.bianchi,t2.nulli,0,0,0,0 from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez=$id_sez group by t1.id_sez",$dbi); 614 617 else 615 $result = mysql_query("SELECT sum(t1.voti),t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez='$id_sez' group by t1.id_sez",$dbi); 616 list( $voti_sez, $validi2, $sg,$cont2,$vnulli2,$bia2,$nul2,$con2,$vnul2) = mysql_fetch_row($result); 618 if($tab=="_ele_voti_lista") 619 $result = mysql_query("SELECT sum(t1.voti),t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli,0,t1.nulli_lista from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez='$id_sez' group by t1.id_sez",$dbi); 620 else 621 $result = mysql_query("SELECT sum(t1.voti),t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli,0,0 from ".$prefix."_ele_sezioni as t2 left join ".$prefix.$tab." as t1 on (t1.id_sez=t2.id_sez) where t2.id_sez='$id_sez' group by t1.id_sez",$dbi); 622 623 // aggiunte le variabili $sgpl e $vnpl per la gestione dei voti 1) al solo presidente per singola lista - 2) al solo presidente per singola lista perché nullo o contestato quello di lista 624 list( $voti_sez, $validi2, $sg,$cont2,$vnulli2,$bia2,$nul2,$con2,$vnul2,$sgpl,$vnpl) = mysql_fetch_row($result); 617 625 $valista=$validi2; 618 626 if(!$id_lista or $genere==3){ //controllo di congruenza … … 666 674 echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>" 667 675 ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>"; 676 if($dettnulli){ 677 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>"; 678 } 668 679 } 669 680 echo "</tr>\n"; … … 703 714 } 704 715 }else { 705 $result1 = mysql_query("select t2.voti,t1.id_lista, descrizione,simbolo,num_lista 716 $result1 = mysql_query("select t2.voti,t1.id_lista, descrizione,simbolo,num_lista,t2.nulli_lista 706 717 from ".$prefix."_ele_lista as t1, ".$prefix."_ele_voti_lista as t2 707 718 where t1.id_cons='$id_cons' … … 715 726 order by t1.num_lista", $dbi); 716 727 } 717 while (list($pro['voti'],$id_lista3,$descr_lista,$simb_lista,$num_lista )=mysql_fetch_row($result1)){728 while (list($pro['voti'],$id_lista3,$descr_lista,$simb_lista,$num_lista,$vnpl)=mysql_fetch_row($result1)){ 718 729 echo "<tr bgcolor=\"$bgcolor2\">"; 719 730 // if ($genere<4 or $votoc){ … … 724 735 $cond_sele="and id_lista=$id_lista3"; 725 736 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\">"; 726 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td></tr>\n"; 737 738 if($dettnulli) echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\"><input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>"; 739 else echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>"; 740 // echo "<td align=\"right\">$sgpl"; 741 echo "</tr>\n"; 727 742 $i++; 728 743 $tot_pref+=$pro['voti']; … … 780 795 781 796 function rec_voti() { 782 global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite,$update; 797 global $prefix, $dbi,$aid,$id_cons,$ops,$genere,$votog,$fileout,$id_comune,$limite,$update,$dettnulli; 798 783 799 $sqlcomu="select id_fascia,id_conf from ".$prefix."_ele_cons_comune where id_cons='$id_cons'"; 784 800 $res = mysql_query($sqlcomu); … … 815 831 816 832 }else{ 817 for($i=8,$y--;$i< $y;$i++) { 833 for($i=8,$y--;$i< $y;$i++) { 818 834 $voti = intval($arg[$i++]); 819 $id_cand = intval($arg[$i]); 835 if($dettnulli) {$vnpl = intval($arg[$i++]); $vnriga=",nulli_lista='$vnpl'"; $vnrigains=",'".$vnpl."'";} else {$vnriga=''; $vnrigains=",''";} 836 $id_cand = intval($arg[$i]); 820 837 $result = mysql_query("select * from ".$prefix."$tab where id_cons='$id_cons' and id_sez='$id_sez' and $condizione='$id_cand'", $dbi); 821 $ar=mysql_fetch_array($result); 838 $ar=mysql_fetch_array($result); 839 822 840 if ($ar){ 823 if ($ar['voti']!=$voti ) {824 mysql_query("update ".$prefix."$tab set voti='$voti' where id_cons='$id_cons' and id_sez='$id_sez' and $condizione='$id_cand'", $dbi);841 if ($ar['voti']!=$voti or (isset($vnpl) and $ar['nulli_lista']!=$vnpl)) { 842 mysql_query("update ".$prefix."$tab set voti='$voti'$vnriga where id_cons='$id_cons' and id_sez='$id_sez' and $condizione='$id_cand'", $dbi); 825 843 if ($fileout) fwrite($fp,"update ".$prefix."$tab set voti='$voti' where id_cons='$id_cons' and id_sez='$id_sez' and $condizione='$id_cand';\n"); 826 844 mysql_query("insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$log_data','$orario','voti=".$ar['voti']."','$condizione:$id_cand voti: $voti','$tab')", $dbi); 827 845 } 828 } else { 846 } else {//die ("insert into ".$prefix."$tab values ('$id_cons', '$id_cand','$id_sez','$voti'$vnrigains)"); 829 847 if ($voti) 830 mysql_query("insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$log_data','$orario',' ','$condizione:$id_cand voti: $voti','$tab')", $dbi); 831 mysql_query("insert into ".$prefix."$tab values ('$id_cons', '$id_cand','$id_sez','$voti' )", $dbi);848 mysql_query("insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$log_data','$orario',' ','$condizione:$id_cand voti: $voti','$tab')", $dbi); 849 mysql_query("insert into ".$prefix."$tab values ('$id_cons', '$id_cand','$id_sez','$voti'$vnrigains)", $dbi); 832 850 if ($fileout) fwrite($fp,"insert into ".$prefix."$tab values ('$id_cons', '$id_cand','$id_sez','$voti');\n"); 833 851 } … … 1194 1212 1195 1213 function preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){ 1196 global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo ;1214 global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli; 1197 1215 //////////////////////////////////////////// 1198 1216 // da qua va la sezione per le preferenze ai gruppi 1199 1217 /////////////////////////////////////////// 1200 1218 // Controllo immmissioni 1219 1201 1220 $bgcolor1="#7777ff"; 1202 1221 $bgcolor2=$_SESSION['bgcolor2']; … … 1277 1296 }else{ 1278 1297 echo "<td width=\"5%\"><b>"._VOTI."</b></td>"; 1298 if($dettnulli) echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLO_GRUPPO."</b></td>"; 1279 1299 } 1280 1300 echo "</tr>"; … … 1326 1346 $pro= mysql_fetch_array($res, 3); 1327 1347 echo "</td><td align=\"right\"><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\"></td>"; 1348 if($dettnulli) echo "</td><td align=\"right\"><input name=\"solog$i\" value=\"".$pro['solo_gruppo']."\" size=\"7\" style=\"text-align:right\"></td>"; 1328 1349 $tot_pref += $pro['voti']; 1329 1350 } … … 1367 1388 global $prefix, $dbi,$aid, $tipo_cons, $genere,$id_cons,$ops,$fileout; 1368 1389 if ($fileout) while (!$fp = fopen($fileout,"a")); 1390 1391 $detnulli=1; 1369 1392 $username="$aid"; 1370 1393 $log_data= date("Y/m/d"); … … 1416 1439 $voti = "'$si','$no','$val','$nul','$bia','$con'"; 1417 1440 $riga="si=$si,no=$no,validi=$val,nulli=$nul,bianchi=$bia,contestati=$con"; 1441 $sgriga=''; 1418 1442 } 1419 1443 break; 1420 1444 default: 1421 1445 $voti = intval($arg[$i++]); 1446 if($detnulli) { $sg=intval($arg[$i++]); $sgriga = ', solo_gruppo='.$sg;} else {$sgriga=''; $sg=0;} 1422 1447 if (!$voti) {$voti="0";} 1423 $riga="voti=$voti"; 1448 $riga="voti=$voti".$sgriga; 1449 $sgriga=",'$sg'"; 1424 1450 break; 1425 1451 } … … 1439 1465 break; 1440 1466 default: 1441 if ($ar['voti']!=$voti ) {1467 if ($ar['voti']!=$voti or $ar['solo_gruppo']!=$sg) { 1442 1468 $oldval="voti:".$ar['voti']; 1443 1469 $voti.=",null"; … … 1445 1471 if (isset($ar['num_gruppo'])) $dstgruppo=$ar['num_gruppo']; 1446 1472 break; 1447 } 1448 if ($oldval) { 1473 } 1474 if ($oldval) { 1449 1475 mysql_query("update ".$prefix."$tab set $riga where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo'", $dbi); 1450 1476 if ($fileout) fwrite($fp,"update ".$prefix."$tab set $riga where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo';\n"); … … 1453 1479 } else { #die ("test in corso: insert into ".$prefix."$tab values ('$id_cons', '$id_gruppo','$id_sez',$voti)"); 1454 1480 mysql_query("insert into ".$prefix."_ele_log values('$id_cons','$id_sez','$username','$log_data','".$log_ora['hours'].":".$log_ora['minutes'].":".$log_ora['seconds']."','','num_gruppo:$num_gruppo $riga','$tab')", $dbi); 1455 mysql_query("insert into ".$prefix."$tab values ('$id_cons', '$id_gruppo','$id_sez',$voti )", $dbi);1456 if ($fileout) fwrite($fp,"insert into ".$prefix."$tab values ('$id_cons', '$id_gruppo','$id_sez',$voti );\n");1481 mysql_query("insert into ".$prefix."$tab values ('$id_cons', '$id_gruppo','$id_sez',$voti $sgriga)", $dbi); 1482 if ($fileout) fwrite($fp,"insert into ".$prefix."$tab values ('$id_cons', '$id_gruppo','$id_sez',$voti $sgriga);\n"); 1457 1483 // 1458 1484 } -
trunk/install/sql/eleonline.sql
r227 r235 359 359 `id_fascia` INT( 2 ) NOT NULL DEFAULT '1', 360 360 `vismf` ENUM( '0', '1' ) NOT NULL DEFAULT '0', 361 `solo_gruppo` enum('0', '1') NOT NULL default '0', 361 362 PRIMARY KEY (`id_cons`), 362 363 UNIQUE KEY `comune` (`id_comune`,`id_cons_gen`) … … 938 939 `id_sez` int(11) NOT NULL default '0', 939 940 `voti` int(7) NOT NULL default '0', 941 `solo_gruppo` INT( 7 ) NOT NULL DEFAULT '0', 940 942 KEY `id_cons` (`id_cons`), 941 943 KEY `id_gruppo` (`id_gruppo`), … … 963 965 `id_sez` int(11) NOT NULL default '0', 964 966 `voti` int(7) NOT NULL default '0', 967 `nulli_lista` INT( 7 ) NOT NULL DEFAULT '0', 965 968 KEY `cons` (`id_cons`), 966 969 KEY `id_lista` (`id_lista`),
Note:
See TracChangeset
for help on using the changeset viewer.