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 | if (!defined('ADMIN_FILE')) {
|
---|
10 | die ("You can't access this file directly...");
|
---|
11 | }
|
---|
12 | $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
|
---|
13 | foreach($param as $key=>$val) {
|
---|
14 | if($key=='ops') $ops=$val;
|
---|
15 | if($key=='id_lista') $id_lista=$val;
|
---|
16 | }
|
---|
17 |
|
---|
18 | include("header.php");
|
---|
19 | $nometema=$tema;
|
---|
20 |
|
---|
21 | #require_once("class/db/db.php"); //classe db
|
---|
22 | global $tema,$id_comune,$descr_cons,$multicomune,$dbi,$prefix,$currentlang,$ops,$id_sez;
|
---|
23 | include_once("modules/Elezioni/query.sql");
|
---|
24 | 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();}
|
---|
25 |
|
---|
26 | $row=setconsultazione();
|
---|
27 | if(isset($row[0])) {
|
---|
28 | $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2];
|
---|
29 | } else {
|
---|
30 | $tipo_cons=0; $descr_cons=''; $id_cons_gen=0;
|
---|
31 | }
|
---|
32 | $row=tipocons();
|
---|
33 | if(isset($row[0])) {
|
---|
34 | $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4];
|
---|
35 | } else {
|
---|
36 | $genere=0;$votog=0;$votol=0;$votoc=0;$conscirc=0;
|
---|
37 | }
|
---|
38 |
|
---|
39 | # colore tema mobile
|
---|
40 |
|
---|
41 |
|
---|
42 | include("temi/$tema/config.php");
|
---|
43 |
|
---|
44 | #if($colortheme=='')$colortheme="c";
|
---|
45 | # descrizione comune
|
---|
46 | if(!$id_comune or $id_comune=='') $id_comune=$siteistat;
|
---|
47 | $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
|
---|
48 | $res = $dbi->prepare("$sql");
|
---|
49 | $res->execute();
|
---|
50 |
|
---|
51 | list($descr_com) = $res->fetch(PDO::FETCH_NUM);
|
---|
52 | include_once("header.php");
|
---|
53 | testata();
|
---|
54 |
|
---|
55 | ####################################
|
---|
56 | function testata(){
|
---|
57 | ####################################
|
---|
58 |
|
---|
59 | global $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;
|
---|
60 | global $id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$votog,$genere,$aid,$bgcolor1,$language;
|
---|
61 | include("temi/$tema/function_theme.php");
|
---|
62 | #$op='informazioni';
|
---|
63 | #$logo= "<img src=\"admin.php?name=Elezioni&file=foto&id_comune=".$id_comune."\" alt=\"logo\" width=\"70\" align=\"left\"/>";
|
---|
64 | $logo='';
|
---|
65 | #echo"togliere combo consultazioni e impostare su consultazione predefinita e sezione fissata su autorizza operatori (nuovo tipo: per unica sezione - spostare voci di menu, affluenze, gruppi. liste al posto della combo e togliere menu verticale)";
|
---|
66 | $sql="SELECT descrizione FROM ".$prefix."_ele_comuni where id_comune='$id_comune' ";
|
---|
67 | $res = $dbi->prepare("$sql");
|
---|
68 | $res->execute();
|
---|
69 |
|
---|
70 | list($descr_com) = $res->fetch(PDO::FETCH_NUM);
|
---|
71 | $descr_com =stripslashes($descr_com);
|
---|
72 |
|
---|
73 | echo '
|
---|
74 | <div data-role="page" data-theme="a">
|
---|
75 | <div data-role="header" data-position="inline">';
|
---|
76 |
|
---|
77 | /*
|
---|
78 | if($op!="gruppo")
|
---|
79 | echo '<a href="#" onClick="javascript:history.back()" data-role="button" data-icon="arrow-left">indietro</a>';
|
---|
80 | else echo '<a href="modules.php?tema=facebook" target="_blank" data-icon="off" data-role="button">Vers Web</a>';
|
---|
81 | */
|
---|
82 | //
|
---|
83 | # se aperta o sezioni scrutinate
|
---|
84 | # se non Ú il menu di config o about sceglie elezione
|
---|
85 |
|
---|
86 | echo '<h2>Elezioni on line</h2>';
|
---|
87 |
|
---|
88 | # echo '<a href="admin.php?name=Elezioni&op=about&id_comune='.$id_comune.'&id_cons_gen='.$id_cons_gen.'" data-theme="c" data-icon="user">About</a>';
|
---|
89 |
|
---|
90 |
|
---|
91 | ####### menu in alto
|
---|
92 | # definizione attivo
|
---|
93 | #echo "TEST: ".$_SESSION['BASE'];
|
---|
94 | #echo "TEST: ".$_SERVER['REQUEST_URI'];
|
---|
95 | #echo "TEST: ".$_SERVER['PHP_SELF'];
|
---|
96 | $sql="select tipo from ".$prefix."_ele_controlli where id_sez='$id_sez' group by tipo";
|
---|
97 | $rese = $dbi->prepare("$sql");
|
---|
98 | $rese->execute();
|
---|
99 | $bordoa='';
|
---|
100 | $bordog='';
|
---|
101 | $bordol='';
|
---|
102 | while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) {
|
---|
103 | if ($tipo=='affluenze') $bordoa="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
|
---|
104 | if ($tipo=='gruppo') $bordog="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
|
---|
105 | if ($tipo=='lista') $bordol="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";
|
---|
106 | }
|
---|
107 | if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna='';
|
---|
108 | if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo='';
|
---|
109 | if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista='';
|
---|
110 | if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff='';
|
---|
111 | /*if($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='';
|
---|
112 | if($op=="conf_mob" ) $active_conf=" class=\"ui-btn-active\""; else $active_conf='';
|
---|
113 | if($op=="grafica_mob" ) $active_graf=" class=\"ui-btn-active\""; else $active_graf='';
|
---|
114 |
|
---|
115 | */
|
---|
116 | echo "</div>";
|
---|
117 |
|
---|
118 |
|
---|
119 | # se non Ú il menu di config o about sceglie elezione
|
---|
120 | #if($op!="conf_mob" and $op!="about"){
|
---|
121 | echo'<div data-role="fieldcontain" style="text-align:center;">
|
---|
122 | <span style="text-align:center;width:100%;height:110px;background-color:#fff;color:#000;">'.$logo.' Comune di '.$descr_com.' <br>Consultazione: '.$descr_cons.'</span></div>';
|
---|
123 |
|
---|
124 |
|
---|
125 | ###############
|
---|
126 | //************************************
|
---|
127 | // Menu spoglio
|
---|
128 | //************************************
|
---|
129 | #echo "TEST : select id_sez from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'";
|
---|
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();
|
---|
133 | list($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();
|
---|
137 | list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine, $colore) = $result->fetch(PDO::FETCH_NUM);
|
---|
138 | echo "<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 | echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=1\"><font color=\"$tcolora\">"._AFFLUENZE."</font></a></b></p></td>\n";
|
---|
140 | if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
|
---|
141 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=4\"><font color=\"$tcolorg\">"._GRUPPO."</font></a></b></p></td>\n";
|
---|
142 | }
|
---|
143 | if($genere==2 and $votog)
|
---|
144 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=4\"><font color=\"$tcolorg\">"._GRUPPO."</font></a></b></p></td>\n";
|
---|
145 | elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
|
---|
146 | echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=3\"><font color=\"$tcolorl\">"._LISTA."</font></a></b></p></td>\n";
|
---|
147 | }
|
---|
148 | echo "</tr></table></td></tr></table><hr></div>\n";
|
---|
149 |
|
---|
150 |
|
---|
151 | if($ops=="1")votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
|
---|
152 | elseif($ops=="3")preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
153 | elseif($ops=="4")preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
154 |
|
---|
155 |
|
---|
156 | footer_mon();
|
---|
157 |
|
---|
158 | die();
|
---|
159 | }
|
---|
160 | ########################################
|
---|
161 |
|
---|
162 | function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){
|
---|
163 | //function votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av){
|
---|
164 | global $aid, $prefix, $dbi,$tipo_cons,$genere,$id_cons_gen,$id_comune,$ops;
|
---|
165 |
|
---|
166 | $bgcolor1="#7777ff";
|
---|
167 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
168 | #OpenTable();
|
---|
169 | $sql="SELECT vismf from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";
|
---|
170 | $res = $dbi->prepare("$sql");
|
---|
171 | $res->execute();
|
---|
172 |
|
---|
173 | if($res) list($vismf)= $res->fetch(PDO::FETCH_NUM); else $vismf=0;
|
---|
174 | $sql="SELECT orario,data FROM ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data,orario ";
|
---|
175 | $res = $dbi->prepare("$sql");
|
---|
176 | $res->execute();
|
---|
177 |
|
---|
178 | echo "<table><tr><td>";
|
---|
179 | $num = $res->rowCount();
|
---|
180 | $sql="SELECT maschi,femmine FROM ".$prefix."_ele_sezioni where id_sez=$id_sez";
|
---|
181 | $ressez = $dbi->prepare("$sql");
|
---|
182 | $ressez->execute();
|
---|
183 | ##################
|
---|
184 | echo "<style>";
|
---|
185 | echo "DIV.table";
|
---|
186 | echo "{
|
---|
187 | display:table;
|
---|
188 | }
|
---|
189 | FORM.tr
|
---|
190 | {
|
---|
191 | display:table-row;
|
---|
192 | text-align: center;
|
---|
193 | }
|
---|
194 | DIV.tr
|
---|
195 | {
|
---|
196 | display:table-row;
|
---|
197 | background-color: #D3D3D3;
|
---|
198 | text-align: center;
|
---|
199 | }
|
---|
200 | SPAN.tdm
|
---|
201 | {
|
---|
202 | display:table-cell;
|
---|
203 | border: 1px solid black;
|
---|
204 | padding: 5px;
|
---|
205 | }
|
---|
206 | SPAN.td
|
---|
207 | {
|
---|
208 | display:table-cell;
|
---|
209 | }";
|
---|
210 | echo "</style>";
|
---|
211 |
|
---|
212 | ##################
|
---|
213 |
|
---|
214 | list($maschi,$femmine)=$ressez->fetch(PDO::FETCH_NUM);
|
---|
215 | $y=0;
|
---|
216 | echo "<div class=\"table\">";
|
---|
217 | $riga=array();
|
---|
218 | $rigat=array();
|
---|
219 | while (list($ora,$giorno)= $res->fetch(PDO::FETCH_NUM)){
|
---|
220 | $y++;
|
---|
221 | $rigat[$y]='';
|
---|
222 | $riga[$y]='';
|
---|
223 | $rigat[$y]= "<div class=\"tr\">";
|
---|
224 | if ($genere==0){ //e' un referendum
|
---|
225 | $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._NUM."</b></span>";
|
---|
226 | }
|
---|
227 | $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._ORA."</b></span>"
|
---|
228 | ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._DATA."</b></span>";
|
---|
229 | $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIU."</b></span>";
|
---|
230 | $rigat[$y].= "<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTID."</b></span>"
|
---|
231 | ."<span class=\"tdm\" bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTIT."</b></span>";
|
---|
232 | if ($genere==0){
|
---|
233 | $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' ";
|
---|
234 | $res2 = $dbi->prepare("$sql");
|
---|
235 | $res2->execute();
|
---|
236 | $max = $res2->rowCount();
|
---|
237 | }else{ $max=1;}
|
---|
238 | $op="rec_add_votanti";
|
---|
239 | $rigat[$y].= "</div>";
|
---|
240 | for ($i=1;$i<=$max;$i++){
|
---|
241 | $query="SELECT * FROM ".$prefix."_ele_voti_parziale as t1 left join ".$prefix."_ele_gruppo as t2
|
---|
242 | on (t1.id_gruppo=t2.id_gruppo) where t1.id_sez='$id_sez'
|
---|
243 | and t1.id_cons='$id_cons' and t1.orario='$ora' and t1.data='$giorno'";
|
---|
244 | if ($genere==0){
|
---|
245 | $query.=" and t2.num_gruppo=$i";
|
---|
246 | }
|
---|
247 | $sql=$query;
|
---|
248 | $result = $dbi->prepare("$sql");
|
---|
249 | $result->execute();
|
---|
250 | list($id_cons2,$id_sez2,$id_parz,$orario,$data, $voti_u, $voti_d, $voti_t,$id_gruppo) = $result->fetch(PDO::FETCH_NUM);
|
---|
251 | $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo' ";
|
---|
252 | $res2 = $dbi->prepare("$sql");
|
---|
253 | $res2->execute();
|
---|
254 | $sql="select count(0) FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
255 | $resril = $dbi->prepare("$sql");
|
---|
256 | $resril->execute();
|
---|
257 | list($numril)=$resril->fetch(PDO::FETCH_NUM);
|
---|
258 | if ($res2)
|
---|
259 | list($gruppo)= $res2->fetch(PDO::FETCH_NUM);
|
---|
260 | else
|
---|
261 | $gruppo=0;
|
---|
262 | if (!$gruppo>0) {
|
---|
263 | $gruppo=$i;
|
---|
264 | $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where num_gruppo=$gruppo and id_cons=$id_cons";
|
---|
265 | $res3 = $dbi->prepare("$sql");
|
---|
266 | $res3->execute();
|
---|
267 | if ($res3)
|
---|
268 | list($id_gruppo)=$res3->fetch(PDO::FETCH_NUM);
|
---|
269 | }
|
---|
270 | if(!isset($precede[$id_gruppo])) $precede[$id_gruppo]=0; if(!isset($error)) $error=0;
|
---|
271 | if($precede[$id_gruppo]>($voti_t) and $voti_t!='') $error=1;
|
---|
272 | $precede[$id_gruppo]=$voti_t;
|
---|
273 | if (($voti_u+$voti_d and $voti_u+$voti_d!=$voti_t) or $error){
|
---|
274 | $riga[$y].= "<form class=\"tr\" data-ajax=\"false\" style=\"background-color: rgb(255, 0, 0); text-align: center\" name=\"votanti\" action=\"modules/Elezioni/salva_aff.php\">";
|
---|
275 | }else{
|
---|
276 | $riga[$y].= "<form class=\"tr\" data-ajax=\"false\" action=\"modules/Elezioni/salva_aff.php\">";
|
---|
277 | }
|
---|
278 | if ($genere==0){ // e' un referendum
|
---|
279 | $riga[$y].= "<span class=\"td\" align=\"center\">$gruppo</span>";
|
---|
280 | }
|
---|
281 | $riga[$y].= "<span class=\"td\"><input type=\"hidden\" name=\"op\" value=\"rec_add_votanti\"/>";
|
---|
282 | $riga[$y].= "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"/>"
|
---|
283 | ."<input type=\"hidden\" name=\"genere\" value=\"$genere\"/>"
|
---|
284 | ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"/>"
|
---|
285 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\"/>"
|
---|
286 | ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\"/>";
|
---|
287 | list ($anno,$mese,$di)=explode('-',$giorno);
|
---|
288 | $riga[$y].= "$ora</span><span class=\"td\" align=\"center\">$di-$mese-$anno</span>";
|
---|
289 | if ($voti_u > $maschi) $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\">";
|
---|
290 | else $riga[$y].= "<span class=\"td\" align=\"center\">";
|
---|
291 | if ($y<$num and $vismf==0 and $voti_u==0) { $riga[$y].= "<input type=\"hidden\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"'$voti_u'\"";}else $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_u$y$i\" name=\"voti_u\" value=\"$voti_u\"";
|
---|
292 | $riga[$y].= " size=\"5\"/></span>";
|
---|
293 | if ($voti_d > $femmine) $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\"/>";
|
---|
294 | else $riga[$y].= "<span class=\"td\" align=\"center\">";
|
---|
295 | if ($y<$num and $vismf==0 and $voti_d==0) { $riga[$y].= "<input type=\"hidden\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"'$voti_d'\"";}else $riga[$y].= "<input type=\"text\" style=\"text-align:right\" id=\"voti_d$y$i\" name=\"voti_d\" value=\"$voti_d\"";
|
---|
296 | $riga[$y].= " size=\"5\"/></span>";
|
---|
297 | if ($voti_t > ($maschi+$femmine)) $riga[$y].= "<span class=\"td\" align=\"center\" bgcolor=\"red\" ><input type=\"text\" id=\"voti_t$y$i\" name=\"voti_t\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\"/>";
|
---|
298 | else $riga[$y].= "<span class=\"td\" align=\"center\"><input id=\"voti_t$y$i\" name=\"voti_t\" value=\"$voti_t\" size=\"5\" style=\"text-align:right\"/>";
|
---|
299 | $riga[$y].= "<input type=\"hidden\" name=\"id_parz\" value=\"$id_parz\"/>"
|
---|
300 | ."<input type=\"hidden\" name=\"data\" value=\"$giorno\"/>"
|
---|
301 | ."<input type=\"hidden\" name=\"orario\" value=\"$ora\"/>"
|
---|
302 | ."<input type=\"hidden\" name=\"id_comune\" value=\"$id_comune\"/>"
|
---|
303 | ."<input type=\"hidden\" name=\"id_gruppo\" value=\"$id_gruppo\"/>";
|
---|
304 | $riga[$y].= "</span>";
|
---|
305 | if (chisei($id_cons_gen)>=64 and $y==$numril) $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\">"._DELETE." <input type=\"checkbox\" name=\"delete\" value=\"true\"/></span>";
|
---|
306 | else $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\"><input type=\"hidden\" name=\"delete\" value=\"\"/></span>";
|
---|
307 | $riga[$y].= "<span class=\"td\" style=\"text-align: right;\" rowspan=\"1\" colspan=\"6\"><input type=\"submit\" name=\"update\" value=\""._OK."\"/></span>";
|
---|
308 | $riga[$y].= "</form>";
|
---|
309 |
|
---|
310 | }
|
---|
311 | echo "</div>";
|
---|
312 | $sql="select count(voti_complessivi) from ".$prefix."_ele_voti_parziale where data='$giorno' and orario='$ora' and id_sez=$id_sez";
|
---|
313 | $compl = $dbi->prepare("$sql");
|
---|
314 | $compl->execute();
|
---|
315 | list ($complessivi)= $compl->fetch(PDO::FETCH_NUM);
|
---|
316 | }
|
---|
317 | foreach($riga as $key=>$val){
|
---|
318 | echo $rigat[$key];
|
---|
319 | echo $riga[$key];
|
---|
320 | }
|
---|
321 | echo "</div></td></tr></table>";
|
---|
322 | }
|
---|
323 |
|
---|
324 |
|
---|
325 | ########################################
|
---|
326 | function footer_mon(){
|
---|
327 | global $id_comune,$id_cons_gen,$tema,$colortheme,$rss;
|
---|
328 |
|
---|
329 | echo '
|
---|
330 | <div data-role="footer" data-theme="a" style="margin:0 auto; text-align:center;">
|
---|
331 | <div data-role="footer" data-position="inline" data-icon="cogs">';
|
---|
332 |
|
---|
333 | 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>';
|
---|
334 |
|
---|
335 |
|
---|
336 | echo "<a href=\"admin.php?op=logout&id_comune=$id_comune\" data-ajax=\"false\">"._ESCI."</a>";
|
---|
337 | # echo ' <a href="admin.php?name=Elezioni&tema=facebook&nocell=1" data-rel="external" data-ajax="false" >Versione Desktop</a>';
|
---|
338 |
|
---|
339 | }
|
---|
340 |
|
---|
341 |
|
---|
342 |
|
---|
343 | //////////////////////////////////////////////////////////////////////
|
---|
344 | // da qui va la sezione per le preferenze candidati consiglieri
|
---|
345 | //////////////////////////////////////////////////////////////////////
|
---|
346 | function preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
|
---|
347 | global $aid, $prefix, $dbi, $id_lista,$genere,$id_cons_gen,$id_gruppo,$sezi,$circo,$votog,$votol,$votoc,$conscirc;
|
---|
348 | global $tipo_cons,$limite,$dettnulli,$disgiunto;
|
---|
349 | $bgcolor1="#7777ff";
|
---|
350 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
351 | echo "<SCRIPT type=\"text/javascript\">\n";
|
---|
352 | echo "function vai_lista(){\n";
|
---|
353 | echo "var element=document.getElementById('pag')\n";
|
---|
354 | echo "var elista=document.getElementById('id_lista')\n";
|
---|
355 | echo "var url=element.value+elista.value\n";
|
---|
356 | echo "window.document.location.href=url \n";
|
---|
357 | echo "}\n";
|
---|
358 | echo "</script>\n";
|
---|
359 | if ($genere==4){
|
---|
360 | $sql="SELECT voti_uomini,voti_donne, voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_cons='$id_cons' order by data desc,orario desc limit 0,1";
|
---|
361 | $result = $dbi->prepare("$sql");
|
---|
362 | $result->execute();
|
---|
363 |
|
---|
364 |
|
---|
365 | list( $voti_u, $voti_d, $voti_t) = $result->fetch(PDO::FETCH_NUM);
|
---|
366 | echo "<table class=\"table-menu\" style=\"width: 50%; color: black;\">"
|
---|
367 | ."<tr><td></td><td align=\"center\"></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIU."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTID."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIT."</td></tr>"
|
---|
368 | ."<tr><td></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._TOT_ULT."</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_u</td><td align=\"center\" bgcolor=\"$bgcolor2\">$voti_d</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_t</td></tr>";
|
---|
369 | echo "</table>";
|
---|
370 | }
|
---|
371 | $sql="select validi,nulli,bianchi,contestati from ".$prefix."_ele_sezioni where id_sez='$id_sez' ";
|
---|
372 | $result = $dbi->prepare("$sql");
|
---|
373 | $result->execute();
|
---|
374 | list($v1,$v2,$v3,$v4)=$result->fetch(PDO::FETCH_NUM);
|
---|
375 | if($v1+$v2+$v3+$v4>0){
|
---|
376 | //controlla se sono stati inseriti i votanti
|
---|
377 | $sql="SELECT preferenze, id_fascia, id_conf,solo_gruppo, disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons'";
|
---|
378 | $result = $dbi->prepare("$sql");
|
---|
379 | $result->execute();
|
---|
380 |
|
---|
381 |
|
---|
382 | list($numprefs,$fascia,$id_conf,$flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM);
|
---|
383 | $dettnulli=$flagsg;
|
---|
384 | ####### 06-11-2014 - circoscrizionali - nello spostamento ad altra sezione resta sullo stesso numero di lista anche se sono sezioni di diverse circoscrizioni
|
---|
385 | if ($circo and $id_lista){
|
---|
386 | $sql="SELECT num_lista from ".$prefix."_ele_lista where id_lista=$id_lista";
|
---|
387 | $res_lis = $dbi->prepare("$sql");
|
---|
388 | $res_lis->execute();
|
---|
389 | list($num_lista)=$res_lis->fetch(PDO::FETCH_NUM);
|
---|
390 | }
|
---|
391 |
|
---|
392 | if(!$votog and ($genere==3 or $genere==5)){
|
---|
393 | $sql="select validi_lista,nulli,bianchi,contestati_lista,voti_nulli_lista from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
394 | $result = $dbi->prepare("$sql");
|
---|
395 | $result->execute();
|
---|
396 |
|
---|
397 |
|
---|
398 | }else{
|
---|
399 | $sql="select validi,nulli,bianchi,contestati,voti_nulli from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
400 | $result = $dbi->prepare("$sql");
|
---|
401 | $result->execute();
|
---|
402 | }
|
---|
403 |
|
---|
404 | list($validi,$nulli,$bianchi,$contestati,$votinulli) = $result->fetch(PDO::FETCH_NUM);
|
---|
405 | echo "<table class=\"table-menu\" style=\"width: 100%;\"><tr>";
|
---|
406 | $sql="SELECT id_lista, descrizione,num_lista from ".$prefix."_ele_lista where id_cons=$id_cons $circo order by num_lista";
|
---|
407 | $res_lis = $dbi->prepare("$sql");
|
---|
408 | $res_lis->execute();
|
---|
409 |
|
---|
410 |
|
---|
411 | $num_liste = $res_lis->rowCount();
|
---|
412 | $ele_lista='';
|
---|
413 | if (($genere==4 or $genere==5) and !$votoc) { //liste a piu' candidati
|
---|
414 | if(($genere==5 and $id_conf and $fascia<=$limite and !$disgiunto) and !$id_lista) { //esclude il voto di lista per le comunali nei comuni sotto fascia limite
|
---|
415 | $sql="SELECT id_lista from ".$prefix."_ele_lista where id_cons=$id_cons $circo limit 0,1";
|
---|
416 | $result = $dbi->prepare("$sql");
|
---|
417 | $result->execute();
|
---|
418 |
|
---|
419 |
|
---|
420 | list($id_lista)=$result->fetch(PDO::FETCH_NUM);
|
---|
421 | }
|
---|
422 | echo "<td colspan=\"2\">";
|
---|
423 | echo "<form name=\"liste\" data-ajax=\"false\" action=\"admin.php\">"; # data-ajax=\"false\"
|
---|
424 | echo "<input type=\"hidden\" id=\"pag\" name=\"pag\" value=\"admin.php?id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=3&id_lista=\">";
|
---|
425 | echo "<select id=\"id_lista\" name=\"id_lista\" onChange=\"vai_lista();\">";
|
---|
426 | if ($id_lista){
|
---|
427 | echo "<option value=\"0\">"._VOTI_LISTA;
|
---|
428 | $ele_lista=" and t1.id_lista='$id_lista' ";
|
---|
429 | }else{
|
---|
430 | echo "<option value=\"0\" selected>"._VOTI_LISTA;
|
---|
431 | $ele_lista=" group by t1.id_lista ";
|
---|
432 | if(!isset($votolista)) $votolista=0;
|
---|
433 |
|
---|
434 | }
|
---|
435 | while(list($id_rif,$descrizione,$num_lis) = $res_lis->fetch(PDO::FETCH_NUM)) {
|
---|
436 | $segna='';
|
---|
437 | $sql="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";
|
---|
438 | $result = $dbi->prepare("$sql");
|
---|
439 | $result->execute();
|
---|
440 |
|
---|
441 |
|
---|
442 | list($ctrvoticand)=$result->fetch(PDO::FETCH_NUM);
|
---|
443 | $sql="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";
|
---|
444 | $result = $dbi->prepare("$sql");
|
---|
445 | $result->execute();
|
---|
446 |
|
---|
447 |
|
---|
448 | list($votisezcand)=$result->fetch(PDO::FETCH_NUM);
|
---|
449 | if((($fascia>$limite or $disgiunto) or !$id_conf) or $genere==4){
|
---|
450 | $sql="SELECT voti,solo_lista from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_rif'";
|
---|
451 | $result = $dbi->prepare("$sql");
|
---|
452 | $result->execute();
|
---|
453 | }else{
|
---|
454 | $sql="SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_rif'";
|
---|
455 | $result = $dbi->prepare("$sql");
|
---|
456 | $result->execute();
|
---|
457 | list($id_gruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
458 | $sql="SELECT sum(voti),0 from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
459 | $result = $dbi->prepare("$sql");
|
---|
460 | $result->execute();
|
---|
461 | }
|
---|
462 | list($votisezlis,$sgpl)=$result->fetch(PDO::FETCH_NUM);
|
---|
463 | if($votisezcand>($votisezlis*$numprefs))
|
---|
464 | {$segna="style=\"background-color: #dd0000;\"";}
|
---|
465 | elseif($ctrvoticand)
|
---|
466 | $segna="style=\"background-color: #99CC33;\"";
|
---|
467 | $sql="SELECT t1.voti,t2.num_cand FROM ".$prefix."_ele_voti_candidati as t1 left join ".$prefix."_ele_candidati as t2 on t1.id_cand=t2.id_cand where t1.id_cons='$id_cons' and t1.id_sez='$id_sez' and t2.id_lista='$id_rif'";
|
---|
468 | $res4 = $dbi->prepare("$sql");
|
---|
469 | $res4->execute();
|
---|
470 |
|
---|
471 |
|
---|
472 | $errcand[$id_rif]=array();
|
---|
473 | while(list($testvotic,$numcand)=$res4->fetch(PDO::FETCH_NUM))
|
---|
474 | if($votisezlis<$testvotic) { $segna="style=\"background-color: #dd0000;\"";$errcand[$id_rif][]=$numcand;}
|
---|
475 |
|
---|
476 | $sel = ($id_rif == $id_lista) ? "selected" : "";
|
---|
477 | echo "<option $segna value=\"$id_rif\" $sel>";
|
---|
478 | for ($j=strlen($num_lis);$j<2;$j++) { echo " ";}
|
---|
479 | echo $num_lis.") ".substr($descrizione,0,30);
|
---|
480 | }
|
---|
481 | echo "</select></form></td></tr><tr><td style=\"vertical-align: top;\"> </td>\n";
|
---|
482 | }else {
|
---|
483 | $id_lista=0;
|
---|
484 | }
|
---|
485 | echo "<td style=\"vertical-align: top;\">";
|
---|
486 |
|
---|
487 | if ((!$id_lista)){$tab="_ele_voti_lista";} else {$tab="_ele_voti_candidati";}
|
---|
488 | if(($genere==4 or ($genere==5 and $votog)) and !$id_lista) {
|
---|
489 | $sql="SELECT sum(t1.voti),t2.validi, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli,t2.bianchi,t2.nulli,t2.contestati,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";
|
---|
490 | $result = $dbi->prepare("$sql");
|
---|
491 | $result->execute();
|
---|
492 |
|
---|
493 |
|
---|
494 | }else{
|
---|
495 | $sql="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,t2.solo_gruppo,t1.id_sez 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,t2.validi_lista, t2.solo_gruppo,t2.contestati_lista,t2.voti_nulli_lista,t2.bianchi,t2.nulli,t2.contestati,t2.voti_nulli,t2.solo_gruppo";
|
---|
496 | $result = $dbi->prepare("$sql");
|
---|
497 | $result->execute();
|
---|
498 | }
|
---|
499 |
|
---|
500 | // aggiunte le variabili $sgpl e $vnulli2 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
|
---|
501 | $isscr= $result->rowCount();
|
---|
502 | list( $voti_sez, $validi2, $sg,$cont2,$vnulli2,$bia2,$nul2,$con2,$vnul2,$sgpl) = $result->fetch(PDO::FETCH_NUM);
|
---|
503 | if(($genere==5 and !$disgiunto and $voti_sez and $flagsg and ($tipo_cons==18 or $tipo_cons==19))){
|
---|
504 | $sql="SELECT sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_cons=$id_cons and id_sez=$id_sez";
|
---|
505 | $resg = $dbi->prepare("$sql");
|
---|
506 | $resg->execute();
|
---|
507 |
|
---|
508 |
|
---|
509 | list($sgpl)=$resg->fetch(PDO::FETCH_NUM);
|
---|
510 | if ($sg != $sgpl) echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_UNI." ".$sgpl." "._ATT_TOT_UNI." ".$sg."</b><br></td></table>";
|
---|
511 | }
|
---|
512 | $valista=$validi2;
|
---|
513 | if(!$id_lista or $genere==3){ //controllo di congruenza
|
---|
514 | $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez'";
|
---|
515 | $res2 = $dbi->prepare("$sql");
|
---|
516 | $res2->execute();
|
---|
517 |
|
---|
518 |
|
---|
519 | list($tot) = $res2->fetch(PDO::FETCH_NUM);
|
---|
520 | ####### controlli
|
---|
521 | $sql="select * from ".$prefix."_ele_controlli where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
522 | $resc = $dbi->prepare("$sql");
|
---|
523 | $resc->execute();
|
---|
524 | if($resc->rowCount()){ if ($validi2+$vnulli2+$cont2+$sg+$bia2+$nul2+$con2+$vnul2!=$tot and $validi+$sg>0){
|
---|
525 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi2+$vnulli2+$cont2+$sg+$bia2+$nul2+$con2+$vnul2)."</b><br></td></table>";
|
---|
526 | }
|
---|
527 |
|
---|
528 | if((($voti_sez)!=$validi2) and ($voti_sez>0)){
|
---|
529 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".($voti_sez)." "._NO_VAL_VOTI." ".$validi2."</b><br></td></tr></table>";
|
---|
530 | }
|
---|
531 | }elseif($genere==5){
|
---|
532 | $sql="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_lista'";
|
---|
533 | $result = $dbi->prepare("$sql");
|
---|
534 | $result->execute();
|
---|
535 |
|
---|
536 |
|
---|
537 | list($votisezcand)=$result->fetch(PDO::FETCH_NUM);
|
---|
538 | if(($fascia>$limite or $disgiunto) or !$id_conf){
|
---|
539 | $sql="SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista='$id_lista'";
|
---|
540 | $result = $dbi->prepare("$sql");
|
---|
541 | $result->execute();
|
---|
542 |
|
---|
543 |
|
---|
544 | }else{
|
---|
545 |
|
---|
546 | $sql="SELECT id_gruppo from ".$prefix."_ele_lista where id_lista='$id_lista'";
|
---|
547 | $result = $dbi->prepare("$sql");
|
---|
548 | $result->execute();
|
---|
549 |
|
---|
550 |
|
---|
551 | list($id_gruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
552 | $sql="SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
553 | $result = $dbi->prepare("$sql");
|
---|
554 | $result->execute();
|
---|
555 |
|
---|
556 |
|
---|
557 | }
|
---|
558 | list($votisezlis)=$result->fetch(PDO::FETCH_NUM);
|
---|
559 | if($votisezcand>($votisezlis*$numprefs))
|
---|
560 | {
|
---|
561 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti di preferenza $votisezcand <br/>superano i voti di lista $votisezlis</b><br></td></tr></table>";
|
---|
562 | }
|
---|
563 | }
|
---|
564 | #controllo voti a liste collegate <= voto di gruppo per voto non disgiunto
|
---|
565 | $errgrulis=array();
|
---|
566 | if($genere==5 and !$disgiunto and ($tipo_cons==18 or $tipo_cons==19)){
|
---|
567 | $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo";
|
---|
568 | $resref = $dbi->prepare("$sql");
|
---|
569 | $resref->execute();
|
---|
570 |
|
---|
571 |
|
---|
572 | $sql="SELECT count(0) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez'";
|
---|
573 | $res4 = $dbi->prepare("$sql");
|
---|
574 | $res4->execute();
|
---|
575 |
|
---|
576 |
|
---|
577 | list($sezscrl)=$res4->fetch(PDO::FETCH_NUM);
|
---|
578 | if ($sezscrl)
|
---|
579 |
|
---|
580 | while ( list($id_gruppo)=$resref->fetch(PDO::FETCH_NUM))
|
---|
581 | {
|
---|
582 | $sql="SELECT sum(voti-solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
583 | $res3 = $dbi->prepare("$sql");
|
---|
584 | $res3->execute();
|
---|
585 |
|
---|
586 |
|
---|
587 | $sql="SELECT sum(voti+nulli_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";
|
---|
588 | $res4 = $dbi->prepare("$sql");
|
---|
589 | $res4->execute();
|
---|
590 |
|
---|
591 |
|
---|
592 | list($vgruppo)=$res3->fetch(PDO::FETCH_NUM);
|
---|
593 | list($vliste)=$res4->fetch(PDO::FETCH_NUM);
|
---|
594 | if($vliste>$vgruppo)
|
---|
595 | {
|
---|
596 | $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
597 | $result = $dbi->prepare("$sql");
|
---|
598 | $result->execute();
|
---|
599 |
|
---|
600 |
|
---|
601 | list($dgruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
602 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti delle liste collegate<br/> superano i voti assegnati al gruppo $dgruppo </b><br></td></tr></table>";
|
---|
603 | $errgrulis[$id_gruppo]=1;
|
---|
604 | }
|
---|
605 | elseif($vliste<$vgruppo)
|
---|
606 | {
|
---|
607 | $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
608 | $result = $dbi->prepare("$sql");
|
---|
609 | $result->execute();
|
---|
610 |
|
---|
611 |
|
---|
612 | list($dgruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
613 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti assegnati al gruppo $dgruppo<br/> superano i voti delle liste collegate </b><br></td></tr></table>";
|
---|
614 | $errgrulis[$id_gruppo]=1;
|
---|
615 | }
|
---|
616 | }
|
---|
617 | }
|
---|
618 | }
|
---|
619 |
|
---|
620 |
|
---|
621 | echo "\n<form name=\"sezioni\" data-ajax=\"false\" action=\"modules/Elezioni/salva_liste.php\">"
|
---|
622 | ."<input type=\"hidden\" name=\"op\" value=\"rec_voti\">"
|
---|
623 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
624 | ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
|
---|
625 | ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"
|
---|
626 | ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
|
---|
627 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
|
---|
628 | ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
|
---|
629 | ."<input type=\"hidden\" name=\"tabella\" value=\"$tab\">"
|
---|
630 | ."<input type=\"hidden\" name=\"id_lista\" value=\"$id_lista\">\n"
|
---|
631 | ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">\n";
|
---|
632 | echo "<table class=\"table-menu\" style=\"width: 90%; color: black\">";
|
---|
633 | echo "<tr><td bgcolor=\"$bgcolor1\" align=\"left\" width=\"32\">";
|
---|
634 | if ($genere<4){
|
---|
635 | // echo "<td bgcolor=\"$bgcolor1\" align=\"center\" width=\"32\"><b>"._LISTA."</b></td>";
|
---|
636 | }
|
---|
637 | echo "<b>"._NUM."</b></td>";
|
---|
638 | if($id_lista){
|
---|
639 | echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._CANDIDATO."</b></td>"
|
---|
640 | ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>";
|
---|
641 | }else{
|
---|
642 | echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>"
|
---|
643 | ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>";
|
---|
644 | #funzione di inserimento del dettaglio di voti nulli sospesa, non ritenuta utile
|
---|
645 | # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)
|
---|
646 | # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";
|
---|
647 | if($disgiunto){
|
---|
648 | echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLOLIS."</b></td>";
|
---|
649 | }
|
---|
650 | }
|
---|
651 | echo "</tr>\n";
|
---|
652 |
|
---|
653 |
|
---|
654 | if($id_lista) $sql="select t1.* from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $ele_lista $circo ORDER BY t2.num_lista,t1.num_cand";
|
---|
655 | else $sql="select 0,'$id_cons',t1.id_lista,'','','','','',0 from ".$prefix."_ele_candidati as t1 left join ".$prefix."_ele_lista as t2 on (t1.id_lista=t2.id_lista) WHERE t1.id_cons=$id_cons and t1.id_cons=t2.id_cons $ele_lista $circo ORDER BY t2.num_lista";
|
---|
656 | $result = $dbi->prepare("$sql");
|
---|
657 | $result->execute();
|
---|
658 |
|
---|
659 |
|
---|
660 | $max = $result->rowCount();
|
---|
661 | $tot_pref=0;
|
---|
662 | $i=1;
|
---|
663 |
|
---|
664 | if($id_lista) {
|
---|
665 | while(list($id_cand,$id_cons2,$id_lista2,$nl, $cognome, $nome, $note, $simbolo, $num_cand) = $result->fetch(PDO::FETCH_NUM)){
|
---|
666 | // dati lista
|
---|
667 | $sql="select id_lista, descrizione,simbolo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista2'";
|
---|
668 | $result1 = $dbi->prepare("$sql");
|
---|
669 | $result1->execute();
|
---|
670 |
|
---|
671 |
|
---|
672 | list($id_lista3,$descr_lista,$simb_lista,$num_lista)=$result1->fetch(PDO::FETCH_NUM);
|
---|
673 | // dati gruppo
|
---|
674 | $sql="select descrizione,simbolo from ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
675 | $result2 = $dbi->prepare("$sql");
|
---|
676 | $result2->execute();
|
---|
677 |
|
---|
678 |
|
---|
679 | list($descr_gruppo,$simb_gruppo)=$result2->fetch(PDO::FETCH_NUM);
|
---|
680 |
|
---|
681 | echo "<tr bgcolor=\"$bgcolor2\">";
|
---|
682 | if ($genere<4){
|
---|
683 | echo "<td align=\"left\"><b><img src=\"images/lista/$simb_lista \" width=\"32\" heigth=\"32\" align=\"center\" ALT=\"$descr_lista\" > </b></td>";
|
---|
684 | }
|
---|
685 | echo "<td align=\"center\"><b> $num_cand </b></td>"
|
---|
686 | ."<td align=\"left\"><b>$cognome $nome</b></td>";
|
---|
687 | $cond_sele="and id_cand=$id_cand";
|
---|
688 | $sql="SELECT voti FROM ".$prefix."$tab where id_cons='$id_cons' and id_sez='$id_sez' $cond_sele";
|
---|
689 | $res = $dbi->prepare("$sql");
|
---|
690 | $res->execute();
|
---|
691 |
|
---|
692 |
|
---|
693 | list($voti)= $res->fetch(PDO::FETCH_NUM);
|
---|
694 | if(in_array($num_cand,$errcand[$id_lista])) $errcolor="style=\"background-color: rgb(255, 0, 0);\""; else $errcolor='';
|
---|
695 | echo "<td align=\"right\" $errcolor><input name=\"voti$num_cand\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">";
|
---|
696 | echo "<input type=\"hidden\" name=\"id_cand$num_cand\" value=\"$id_cand\"></td></tr>\n";
|
---|
697 | $i++;
|
---|
698 | $tot_pref+=$voti;
|
---|
699 | }
|
---|
700 | }else {
|
---|
701 | if($circo) $circot1=" and t1.id_circ=$id_circ"; else $circot1='';
|
---|
702 | $sql="select t2.voti,t1.id_lista, descrizione,simbolo,t1.num_lista,t2.nulli_lista,t2.solo_lista,t1.id_gruppo
|
---|
703 | from ".$prefix."_ele_lista as t1, ".$prefix."_ele_voti_lista as t2
|
---|
704 | where t1.id_cons='$id_cons'
|
---|
705 | and t1.id_lista=t2.id_lista
|
---|
706 | and t2.id_sez=$id_sez
|
---|
707 | $circot1
|
---|
708 | order by t1.num_lista";
|
---|
709 |
|
---|
710 | try {
|
---|
711 | $result1 = $dbi->prepare("$sql");
|
---|
712 | $result1->execute();
|
---|
713 |
|
---|
714 | }
|
---|
715 | catch(PDOException $e)
|
---|
716 | {
|
---|
717 | echo $sql . "<br>" . $e->getMessage();
|
---|
718 | }
|
---|
719 |
|
---|
720 | $num_lista=$result1->rowCount();
|
---|
721 | if (!$num_lista){
|
---|
722 | $sql="select '0',id_lista, descrizione,simbolo,num_lista,'','',id_gruppo
|
---|
723 | from ".$prefix."_ele_lista where id_cons='$id_cons' $circo
|
---|
724 | order by num_lista";
|
---|
725 | $result1 = $dbi->prepare("$sql");
|
---|
726 | $result1->execute();
|
---|
727 | }
|
---|
728 | $tvnpl=0;
|
---|
729 | $tslpl=0;
|
---|
730 | while (list($voti,$id_lista3,$descr_lista,$simb_lista,$num_lista,$vnpl,$slpl,$rifgruppo)=$result1->fetch(PDO::FETCH_NUM)){
|
---|
731 | echo "<tr bgcolor=\"$bgcolor2\">";
|
---|
732 | // if ($genere<4 or $votoc){
|
---|
733 | // }
|
---|
734 | $sql="select t1.* from ".$prefix."_ele_voti_candidati as t1, ".$prefix."_ele_candidati as t2 where t1.id_cand=t2.id_cand and t1.id_sez='$id_sez' and t2.id_lista='$id_lista3' limit 0,1";
|
---|
735 | $rese = $dbi->prepare("$sql");
|
---|
736 | $rese->execute();
|
---|
737 | if($rese->rowCount()) $segna="style=\"background-color: #99CC33;\""; else $segna='';
|
---|
738 | $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' and id='$id_lista3'";
|
---|
739 | $rese = $dbi->prepare("$sql");
|
---|
740 | $rese->execute();
|
---|
741 | if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\"";
|
---|
742 | list($sezcol)=$rese->fetch(PDO::FETCH_NUM);
|
---|
743 | $errcolor='';
|
---|
744 | if(isset($errgrulis[$rifgruppo])) $errcolor="style=\"background-color: rgb(255, 0, 0);\"";
|
---|
745 | echo "<td align=\"center\" $segna><b> $num_lista </b></td>"
|
---|
746 | ."<td align=\"left\"><b> $descr_lista</b></td>";
|
---|
747 | $cond_sele="and id_lista=$id_lista3";
|
---|
748 | echo "<td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">";
|
---|
749 | #funzione non ritenuta utile
|
---|
750 | # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) { echo "</td><td align=\"right\"><input name=\"vnpl$i\" value=\"".$vnpl."\" size=\"7\" style=\"text-align:right\">"; $tvnpl+=$vnpl;}
|
---|
751 | if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+=intval($slpl);}
|
---|
752 | echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>";
|
---|
753 | // echo "<td align=\"right\">$sgpl";
|
---|
754 | echo "</tr>\n";
|
---|
755 | $i++;
|
---|
756 | $tot_pref+=$voti;
|
---|
757 | }
|
---|
758 | }
|
---|
759 | if(!$id_lista) {
|
---|
760 | echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><font size=\"3\">"._TOT._VOTI_LISTA."</font></td><td align=\"center\"><font size=\"3\">$tot_pref</font></td>";
|
---|
761 | # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)
|
---|
762 | # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";
|
---|
763 | if($disgiunto)
|
---|
764 | echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tslpl."</font></td>";
|
---|
765 | echo "</tr>";
|
---|
766 | }
|
---|
767 | else echo "<tr bgcolor=\"$bgcolor1\"><td></td><td>"._TOTPREF."</td><td align=\"center\">$tot_pref</td></tr>";
|
---|
768 | // toglie ai candidati la visual... del solo_gruppo
|
---|
769 | if(!$votog) {
|
---|
770 | if (($genere==3 OR $genere==5) and (!$id_lista) and (($disgiunto or $fascia>$limite) or !$id_conf)) { //gruppo e liste
|
---|
771 | echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._VALIDI_LISTA."</b></td><td align=\"center\"><input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\"><input name=\"valista\" value=\"$valista\" size=\"5\" style=\"text-align:right\"></td></tr>";
|
---|
772 | echo "<tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\"><input name=\"sg\" value=\"$sg\" size=\"5\" style=\"text-align:right\">";
|
---|
773 | if(defined('_NULLISTA'))
|
---|
774 | echo "<input type=\"hidden\" name=\"votinulli\" value=\"$votinulli\"><input type=\"hidden\" name=\"contestati\" value=\"$contestati\"></td></tr>";
|
---|
775 | else
|
---|
776 | echo "</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._NULLI_LISTE."</b></td><td align=\"center\"><input name=\"votinulli\" value=\"$votinulli\" size=\"5\" style=\"text-align:right\">"
|
---|
777 | ."</td></tr><tr bgcolor=\"$bgcolor2\"><td></td><td><b>"._CONTESTATI_LISTE."</b></td><td align=\"center\"><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\"></td></tr>";
|
---|
778 |
|
---|
779 | }elseif (($genere==3 OR $genere==5) and !$votoc and (($disgiunto or $fascia>$limite) or !$id_conf)){ //}elseif ($tipo_cons!=10 and $tipo_cons!=11){
|
---|
780 | echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\">$sg</td></tr>";
|
---|
781 | }
|
---|
782 | ######modifica del 16-04-2009 per visualizzare i voti al solo sindaco nei comuni con meno di 15000 abitanti
|
---|
783 | elseif(($genere==3 OR $genere==5) and ($id_lista) and ($fascia<=$limite or !$id_conf) and $numprefs==1) {
|
---|
784 | $sql="SELECT id_gruppo FROM ".$prefix."_ele_lista where id_lista='$id_lista'";
|
---|
785 | $resvg = $dbi->prepare("$sql");
|
---|
786 | $resvg->execute();
|
---|
787 |
|
---|
788 |
|
---|
789 | list($id_gruppo) = $resvg->fetch(PDO::FETCH_NUM);
|
---|
790 | $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_gruppo='$id_gruppo' and id_sez='$id_sez'";
|
---|
791 | $resvg = $dbi->prepare("$sql");
|
---|
792 | $resvg->execute();
|
---|
793 |
|
---|
794 |
|
---|
795 | list($voti_sind) = $resvg->fetch(PDO::FETCH_NUM);
|
---|
796 |
|
---|
797 | echo "<tr bgcolor=\"$bgcolor1\"><td></td><td><b>"._SOLO_GRUPPO."</b></td><td align=\"center\">".($voti_sind - $tot_pref)."</td></tr>";
|
---|
798 | }
|
---|
799 | ###### fine modifica del 16-04-2009
|
---|
800 |
|
---|
801 | }
|
---|
802 | echo "<tr>";
|
---|
803 | echo "<td></td><td></td>";
|
---|
804 | echo "<td align=\"center\"><input type=\"submit\" id=\"update\" name=\"update\" value=\""._OK."\"></td>";
|
---|
805 | echo "</tr></table>";
|
---|
806 | if(chisei($id_cons_gen)>=64){
|
---|
807 | echo "<td></td><td> <input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"1\">"._DELETE."</td>";
|
---|
808 | } # onclick=\"javascript:del_dati()\"
|
---|
809 | echo "</form></tr></table>";
|
---|
810 |
|
---|
811 |
|
---|
812 |
|
---|
813 | }
|
---|
814 | #if (!((!$votog) and ($genere==3 OR $genere==5) and ($fascia>$limite)))
|
---|
815 | finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
816 | }
|
---|
817 |
|
---|
818 |
|
---|
819 | function finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
|
---|
820 | global $aid, $prefix, $dbi,$id_cons_gen,$genere,$votog,$fascia,$limite;
|
---|
821 | ////////////////////////////////////////////
|
---|
822 | // da qua va la sezione per i voti finali
|
---|
823 | ///////////////////////////////////////////
|
---|
824 | $bgcolor1="#7777ff";
|
---|
825 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
826 |
|
---|
827 |
|
---|
828 |
|
---|
829 | echo "<form name=\"spogliovoti\" data-ajax=\"false\" action=\"modules/Elezioni/salva_voti.php\">"
|
---|
830 | ."<input type=\"hidden\" name=\"op\" value=\"rec_finale\">";
|
---|
831 | echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
832 | ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
|
---|
833 | ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
|
---|
834 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
|
---|
835 | ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">";
|
---|
836 |
|
---|
837 | echo "<table border=\"0\" width=\"100%\" align=\"center\"><tr bgcolor=\"$bgcolor1\" align=\"center\">";
|
---|
838 | /* if($ops==3 and ($genere==3 or ($genere==5 and $fascia>$limite)) )
|
---|
839 | echo "<td width=\"32\"><b>"._VOTI_LISTA."</b></td>";
|
---|
840 | else */
|
---|
841 | echo "<td width=\"15%\"><b>"._VALIDI."</b></td>";
|
---|
842 | echo "<td width=\"82\"><b>"._NULLI."</b></td>"
|
---|
843 | ."<td><b>"._BIANCHI."</b></td>"
|
---|
844 | ."<td width=\"82\"><b>"._VOTINULLI."</b></td>"
|
---|
845 | ."<td><b>"._CONTESTATI."</b></td>"
|
---|
846 | ."<td><b>"._TOTNON."</b></td>"
|
---|
847 | ."<td><b>"._TOTALEVOTI."</b></td>"
|
---|
848 | ."<td bgcolor=\"#ffffff\"></td> </tr>";
|
---|
849 | /*if($ops==3 and ($genere==3 or ($genere==5 and $fascia>$limite)) )
|
---|
850 | $result = mysql_query("select id_cons,id_sez,validi_lista,nulli,bianchi,contestati_lista,voti_nulli_lista,solo_gruppo,contestati,voti_nulli from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
851 | $res = $dbi->prepare("$sql");
|
---|
852 | $res->execute();
|
---|
853 |
|
---|
854 |
|
---|
855 | else */
|
---|
856 | $sql = "select id_cons,id_sez,validi,nulli,bianchi,contestati,voti_nulli,'0','0','0',solo_lista from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
857 | $result = $dbi->prepare("$sql");
|
---|
858 | $result->execute();
|
---|
859 |
|
---|
860 |
|
---|
861 | list($id_cons2,$id_sez2,$validi, $nulli, $bianchi, $contestati,$votinulli,$sg,$conts,$nullis,$sololista) = $result->fetch(PDO::FETCH_NUM);
|
---|
862 | $tot_nulli=$nulli+$bianchi+$contestati+$votinulli;
|
---|
863 | $tot_voti=$validi+$tot_nulli+$conts+$nullis;
|
---|
864 | // ."</td><td><input name=\"sololista\" value=\"$sololista\" size=\"5\" style=\"text-align:right\">" --- ."<td><b>"._SOLOLIS."</b></td>"
|
---|
865 |
|
---|
866 |
|
---|
867 | echo "<tr bgcolor=\"$bgcolor2\" align=\"center\"><td align=\"left\"><input name=\"validi\" value=\"$validi\" size=\"7\" style=\"text-align:right\">";
|
---|
868 | /* if(($genere==3 or $genere==5) and !$votog and $ops==3){
|
---|
869 | echo "</td><td>$nulli"
|
---|
870 | ."</td><td>$bianchi";
|
---|
871 | echo "<input type=\"hidden\" name=\"nulli\" value=\"$nulli\"><input type=\"hidden\" name=\"bianchi\" value=\"$bianchi\">";
|
---|
872 | }else{ */
|
---|
873 | echo "</td><td><input name=\"nulli\" value=\"$nulli\" size=\"5\" style=\"text-align:right\">"
|
---|
874 | ."</td><td><input name=\"bianchi\" value=\"$bianchi\" size=\"5\" style=\"text-align:right\">";
|
---|
875 | // }
|
---|
876 | echo "</td><td><input name=\"votinulli\" value=\"$votinulli\" style=\"text-align:right;\">"
|
---|
877 | ."</td><td><input name=\"contestati\" value=\"$contestati\" size=\"5\" style=\"text-align:right\">"
|
---|
878 | ."</td><td>$tot_nulli"
|
---|
879 | ."</td><td>$tot_voti</td><td>"
|
---|
880 | ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"
|
---|
881 | ."<input type=\"hidden\" name=\"ops\" value=\"$ops\">"
|
---|
882 | ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"
|
---|
883 | ."</td></tr></table></form>"; //</td></tr>";
|
---|
884 |
|
---|
885 |
|
---|
886 | // echo "</table>";
|
---|
887 | /* echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n";
|
---|
888 | if (!$validi) {
|
---|
889 | echo "document.spogliovoti.validi.focus()\n";
|
---|
890 | echo "document.spogliovoti.validi.select()\n";
|
---|
891 | }
|
---|
892 | echo "//-->\n"
|
---|
893 | ."</script>\n"; */
|
---|
894 |
|
---|
895 |
|
---|
896 | }
|
---|
897 |
|
---|
898 |
|
---|
899 | function preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops){
|
---|
900 | global $aid, $prefix, $dbi, $tipo_cons, $genere,$id_cons_gen,$sezi,$circo,$dettnulli;
|
---|
901 | ////////////////////////////////////////////
|
---|
902 | // da qua va la sezione per le preferenze ai gruppi
|
---|
903 | ///////////////////////////////////////////
|
---|
904 | // Controllo immmissioni
|
---|
905 |
|
---|
906 | $bgcolor1="#7777ff";
|
---|
907 | $bgcolor2=$_SESSION['bgcolor2'];
|
---|
908 | $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ";
|
---|
909 | $res = $dbi->prepare("$sql");
|
---|
910 | $res->execute();
|
---|
911 |
|
---|
912 |
|
---|
913 | $max = $res->rowCount();
|
---|
914 | $max = $max-1;
|
---|
915 | /* echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n";
|
---|
916 | if ($genere==0) {
|
---|
917 | echo "document.sezioni.si1.focus()\n";
|
---|
918 | echo "document.sezioni.si1.select()\n";
|
---|
919 | } else {
|
---|
920 | echo "document.sezioni.voti1.focus()\n"
|
---|
921 | ."document.sezioni.voti1.select()\n";
|
---|
922 | }
|
---|
923 | echo "//-->\n"
|
---|
924 | ."</script>\n"; */
|
---|
925 | // tabella votanti
|
---|
926 | echo "<center>";
|
---|
927 | if ($genere!=0){
|
---|
928 | $sql="SELECT voti_uomini,voti_donne, voti_complessivi FROM ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and id_cons='$id_cons' order by data desc,orario desc limit 0,1";
|
---|
929 | $result = $dbi->prepare("$sql");
|
---|
930 | $result->execute();
|
---|
931 |
|
---|
932 |
|
---|
933 | list( $voti_u, $voti_d, $voti_t) = $result->fetch(PDO::FETCH_NUM);
|
---|
934 | echo "<table class=\"table-menu\" style=\"width: 50%; color: black;\">"
|
---|
935 | ."<tr><td></td><td align=\"center\"></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIU."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTID."</td><td bgcolor=\"$bgcolor1\" align=\"center\">"._VOTIT."</td></tr>"
|
---|
936 | ."<tr><td></td><td bgcolor=\"$bgcolor1\" align=\"center\">"._TOT_ULT."</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_u</td><td align=\"center\" bgcolor=\"$bgcolor2\">$voti_d</td><td bgcolor=\"$bgcolor2\" align=\"center\">$voti_t</td></tr>";
|
---|
937 | echo "</table>";
|
---|
938 | }
|
---|
939 | echo "<table class=\"table-menu\" style=\"width: 50%; color: black\">";
|
---|
940 | if ($genere==0){
|
---|
941 | $sql="SELECT id_gruppo,si+no,validi,nulli,bianchi,contestati FROM ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez='$id_sez' ";
|
---|
942 | $res = $dbi->prepare("$sql");
|
---|
943 | $res->execute();
|
---|
944 |
|
---|
945 |
|
---|
946 | while (list($id_gruppo,$voti_parz,$validi,$nulli,$bianchi,$contestati) = $res->fetch(PDO::FETCH_NUM)){
|
---|
947 | if ($voti_parz!=$validi){
|
---|
948 | $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' and id_gruppo='$id_gruppo' ";
|
---|
949 | $res2 = $dbi->prepare("$sql");
|
---|
950 | $res2->execute();
|
---|
951 |
|
---|
952 |
|
---|
953 | list($num_gruppo) = $res2->fetch(PDO::FETCH_NUM);
|
---|
954 | echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI_REF." $num_gruppo: ".$voti_parz." "._NO_VAL_VOTI.": ".$validi."</b><br></td></tr>";
|
---|
955 | }
|
---|
956 | $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";
|
---|
957 | $res2 = $dbi->prepare("$sql");
|
---|
958 | $res2->execute();
|
---|
959 |
|
---|
960 |
|
---|
961 | list($tot) = $res2->fetch(PDO::FETCH_NUM);
|
---|
962 | if (($validi+$nulli+$bianchi+$contestati)!= $tot ){
|
---|
963 | $sql="SELECT num_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' and id_gruppo='$id_gruppo'";
|
---|
964 | $res2 = $dbi->prepare("$sql");
|
---|
965 | $res2->execute();
|
---|
966 |
|
---|
967 |
|
---|
968 | list($num_gruppo) = $res2->fetch(PDO::FETCH_NUM);
|
---|
969 | echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI_REF." $num_gruppo: ".$tot." "._NO_SOMMA." ".($validi+$nulli+$bianchi+$contestati)."</b><br></td></tr>";
|
---|
970 | }
|
---|
971 | }
|
---|
972 | }else{
|
---|
973 | $sql="select solo_gruppo,disgiunto from ".$prefix."_ele_cons_comune where id_cons='$id_cons' ";
|
---|
974 | $result = $dbi->prepare("$sql");
|
---|
975 | $result->execute();
|
---|
976 | list($flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM);
|
---|
977 | $dettnulli=$flagsg;
|
---|
978 | $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez'";
|
---|
979 | $res = $dbi->prepare("$sql");
|
---|
980 | $res->execute();
|
---|
981 | list($voti_parz) = $res->fetch(PDO::FETCH_NUM);
|
---|
982 | $sql="SELECT validi,nulli,bianchi,contestati,solo_lista,voti_nulli FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";
|
---|
983 | $res = $dbi->prepare("$sql");
|
---|
984 | $res->execute();
|
---|
985 | list($validi,$nulli,$bianchi,$contestati,$solo_lista,$votinulli) = $res->fetch(PDO::FETCH_NUM);
|
---|
986 | if ($voti_parz!=($validi-$solo_lista) and $voti_parz>0){
|
---|
987 | echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTI." ".$voti_parz." "._NO_VAL_VOTI." ".($validi-$solo_lista)."</b><br></td><tr>";
|
---|
988 | }
|
---|
989 | $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez'";
|
---|
990 | $res2 = $dbi->prepare("$sql");
|
---|
991 | $res2->execute();
|
---|
992 |
|
---|
993 |
|
---|
994 | list($tot) = $res2->fetch(PDO::FETCH_NUM);
|
---|
995 | if ($validi+$nulli+$bianchi+$contestati+$votinulli!=$tot and $validi+$nulli+$bianchi+$contestati+$votinulli>0){
|
---|
996 | echo "<tr><td style=\"background-color: rgb(255, 0, 0); text-align:center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_VOTANTI." ".$tot." "._NO_TOT_VOTI." ".($validi+$nulli+$bianchi+$contestati+$votinulli)."</b><br></td></tr>";
|
---|
997 | }
|
---|
998 | $sql="SELECT sum(voti) from ".$prefix."_ele_voti_lista where id_cons=$id_cons and id_sez=$id_sez";
|
---|
999 | $resg = $dbi->prepare("$sql");
|
---|
1000 | $resg->execute();
|
---|
1001 |
|
---|
1002 |
|
---|
1003 | list($voti_sez)=$resg->fetch(PDO::FETCH_NUM);
|
---|
1004 | if(($genere==5 and !$disgiunto and $voti_sez and $flagsg and ($tipo_cons==18 or $tipo_cons==19))){
|
---|
1005 |
|
---|
1006 | $sql="SELECT sum(solo_gruppo) from ".$prefix."_ele_voti_gruppo where id_cons=$id_cons and id_sez=$id_sez";
|
---|
1007 | $resg = $dbi->prepare("$sql");
|
---|
1008 | $resg->execute();
|
---|
1009 |
|
---|
1010 |
|
---|
1011 | list($sgpl)=$resg->fetch(PDO::FETCH_NUM);
|
---|
1012 | $sql="SELECT solo_gruppo from ".$prefix."_ele_sezioni where id_cons=$id_cons and id_sez=$id_sez";
|
---|
1013 | $resg = $dbi->prepare("$sql");
|
---|
1014 | $resg->execute();
|
---|
1015 |
|
---|
1016 |
|
---|
1017 | list($sg)=$resg->fetch(PDO::FETCH_NUM);
|
---|
1018 | if ($sg != $sgpl) echo "<tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br><b> "._ATT_UNI." ".$sgpl." "._ATT_TOT_UNI." ".$sg."</b><br></td></tr>";
|
---|
1019 | }
|
---|
1020 | #controllo voti a liste collegate <= voto di gruppo per voto non disgiunto
|
---|
1021 | if($genere==5 and !$disgiunto and $flagsg and ($tipo_cons==18 or $tipo_cons==19)){
|
---|
1022 | $sql="SELECT id_gruppo FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo";
|
---|
1023 | $resref = $dbi->prepare("$sql");
|
---|
1024 | $resref->execute();
|
---|
1025 |
|
---|
1026 |
|
---|
1027 | $errgrulis=array();
|
---|
1028 | $sql="SELECT count(0) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez'";
|
---|
1029 | $res4 = $dbi->prepare("$sql");
|
---|
1030 | $res4->execute();
|
---|
1031 |
|
---|
1032 |
|
---|
1033 | list($sezscrl)=$res4->fetch(PDO::FETCH_NUM);
|
---|
1034 | if ($sezscrl)
|
---|
1035 | while ( list($id_gruppo)=$resref->fetch(PDO::FETCH_NUM))
|
---|
1036 | {
|
---|
1037 | if($disgiunto || $flagsg){
|
---|
1038 | $sql="SELECT sum(voti-solo_gruppo) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
1039 | $res3 = $dbi->prepare("$sql");
|
---|
1040 | $res3->execute();
|
---|
1041 | if($flagsg){
|
---|
1042 | $sql="SELECT sum(voti+nulli_lista) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";
|
---|
1043 | $res4 = $dbi->prepare("$sql");
|
---|
1044 | $res4->execute();
|
---|
1045 | }else{
|
---|
1046 | $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";
|
---|
1047 | $res4 = $dbi->prepare("$sql");
|
---|
1048 | $res4->execute();
|
---|
1049 | }
|
---|
1050 | }else{
|
---|
1051 | $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_gruppo where id_sez='$id_sez' and id_gruppo='$id_gruppo'";
|
---|
1052 | $res3 = $dbi->prepare("$sql");
|
---|
1053 | $res3->execute();
|
---|
1054 | $sql="SELECT sum(voti) FROM ".$prefix."_ele_voti_lista where id_sez='$id_sez' and id_lista in (select id_lista from ".$prefix."_ele_lista where id_gruppo='$id_gruppo')";
|
---|
1055 | $res4 = $dbi->prepare("$sql");
|
---|
1056 | $res4->execute();
|
---|
1057 | }
|
---|
1058 | list($vgruppo)=$res3->fetch(PDO::FETCH_NUM);
|
---|
1059 | list($vliste)=$res4->fetch(PDO::FETCH_NUM);
|
---|
1060 | if($vliste>$vgruppo and !$disgiunto )
|
---|
1061 | {
|
---|
1062 | $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
1063 | $result = $dbi->prepare("$sql");
|
---|
1064 | $result->execute();
|
---|
1065 | list($dgruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
1066 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti delle liste collegate $vliste<br/> superano i voti assegnati al gruppo $dgruppo $vgruppo</b><br></td></tr></table>";
|
---|
1067 | $errgrulis[$id_gruppo]=1;
|
---|
1068 | }
|
---|
1069 | elseif($vliste<$vgruppo and $disgiunto )
|
---|
1070 | {
|
---|
1071 | $sql="SELECT descrizione FROM ".$prefix."_ele_gruppo where id_gruppo='$id_gruppo'";
|
---|
1072 | $result = $dbi->prepare("$sql");
|
---|
1073 | $result->execute();
|
---|
1074 | list($dgruppo)=$result->fetch(PDO::FETCH_NUM);
|
---|
1075 | echo "<table class=\"table-menu\" style=\"width: 50%;\"><tr><td style=\"background-color: rgb(255, 0, 0); color: black; text-align: center\"><img src=\"modules/Elezioni/images/alert.gif\" align=\"middle\" alt=\"\"><br/><b> ATTENZIONE!<BR/>I voti assegnati al gruppo $dgruppo<br/> superano i voti delle liste collegate </b><br></td></tr></table>";
|
---|
1076 | $errgrulis[$id_gruppo]=1;
|
---|
1077 | }
|
---|
1078 | }
|
---|
1079 | }
|
---|
1080 |
|
---|
1081 | }
|
---|
1082 | if(!isset($votinulli)) $votinulli=0;
|
---|
1083 | echo "<tr><td></td></tr></table>";
|
---|
1084 | if ($validi+$nulli+$bianchi+$contestati+$votinulli>0 or $genere==0) {
|
---|
1085 | if($genere==0) echo "<table class=\"table-menu\" style=\" width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" data-ajax=\"false\" action=\"modules/Elezioni/salva_ref.php\">";
|
---|
1086 | else echo "<table class=\"table-menu\" style=\" width: 60%; color: black\"><tr><td colspan=\"3\"><form name=\"sezioni\" data-ajax=\"false\" action=\"modules/Elezioni/salva_gruppi.php\">";
|
---|
1087 | echo "<input type=\"hidden\" name=\"op\" value=\"rec_voti_gruppiq\">"
|
---|
1088 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
1089 | ."<input type=\"hidden\" name=\"id_cons\" value=\"$id_cons\">"
|
---|
1090 | ."<input type=\"hidden\" name=\"id_sez\" value=\"$id_sez\">"
|
---|
1091 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
|
---|
1092 | ."<input type=\"hidden\" name=\"id_sede\" value=\"$id_sede\">"
|
---|
1093 | ."<input type=\"hidden\" name=\"circo\" value=\"$circo\">"
|
---|
1094 | ."<input type=\"hidden\" name=\"genere\" value=\"$genere\">"
|
---|
1095 | ."<input type=\"hidden\" name=\"do\" id=\"do\" value=\"0\">";
|
---|
1096 |
|
---|
1097 | if ($genere==0){
|
---|
1098 | echo "<br><br> <table class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
|
---|
1099 | ."<td colspan=\"6\"><b>"._GRUPPO."</b></td></tr>";
|
---|
1100 | $campitesta= "<tr align=\"center\" bgcolor=\"$bgcolor1\"><td><b>Votanti "._SI."</b></td>"
|
---|
1101 | ."<td><b>Votanti "._NO."</b></td>"
|
---|
1102 | ."<td><b>"._VALIDI."</b></td>"
|
---|
1103 | ."<td><b>"._BIANCHI."</b></td>"
|
---|
1104 | ."<td><b>"._CONTESTATI."</b></td>"
|
---|
1105 | ."<td><b>"._NULLI."</b></td></tr>";
|
---|
1106 |
|
---|
1107 | $campiriep="<tr style=\"background-color: $bgcolor1; text-align:center\"><td colspan=\"2\"><b>"._TOTNON."</b></td>"
|
---|
1108 | ."<td colspan=\"2\"><b>"._TOTALEVOTI."</b></td>"
|
---|
1109 | ."<td colspan=\"2\"><b>"._VOTANTI."</b></td></tr>";
|
---|
1110 | }else{
|
---|
1111 | echo "<br><br> <table class=\"table-menu\" style=\"width: 100%; color: black\"><tr align=\"center\" bgcolor=\"$bgcolor1\">"
|
---|
1112 | ."<td width=\"3%\"><b>"._NUM."</b></td>"
|
---|
1113 | ."<td width=\"50%\"><b>"._GRUPPO."</b></td>";
|
---|
1114 | echo "<td width=\"5%\"><b>"._VOTI."</b></td>";
|
---|
1115 | if($dettnulli) echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLO_GRUPPO."</b></td>";
|
---|
1116 | echo "</tr>";
|
---|
1117 | }
|
---|
1118 | $sql="SELECT * FROM ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo ";
|
---|
1119 | $res = $dbi->prepare("$sql");
|
---|
1120 | $res->execute();
|
---|
1121 |
|
---|
1122 |
|
---|
1123 | $max = $res->rowCount();
|
---|
1124 | //echo "Massimo:$max - id=$id_cons - circo: $circo";
|
---|
1125 | $sql="select * from ".$prefix."_ele_gruppo where id_cons='$id_cons' $circo ORDER BY num_gruppo ";
|
---|
1126 | $result = $dbi->prepare("$sql");
|
---|
1127 | $result->execute();
|
---|
1128 |
|
---|
1129 |
|
---|
1130 | $i=1;
|
---|
1131 | $tot_pref=0;
|
---|
1132 | $totsg=0;
|
---|
1133 | while(list($id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo) = $result->fetch(PDO::FETCH_NUM)){
|
---|
1134 |
|
---|
1135 | //echo "test: $id_cons2,$id_gruppo,$num_gruppo, $descr_gruppo, $simbolo";
|
---|
1136 | echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
|
---|
1137 |
|
---|
1138 | ."//-->\n";
|
---|
1139 | echo "function controlloref$i() {\n";
|
---|
1140 | echo "var a=Number(window.document.sezioni.si$i.value); var b=Number(window.document.sezioni.no$i.value); if(a=='NaN') {a=0} if(b=='NaN') {b=0} var c=a + b; window.document.sezioni.val$i.value=c\n";
|
---|
1141 | echo "}\n";
|
---|
1142 | echo "</script>\n";
|
---|
1143 |
|
---|
1144 | if ($num_gruppo != ''){
|
---|
1145 | if ($genere==0){
|
---|
1146 | $sql="SELECT max(voti_complessivi) FROM ".$prefix."_ele_voti_parziale where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";
|
---|
1147 | $res = $dbi->prepare("$sql");
|
---|
1148 | $res->execute();
|
---|
1149 |
|
---|
1150 |
|
---|
1151 | list($tot) = $res->fetch(PDO::FETCH_NUM);
|
---|
1152 | $sql="SELECT * FROM ".$prefix."_ele_voti_ref where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";
|
---|
1153 | $res = $dbi->prepare("$sql");
|
---|
1154 | $res->execute();
|
---|
1155 |
|
---|
1156 |
|
---|
1157 | $pro= $res->fetch(PDO::FETCH_BOTH);
|
---|
1158 | if ($pro['si']+$pro['no']!=$pro['validi'] or ($pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=$tot and $pro['validi']+$pro['nulli']+$pro['bianchi']+$pro['contestati']!=0)){
|
---|
1159 | echo "<tr style=\"background-color: rgb(255, 0, 0); text-align:center\">";
|
---|
1160 | }else{
|
---|
1161 | echo "<tr style=\"background-color: $bgcolor2; text-align:center\">";
|
---|
1162 | }
|
---|
1163 | $descr = explode('.',$descr_gruppo, 100);
|
---|
1164 | echo "<td colspan=\"6\" align=\"center\"><input type=\"hidden\" name=\"id_gruppo$i\" value=\"$id_gruppo\"><b>$num_gruppo) </b>"
|
---|
1165 | ."<b> $descr[0] </b></td></tr>";
|
---|
1166 | $pro['si']=(isset($pro['si']) and $pro['si']>=0) ? $pro['si']:'';
|
---|
1167 | $pro['no']=(isset($pro['no']) and $pro['no']>=0) ? $pro['no']:'';
|
---|
1168 | $pro['validi']=(isset($pro['validi']) and $pro['validi']>=0) ? $pro['validi']:'';
|
---|
1169 | $pro['bianchi']=(isset($pro['bianchi']) and $pro['bianchi']>=0) ? $pro['bianchi']:'';
|
---|
1170 | $pro['contestati']=(isset($pro['contestati']) and $pro['contestati']>=0) ? $pro['contestati']:'';
|
---|
1171 | $pro['nulli']=(isset($pro['nulli']) and $pro['nulli']>=0) ? $pro['nulli']:'';
|
---|
1172 | $tot_nulli=intval($pro['nulli'])+intval($pro['bianchi'])+intval($pro['contestati']);
|
---|
1173 | $tot_voti=intval($pro['validi'])+$tot_nulli;
|
---|
1174 | echo $campiriep; # style=\"text-align: center; border: 1px; border-color: black; border-collaps:collaps;\"
|
---|
1175 | echo "<tr style=\"background-color: $bgcolor2; text-align:center\"><td colspan=\"2\" >$tot_nulli</td>";
|
---|
1176 | echo "<td colspan=\"2\">$tot_voti</td>";
|
---|
1177 | echo "<td colspan=\"2\">$tot</td></tr>";
|
---|
1178 | echo $campitesta;
|
---|
1179 | echo "<tr><td align=\"right\" width=\"3%\"><input name=\"si$i\" value=\"".$pro['si']."\" size=\"7\" style=\"text-align:right\" onchange=controlloref$i()></td>";
|
---|
1180 | echo "</td><td align=\"right\" width=\"3%\"><input name=\"no$i\" value=\"".$pro['no']."\" size=\"7\" style=\"text-align:right\" onchange=controlloref$i()></td>";
|
---|
1181 | echo "</td><td align=\"right\" width=\"3%\"><input name=\"val$i\" value=\"".$pro['validi']."\" size=\"7\" style=\"text-align:right\" ></td>";
|
---|
1182 | echo "</td><td align=\"right\"><input name=\"bia$i\" value=\"".$pro['bianchi']."\" size=\"7\" style=\"text-align:right\"></td>";
|
---|
1183 | echo "</td><td align=\"right\"><input name=\"con$i\" value=\"".$pro['contestati']."\" size=\"7\" style=\"text-align:right\"></td>";
|
---|
1184 | echo "</td><td align=\"right\"><input name=\"nul$i\" value=\"".$pro['nulli']."\" size=\"7\" style=\"text-align:right\"></td>";
|
---|
1185 |
|
---|
1186 |
|
---|
1187 | }else{
|
---|
1188 | echo "<tr style=\"background-color: $bgcolor2; text-align:center\"><td align=\"center\"><input type=\"hidden\" name=\"num_gruppo$i\" value=\"$num_gruppo\"><b>$num_gruppo</b>"
|
---|
1189 | ."</td><td align=\"left\"><b> $descr_gruppo </b>";
|
---|
1190 | $sql="SELECT * FROM ".$prefix."_ele_voti_gruppo where id_cons='$id_cons' and id_sez='$id_sez' and id_gruppo='$id_gruppo' ";
|
---|
1191 | $res = $dbi->prepare("$sql");
|
---|
1192 | $res->execute();
|
---|
1193 |
|
---|
1194 | $pro= $res->fetch(PDO::FETCH_BOTH);
|
---|
1195 | if(!$res->rowCount()) {$pro['voti']=''; $pro['solo_gruppo']='';}
|
---|
1196 | $errcolor='';
|
---|
1197 | if(isset($errgrulis[$id_gruppo])) $errcolor="style=\"background-color: rgb(255, 0, 0);\"";
|
---|
1198 | echo "</td><td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$pro['voti']."\" size=\"7\" style=\"text-align:right\"></td>";
|
---|
1199 |
|
---|
1200 | if($dettnulli) {echo "<td align=\"right\"><input name=\"solog$i\" value=\"".$pro['solo_gruppo']."\" size=\"7\" style=\"text-align:right\"></td>"; $totsg+=intval($pro['solo_gruppo']);}
|
---|
1201 | $tot_pref += intval($pro['voti']);
|
---|
1202 | echo "</tr>";
|
---|
1203 | }
|
---|
1204 |
|
---|
1205 | $i++;
|
---|
1206 | }
|
---|
1207 |
|
---|
1208 | }
|
---|
1209 | if ($genere!=0) {
|
---|
1210 | $sql="SELECT disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' ";
|
---|
1211 | $res = $dbi->prepare("$sql");
|
---|
1212 | $res->execute();
|
---|
1213 |
|
---|
1214 |
|
---|
1215 | list($disgiunto)=$res->fetch(PDO::FETCH_NUM);
|
---|
1216 | $sql="SELECT solo_lista FROM ".$prefix."_ele_sezioni where id_sez='$id_sez' ";
|
---|
1217 | $res = $dbi->prepare("$sql");
|
---|
1218 | $res->execute();
|
---|
1219 |
|
---|
1220 |
|
---|
1221 | list($sololis)=$res->fetch(PDO::FETCH_NUM);
|
---|
1222 | echo "<tr style=\"background-color: $bgcolor1; text-align:center\"><td></td><td>"._TOTPREF."</td><td>$tot_pref</td>";
|
---|
1223 | if($dettnulli) echo "<td>$totsg</td>";
|
---|
1224 | echo "</tr>";
|
---|
1225 | if($disgiunto)
|
---|
1226 | echo "<tr style=\"background-color: $bgcolor1; text-align:center\"><td></td><td>"._SOLOLIS."</td><td><input name=\"sololista\" value=\"".$sololis."\" size=\"7\" style=\"text-align:right\"></td></tr>";
|
---|
1227 | }
|
---|
1228 |
|
---|
1229 | echo "<tr><td></td><td></td><td align=\"center\"><input type=\"submit\" name=\"update\" id=\"update\" value=\" "._OK. "\"></td>";
|
---|
1230 |
|
---|
1231 | echo "</tr></table></form></td></tr>";
|
---|
1232 | if(chisei($id_cons_gen)>=64){
|
---|
1233 | echo "<tr><td><input type=\"checkbox\" id=\"pwd3\" name=\"pwd3\" value=\"\" onclick=\"javascript:del_dati()\">"._DELETE."";
|
---|
1234 | }
|
---|
1235 |
|
---|
1236 | echo "</td></tr></table></center>";
|
---|
1237 | }
|
---|
1238 | if ($genere!=0){
|
---|
1239 | finale($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
1240 | }
|
---|
1241 | }
|
---|
1242 |
|
---|
1243 |
|
---|
1244 |
|
---|
1245 |
|
---|
1246 | ?>
|
---|