source: trunk/client/temi/Futura2/index.php@ 251

Last change on this file since 251 was 251, checked in by luc, 8 years ago

Client:
solo per il tema per mobile Futura2
sistemazione scelta dei colori del tema - possibilità di visualizzre anche nell'app la versione desktop

File size: 18.0 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
9$nometema=$tema;
10require_once("class/db/db.php"); //classe db
11global $tema,$id_comune,$descr_cons,$genere,$tipo_cons,$multicomune;
12
13# colore tema mobile
14include("temi/$tema/config.php");
15$colortheme=$_SESSION['colortheme'];
16if($colortheme=='')$colortheme="c";
17# descrizione comune
18if(!$id_comune or $id_comune=='') $id_comune=$siteistat;
19$res = $db->sql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ");
20list($descr_com) = $db->sql_fetchrow($res);
21
22
23####################################
24function testata(){
25####################################
26
27global $op,$tema,$db,$nometema,$file,$bgcolor,$sitename,$dbi,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com;
28
29include("temi/$tema/function_theme.php");
30
31$numerodisezioni=numerodisezioni();
32
33$logo= "<img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_comune=".$id_comune."\" alt=\"logo\" width=\"70\" align=\"left\"/>";
34
35$res = $db->sql_query("SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ");
36 list($descr_com) = $db->sql_fetchrow($res);
37 $descr_com =stripslashes($descr_com);
38
39echo '
40<div data-role="page" data-theme="a">
41 <div data-role="header" data-position="inline">';
42
43 /*
44 if($op!="gruppo")
45 echo '<a href="#" onClick="javascript:history.back()" data-role="button" data-icon="arrow-left">indietro</a>';
46 else echo '<a href="modules.php?tema=facebook" target="_blank" data-icon="off" data-role="button">Vers Web</a>';
47 */
48 //
49 # se aperta o sezioni scrutinate
50 # se non Ú il menu di config o about sceglie elezione
51 if($numerodisezioni[0]>0 and $op!="conf_mob" and $op!="about"){
52 echo '<a href="#" data-role="button">sezioni <img src="modules/Elezioni/grafici/ledex1.php?sez='.$numerodisezioni[0].'&max='.$numerodisezioni[1].'" /></a><h2></h2>';
53 }else{
54 echo '<h2>Elezioni on line</h2>';
55 }
56
57 echo '<a href="modules.php?name=Elezioni&op=about&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-theme="c" data-icon="user">About</a>';
58
59
60####### menu in alto
61# definizione attivo
62
63
64if($op=="gruppo" ) $active_home=" class=\"ui-btn-active\""; else $active_home='';
65if($op=="informazioni" || $op=="dati_generali" || $op=="come_si_vota" || $op=="numeri_mob" || $op=="servizi_mob") $active_info=" class=\"ui-btn-active\""; else $active_info='';
66if($op=="risultati" || $op=="affluenze_all" || $op=="gruppo_mob" || $op=="candidato_mob" || $op=="liste_mob" || $op=="votanti_mob") $active_ris=" class=\"ui-btn-active\""; else $active_ris='';
67if($op=="conf_mob" ) $active_conf=" class=\"ui-btn-active\""; else $active_conf='';
68if($op=="grafica_mob" ) $active_graf=" class=\"ui-btn-active\""; else $active_graf='';
69
70
71
72echo ' <div data-role="navbar">
73 <ul>
74 <li><a href="modules.php?id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'?" data-icon="home" data-theme="'.$colortheme.'" '.$active_home.' >Home</a></li>
75 <li><a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="file" data-theme="'.$colortheme.'" '.$active_info.' >Info</a></li>
76 <li><a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="list" data-theme="'.$colortheme.'" '.$active_ris.' >Risultati</a></li>
77 <li><a href="modules.php?op=grafica_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'"" data-icon="th-large" data-theme="'.$colortheme.'" '.$active_graf.'>Grafica</a></li>
78 <li><a href="modules.php?op=conf_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-icon="cogs" data-theme="'.$colortheme.'" '.$active_conf.' >Opzioni</a></li>
79 </ul>
80 </div>
81</div>';
82
83
84# se non Ú il menu di config o about sceglie elezione
85if($op!="conf_mob" and $op!="about"){
86 echo'<div data-role="fieldcontain" style="text-align:center;">
87 <span style="text-align:center;width:100%;height:110px;background-color:#fff;color:#000;">'.$logo.' Comune di '.$descr_com.'</span>';
88
89
90
91 $res = $db->sql_query("SELECT t1.id_cons_gen,t1.descrizione FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune='$id_comune' and t2.chiusa!='2' order by t1.data_fine desc" );
92 $esiste=$db->sql_numrows($res);
93
94 echo " <form method=\"post\" action=\"modules.php\">
95<label for=\"consultazione\">
96
97 <input id=\"modulo\" type=\"hidden\" name=\"name\" value=\"Elezioni\" />
98 <input type=\"hidden\" name=\"prima\" value=\"1\" />
99 <select name=\"id_cons_gen\" id=\"select-choice-a\"
100 onchange=\"javascript:top.location.href='modules.php?op=gruppo&amp;name=Elezioni&amp;id_comune=$id_comune&amp;file=index&amp;id_cons_gen='+this.options[this.options.selectedIndex].value\">";
101
102 while(list($id,$descrizione) = $db->sql_fetchrow($res)) {
103 $descrizione=substr(str_replace("+"," ",$descrizione),0,30);
104 $sel = ($id == $id_cons_gen) ? "selected=\"selected\"":"";
105 echo "<option style=\"font-size:12px;\" value=\"$id\" $sel >$descrizione</option>";
106 }
107
108 echo '</select></label></form>
109
110 </div>';
111} # fine form scelta elezioni
112
113
114
115if($op=="gruppo")home();// leggi il file config.php
116elseif($op=="informazioni")info();
117elseif($op=="affluenze")affluenze();
118elseif($op=="dati_generali")dati_generali();
119elseif($op=="risultati")risultati();
120elseif($op=="grafica_mob")grafica_mob();
121elseif($op=="come_si_vota")come_si_vota();
122elseif($op=="numeri_mob")numeri_mob();
123elseif($op=="servizi_mob")servizi_mob();
124elseif($op=="affluenze_all")affluenze_all();
125elseif($op=="gruppo_mob")gruppo_mob();
126elseif($op=="candidato_mob")candidato_mob();
127elseif($op=="liste_mob")liste_mob();
128elseif($op=="votanti_mob")votanti_mob();
129elseif($op=="conf_mob")conf_mob();
130elseif($op=="about")about();
131elseif($op=="grafvotanti_mob")grafvotanti_mob();
132elseif($op=="grafgruppo")grafgruppo();
133elseif($op=="grafsezione")grafsezione();
134
135footer_mon();
136
137die();
138}
139
140
141function footer_mon(){
142global $id_comune,$id_cons_gen,$tema,$colortheme,$rss;
143
144echo '
145<div data-role="footer" data-theme="a" style="marig:0 auto; text-align:center;">
146 <div data-role="footer" data-position="inline" data-icon="cogs">';
147
148 echo ' <h5><a href="http://www.eleonline.it" target="_blank">Eleonline</a> <span style="font-size:12px;"> di luciano apolito & roberto gigli</span></h5></div>';
149
150if($tema=="Futura2")
151 //echo'<a href="backtoapp.html" data-rel="external" data-ajax="false">Chiudi</a>'; // per l'app precedente non piu usata
152 echo '&nbsp;<a href="modules.php?name=Elezioni&tema=facebook&nocell=1" data-rel="external" data-ajax="false" >Versione Desktop</a>';
153else
154 echo '&nbsp;<a href="modules.php?name=Elezioni&tema=facebook&desktop=1" data-rel="external" data-ajax="false" >Versione Desktop</a>';
155 echo'</div>';
156}
157
158
159
160#######################################
161####################################### inizio funzioni menu
162#######################################
163
164
165
166############################ menu home page
167function home(){
168global $id_comune,$id_cons_gen,$tema,$colortheme;
169//include("temi/$tema/config.php");
170
171echo '<div data-role="content" data-theme="a">
172<a href="modules.php?op=informazioni&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Informazioni Elettorali</a>
173<!-- <a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="heart">Ultima Affluenza</a> -->
174<a href="modules.php?op=risultati&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Risultati Elettorali</a>
175</div>';
176echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
177 //graf_gruppo_mob();
178 echo "</ul>";
179echo '';
180
181}
182
183
184
185
186
187############################### menu informazioni
188function info(){
189global $id_comune,$id_cons_gen,$colortheme;
190echo '
191<div data-role="content" data-theme="a">
192<a href="modules.php?op=dati_generali&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
193Dati Generali</a>
194<a href="modules.php?op=come_si_vota&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
195Come si Vota</a>
196<a href="modules.php?op=numeri_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
197Numeri Utili</a>
198<a href="modules.php?op=servizi_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">
199Servizi Utili</a>
200</div>
201';
202
203}
204
205####################################### menu risultati
206function risultati(){
207global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme;
208echo '<div data-role="content" data-theme="'.$colortheme.'">
209<a href="modules.php?op=affluenze_all&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Affluenze</a>
210<a href="modules.php?op=votanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Votanti</a>
211<a href="modules.php?op=gruppo_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._GRUPPO.'</a>';
212
213 if($genere==3 OR $genere==5)
214 echo '<a href="modules.php?op=liste_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._LISTA.'</a>';
215 if(($genere==3 OR $genere==5) and $tipo_cons!="1" or $tipo_cons>="11")
216 echo '<a href="modules.php?op=candidato_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._CANDIDATO.'</a>';
217
218
219echo'</div>
220';
221
222}
223
224####################################### menu grafica
225function grafica_mob(){
226global $id_comune,$id_cons_gen,$genere,$tipo_cons,$colortheme;
227echo '<div data-role="content" data-theme="'.$colortheme.'">
228
229<a href="modules.php?op=grafsezione&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Elenco Sezioni scrutinate</a>
230
231<a href="modules.php?op=affluenze&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Affluenze</a>
232<a href="modules.php?op=grafvotanti_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">Grafica Votanti</a>';
233/*
234<a href="modules.php?op=grafgruppo&grafica=0&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._GRUPPO.'</a>';
235
236 if($genere==3 OR $genere==5)
237 echo '<a href="modules.php?op=liste_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._LISTA.'</a>';
238 if(($genere==3 OR $genere==5) and $tipo_cons!="1" or $tipo_cons>="11")
239 echo '<a href="modules.php?op=candidato_mob&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" " data-role="button" data-theme="'.$colortheme.'" data-icon="arrow-right" data-iconpos="right">'._CANDIDATO.'</a>';
240*/
241
242echo'</div>';
243
244
245}
246
247
248#######################################
249####################################### inizio funzioni visualizzazione
250#######################################
251
252
253# affluenza unica x grafica
254function affluenze(){
255 global $tema;
256 affluenza_unica();
257 grafica_mob();
258}
259
260# votanti x menu grafica
261
262function grafvotanti_mob(){
263 global $tema,$db,$prefix,$colortheme;
264 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
265
266 votanti_mobile();
267 echo "</ul>";
268 grafica_mob();
269
270}
271
272# gruppo per menu grafica
273function grafgruppo(){
274 global $tema,$db,$prefix,$colortheme;
275 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
276 graf_gruppo_mob();
277 echo "</ul>";
278 grafica_mob();
279
280}
281
282# gruppo per menu grafica
283function grafsezione(){
284 global $tema,$db,$prefix,$colortheme;
285 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
286 graf_sezioni();
287 echo "</ul>";
288 grafica_mob();
289
290}
291
292
293
294
295############ menu informazioni
296############
297
298function dati_generali(){
299 global $tema,$colortheme;
300 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
301
302 dati_mob_fun();
303 echo "</ul>";
304 info();
305}
306
307function come_si_vota(){
308 global $tema,$colortheme;
309 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
310 come_mob("come");
311 echo "</ul>";
312 info();
313}
314
315function numeri_mob(){
316 global $tema,$colortheme;
317 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
318 come_mob("numeri");
319 echo "</ul>";
320 info();
321}
322
323function servizi_mob(){
324 global $tema,$colortheme;
325 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
326 come_mob("servizi");
327 echo "</ul>";
328 info();
329}
330
331
332
333
334
335######## menu risultati
336########
337
338function affluenze_all(){
339 global $tema,$colortheme;
340 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
341
342 affluenze_mob();
343 echo "</ul>";
344 risultati();
345}
346
347function votanti_mob(){
348 global $tema,$db,$prefix,$colortheme;
349 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
350 votanti_tabella();
351 risultati();
352 echo "</ul>";
353}
354
355
356# risultati semplici gruppo
357function gruppo_mob(){
358 global $tema,$colortheme;
359 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
360 graf_gruppo_mob();
361 //graf_risultati();
362 echo "</ul>";
363 risultati();
364}
365
366function liste_mob(){
367 global $tema,$colortheme;
368 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
369 //echo '<div data-role="content" data-theme="a"><p>';
370 graf_liste_mob();
371 echo "</ul>";
372 risultati();
373}
374
375
376function candidato_mob(){
377 global $tema,$colortheme;
378 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
379 graf_candidato_mob();
380 echo "</ul>";
381 risultati();
382}
383
384
385function conf_mob(){
386###############################################
387# scelta comune in caso di multicomune tema
388global $multicomune,$tema,$prefix,$db,$colortheme,$id_cons_gen,$info,$id_comune,$rss;
389
390echo "<center>
391 <div data-role=\"fieldcontain\" style=\"margin:0 auto;text-align:center;\">
392 <form method=\"post\" action=\"modules.php\">";
393
394
395
396if ($multicomune=='1')
397 {
398
399 $sqlcomu="select t1.id_comune,t1.descrizione,count(0) from ".$prefix."_ele_comuni as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_comune=t2.id_comune and t2.chiusa!='2' group by t1.id_comune,t1.descrizione order by t1.descrizione asc";
400
401 $rescomu= $db->sql_query($sqlcomu);
402 $esiste_multi=$db->sql_numrows($rescomu);
403 if ($esiste_multi>=1) {
404
405 echo " <input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\" />
406 <input type=\"hidden\" name=\"id_cos_gen\" value=\"$id_cons_gen\" />
407 <input type=\"hidden\" name=\"op\" value=\"gruppo\" />
408 <select name=\"id_comune\" data-native-menu=\"false\">
409 <option>Scegli il comune</option>";
410
411 while (list($id,$descrizione,)=mysql_fetch_row($rescomu)){
412 // $sel=($id == $id_comune) ? "selected=\"selected\"":"";
413 echo "<option value=\"$id\" $sel >$descrizione</option>";
414 }
415
416 echo "</select>";
417 }
418 }
419
420### colore tema
421# colore del tema
422# la variabile rss, non usta in questo tema, Ú stata presa in prestito per determinare il colore del tema
423
424 echo "<select name=\"rss\" data-native-menu=\"false\" > ";
425 echo "<option>Scegli il colore del tema</option>";
426 echo "<option value=\"2\" $selez >Blu</option>";
427 echo "<option value=\"3\" $selez >Rosso</option>";
428 echo "<option value=\"4\" $selez >Verde</option>";
429 echo "<option value=\"5\" $selez >Ciano</option>";
430 echo "<option value=\"6\" $selez >Giallo</option>";
431 echo "<option value=\"7\" $selez >Grigio</option>";
432 echo '</select><p>
433 <fieldset class="ui-grid-a" >
434 <div class="ui-block-b" style=width:100%;><button type="submit" data-theme="'.$colortheme.'">Conferma</button></div></fieldset>
435 </p></form></div></center>';
436}
437
438function about(){
439###############################################
440# scelta comune in caso di multicomune tema
441global $tema,$db,$prefix,$colortheme,$id_comune,$descr_com;
442
443 echo '<ul data-role="listview" data-inset="true" data-divider-theme="'.$colortheme.'">';
444 echo "<li style=\"text-align:center;\" data-role=\"list-divider\" data-icon=\"arrow-up\" >";
445 echo "<b>About e Credits</b></li>";
446 echo "<div data-role=\"content\" data-theme=\"$colortheme\">";
447 echo "<a href=\"http://www.eleonline.it\">
448 <img src=\"temi/$tema/images/mobile.jpg\" align=\"left\">EleONLine</a><br/>
449
450 Software Open Source per ogni elezione<br/>
451 di <a href=\"mailto:luciano@linuxap.it\">Luciano Apolito</a> &
452 <a href=\"mailto:rgigli@libero.it\">Roberto Gigli</a><br/>
453 <i>stai usando lo \"Smartphone theme <b>FUTURA n.2</b>\"<br/>
454 </div>";
455 echo "<li style=\"text-align:center;\" data-role=\"list-divider\" data-icon=\"arrow-up\" >";
456 echo "<b>Gruppo di Lavoro Comune di $descr_com</b></li></ul>";
457 include ("pagine/gruppo.html");
458 //echo "</div>aaa";
459
460
461
462}
463
464?>
Note: See TracBrowser for help on using the repository browser.