source: trunk/client/modules/Elezioni/blocchi/04_sezioni.php@ 241

Last change on this file since 241 was 241, checked in by luc, 9 years ago

Aggiunta del widget Privacy e CookieLaw per l'informativa sui cookie - Aggiunto Tema Realistic - Aggiunto Tema Spectral

File size: 3.3 KB
Line 
1<?php
2/************************************************************************/
3/* Eleonline - Raccolta e diffusione dei dati elettorali */
4/* by Luciano Apolito & Roberto Gigli */
5/* http://www.eleonline.it */
6/* info@eleonline.it luciano@aniene.net rgigli@libero.it */
7/************************************************************************/
8
9if (!defined('MODULE_FILE')) {
10 die ("You can't access this file dirrectly...");
11}
12global $prefix, $dbi,$id_cons_gen;
13$sql = mysql_query("select chiusa from ".$prefix."_ele_cons_comune where id_cons_gen='$id_cons_gen'",$dbi);
14 list($chiusa) = mysql_fetch_row($sql);
15
16 //if($chiusa!='1') numeri_sezione(); # se la consultazione non Ú chiusa
17
18
19
20numeri_sezione(); //lancia la funzione
21
22function numeri_sezione() {
23global $prefix, $dbi, $circo, $genere,$id_cons_gen,$id_cons,$id_circ,$tipo_cons,$votog,$id_comune;
24
25
26if (isset($circo) and $circo) $circos="and t2.id_circ='$id_circ'";
27else $circos='';
28
29 if ($genere==0) $tab="ref";elseif($genere=='4' || $votog) $tab="lista";
30 else $tab="gruppo";
31
32
33
34 # numero sezioni
35 $res = mysql_query("select t1.id_sez,t1.num_sez from ".$prefix."_ele_sezioni as t1 left join ".$prefix."_ele_sede as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' $circos order by t1.num_sez",$dbi);
36 $max = mysql_num_rows($res);
37 if(!isset($html)) $html='';
38 $html = "\n<table style=\"margin:0px auto;border:0px; width:90%\"><tr>";
39
40 $i=0;$id_circ_old=0;$e=0;
41 while(list($sez_id, $sez_num) = mysql_fetch_row($res)) {
42 $i++;
43 /****************************************************************/
44 /* suddivisione in circoscrizione - attivare se Ú il caso
45
46 $result = mysql_query("SELECT id_circ FROM ".$prefix."_ele_sede where id_cons='$id_cons' and id_sede='$sede_id' ", $dbi);
47 list($circ_id) = mysql_fetch_row($result);
48 if($circ_id!=$id_circ_old){
49 $id_circ_old=$circ_id;
50 $result2 = mysql_query("SELECT descrizione FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' and id_circ='$circ_id' ", $dbi);
51 list($descrizione) = mysql_fetch_row($result2);
52 echo "</tr></table><table><tr><td>$descrizione</td></tr></table>";
53 echo "\n<table align=\"left\" border=\"0\" width=\"90%\"><tr bgcolor=\"$bgcolor1\">";
54 }
55 */
56
57 #colora la sezione
58 # verifica se la sezione Ú scrutinata
59 $res2 = mysql_query("select * from ".$prefix."_ele_voti_".$tab." where id_sez='$sez_id'",$dbi);
60 $numero=mysql_num_rows($res2);
61 if ($numero!=0){$e++;$bgsez="#FFFF00";}else{$bgsez="";}
62
63
64 if ($genere==0) $pos="gruppo_sezione";elseif($genere=='4' || $votog) $pos="lista_sezione";
65 else $pos="gruppo_sezione";
66
67 $html .="<td style=\"margin:0px auto; text-align:center; width:5%;\" bgcolor=\"$bgsez\"><a href=\"modules.php?id_cons_gen=$id_cons_gen&name=Elezioni&id_comune=$id_comune&perc=true&file=index&op=$pos&minsez=$sez_num&offsetsez=$sez_num\"><b>$sez_num</b></a></td>";
68
69 if (($i%5) ==0) $html .="</tr>\n<tr>";
70 }
71
72 $html .="</tr></table>\n";
73 // stampa
74 if($e!='0'){
75 echo "<div><h5>"._SEZSCRU."</h5></div>";
76 echo "<center> <img alt=\"Grafico\" src=\"modules/Elezioni/grafici/ledex2.php?sez=$e&max=$max\" /></center>";
77
78 echo $html; }
79}
80
81
82?>
Note: See TracBrowser for help on using the repository browser.