source: trunk/admin/temi/Futura2/index.php@ 360

Last change on this file since 360 was 360, checked in by roby, 3 years ago

ATTENZIONE: con questa rev viene cambiato il charset che da ora viene impostato su utf8. Fate tutte le vostre verifiche prima di installarla.
Seconda fase di rivisitazione e completamento delle funzioni necessarie per l'accesso al servizio tramite cellulare.
Effettuate alcune sistemazioni per gli avvisi di incongruenza.

File size: 8.7 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('ADMIN_FILE')) {
10 die ("You can't access this file directly...");
11}
12$param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
13foreach($param as $key=>$val) {
14 if($key=='ops') $ops=$val;
15 if($key=='id_lista') $id_lista=$val;
16}
17
18
19
20include_once("header.php");
21$nometema=$tema;
22#require_once("class/db/db.php"); //classe db
23global $tema,$id_comune,$descr_cons,$multicomune,$dbi,$prefix,$currentlang,$ops,$id_sez,$id_cons,$id_cons_gen;
24include_once("modules/Elezioni/query.sql");
25#if(($tema='Futura2' and !$id_sez) or $_SESSION['id_cons']!=$id_cons) {Header("Location: admin.php?id_comune=$id_comune&op=logout&is=$id_sez"); die();}
26#die( "OP: $op - aid:".$_SESSION['aid']." - tema:$tema");
27include_once("modules/Elezioni/ele_spoglio.php");
28$row=setconsultazione();
29$sql="select id_sez from ".$prefix."_ele_operatori where aid='$aid' and id_cons=$id_cons";
30$res = $dbi->prepare("$sql");
31$res->execute();
32
33list($id_sez) = $res->fetch(PDO::FETCH_NUM);#include("TEST:$id_sez:$sql:");
34
35if(isset($row[0])) {
36 $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2];
37} else {
38 $tipo_cons=0; $descr_cons=''; $id_cons_gen=0;
39}
40$row=tipocons();
41if(isset($row[0])) {
42 $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4];
43} else {
44 $genere=0;$votog=0;$votol=0;$votoc=0;$conscirc=0;
45}
46
47include("temi/$tema/config.php");
48
49#if($colortheme=='')$colortheme="c";
50# descrizione comune
51if(!$id_comune or $id_comune=='') $id_comune=$siteistat;
52$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
53 $res = $dbi->prepare("$sql");
54 $res->execute();
55
56list($descr_com) = $res->fetch(PDO::FETCH_NUM);
57#include_once("header.php");
58testata();
59
60####################################
61function testata(){
62####################################
63
64global $op,$tema,$dbi,$nometema,$file,$bgcolor,$sitename,$prefix,$blocco,$lang,$siteistat,$id_cons_gen,$descr_cons,$minsez,$offsetsez,$multicomune,$id_comune,$multicomune,$rss,$colortheme,$descr_com;
65global $id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$votog,$genere,$aid,$bgcolor1,$language;
66
67include("temi/$tema/function_theme.php");
68$logo='';
69
70echo "<SCRIPT type=\"text/javascript\">\n";
71echo "function vai_cong(idrif){\n";
72echo "document.getElementById('frm').submit()\n";
73echo "}\n";
74echo "function vai_scelta(idrif){\n";
75echo "window.document.location.href=idrif\n";
76echo "}\n";
77echo "</script>\n";
78
79#
80if(!$ops) $ops=1;
81$sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
82$res = $dbi->prepare("$sql");
83$res->execute();
84list($descr_com) = $res->fetch(PDO::FETCH_NUM);
85$descr_com =stripslashes($descr_com);
86
87echo '
88<div data-role="page" data-theme="a">
89<div data-role="header" data-position="inline">';
90echo '<h2 style="color: white;">Elezioni on line</h2>';
91$oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
92$sql="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 t1.data_fine>'$oggi' and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and id_sez>0 and permessi>0)";
93$rese = $dbi->prepare("$sql");
94$rese->execute();
95if ($rese->rowCount()>1){
96 echo "<form id=\"frm\" name=\"sceltacons\" data-ajax=\"false\" action=\"admin.php\">";
97 echo "<input type=\"hidden\" name=\"id_comune=\" value=\"$id_comune\">";
98 echo "<input type=\"hidden\" name=\"ops=\" value=\"$ops\">";
99 echo "<select id=\"id_cong\" name=\"id_cons_gen\" onChange=\"vai_cong('id_cong');\">";
100 while (list($id_cons_gen2,$desc2)=$rese->fetch(PDO::FETCH_NUM)) {
101 $sel = ($id_cons_gen == $id_cons_gen2) ? "selected" : "";
102 echo "<option value=\"$id_cons_gen2\" $sel>";
103 echo $desc2;
104 echo "</option>";
105 }
106 echo "</select></form>";
107}
108$sql="select tipo from ".$prefix."_ele_controlli where id_sez='$id_sez' group by tipo";
109$rese = $dbi->prepare("$sql");
110$rese->execute();
111$bordoa='';
112$bordog='';
113$bordol='';
114while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) {
115 if ($tipo=='affluenze') $bordoa="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
116 if ($tipo=='gruppo' or $tipo=='referendum') $bordog="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
117 if ($tipo=='lista') $bordol="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
118}
119if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna='';
120if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo='';
121if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista='';
122if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff='';
123echo "</div>";
124echo'<div data-role="fieldcontain" style="text-align:center;">
125<span style="text-align:center;width:100%;height:110px;background-color:#fff;color:#000;">'.$logo.' Comune di '.$descr_com.' <br><h2>Consultazione: '.$descr_cons.'</h2></span></div>';
126###############
127 //************************************
128 // Menu spoglio
129 //************************************
130$sql="select id_sez from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'";
131$sth = $dbi->prepare("$sql"); #echo $sql;
132$sth->execute();
133list($id_sez)=$sth->fetch(PDO::FETCH_NUM);
134$sql="select id_cons,id_sez,id_sede,num_sez, maschi, femmine, colore from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";
135$result = $dbi->prepare("$sql");#echo $sql;
136$result->execute();
137list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine, $colore) = $result->fetch(PDO::FETCH_NUM);
138echo "<div data-role=\"content\" data-theme=\"a\"><hr><table><tr><td align=\"center\" width=\"100\" bgcolor=\"$colore\"><font size =\"4\" color=\"black\" align=\"left\"><b>Sezione<br>N. $num_sez</b></font></td><td><table><tr>";
139#<a href=\"admin.php?id_comune=$id_comune&amp;id_cons_gen=$id_cons_gen&amp;ops=1\"></a>
140echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa onClick=\"vai_scelta('admin.php?id_comune=$id_comune&amp;id_cons_gen=$id_cons_gen&amp;ops=1');\"><p style=\"margin-left:10px;margin-right:10px;\"><font color=\"$tcolora\"><b>"._AFFLUENZE."</font></b></p></td>\n";
141if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
142 echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?id_comune=$id_comune&amp;id_cons_gen=$id_cons_gen&amp;ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n";
143}
144if($genere==2 and $votog)
145 echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?id_comune=$id_comune&amp;id_cons_gen=$id_cons_gen&amp;ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n";
146elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
147 echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?id_comune=$id_comune&amp;id_cons_gen=$id_cons_gen&amp;ops=3');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorl\">"._LISTA."</font></b></p></td>\n";
148}
149echo "</tr></table></td></tr></table><hr></div>\n";
150if($ops=="1")votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
151elseif($ops=="3")preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
152elseif($ops=="4")preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
153footer_mon();
154die();
155}
156
157
158########################################
159function footer_mon(){
160global $id_comune,$id_cons_gen,$tema,$colortheme,$rss;
161
162echo '
163<div data-role="footer" data-theme="a" style="margin:0 auto; text-align:center;">
164 <div data-role="footer" data-position="inline" data-icon="cogs">';
165
166 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>';
167
168
169 echo "<a href=\"admin.php?op=logout&id_comune=$id_comune\" data-ajax=\"false\">"._ESCI."</a>";
170# echo '&nbsp;<a href="admin.php?name=Elezioni&tema=facebook&nocell=1" data-rel="external" data-ajax="false" >Versione Desktop</a>';
171
172}
173
174
175
176?>
Note: See TracBrowser for help on using the repository browser.