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