[254] | 1 | <?php
|
---|
| 2 | /************************************************************************/
|
---|
| 3 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
| 4 | /* by Roberto Gigli & Luciano Apolito */
|
---|
| 5 | /* http://www.eleonline.it */
|
---|
[384] | 6 | /* info@eleonline.it rgigli@libero.it */
|
---|
[254] | 7 | /************************************************************************/
|
---|
| 8 | /* Modulo Inserimento dati */
|
---|
| 9 | /* Amministrazione */
|
---|
| 10 | /************************************************************************/
|
---|
| 11 |
|
---|
| 12 | if (!defined('ADMIN_FILE')) {
|
---|
| 13 | die ("You can't access this file directly...");
|
---|
| 14 | }
|
---|
[257] | 15 | global $dbi;
|
---|
[254] | 16 | $aid=$_SESSION['aid'];
|
---|
| 17 | $prefix=$_SESSION['prefix'];
|
---|
| 18 | $currentlang=$_SESSION['lang'];
|
---|
| 19 | $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST;
|
---|
| 20 | $vari= implode(',',$_GET);//param);
|
---|
| 21 | $id_comune=$_SESSION['id_comune'];
|
---|
| 22 | $id_cons_gen=intval($_GET['id_cons_gen']);
|
---|
| 23 | $perms=ChiSei($id_cons_gen);
|
---|
| 24 | if ($perms<16 or !$id_cons_gen) die("Non hai i permessi per inserire dati, o non hai scelto la consultazione!");
|
---|
[344] | 25 | if (isset($param['do'])) $do=addslashes($param['do']); else $do='';
|
---|
[254] | 26 | //if (isset($param['id_cons'])) $id_cons=intval($param['id_cons']); else $id_cons='';
|
---|
| 27 | if (isset($param['ops'])) $ops=intval($param['ops']); else $ops='';
|
---|
| 28 | if (isset($param['min'])) $min=intval($param['min']); else $min=0;
|
---|
| 29 | if (isset($param['ok'])) $ok=intval($param['ok']); else $ok='';
|
---|
| 30 | if (isset($param['ov'])) $ov=intval($param['ov']); else $ov='';
|
---|
| 31 | if (isset($param['mv'])) $mv=intval($param['mv']); else $mv='';
|
---|
| 32 | if (isset($param['gv'])) $gv=intval($param['gv']); else $gv='';
|
---|
| 33 | if (isset($param['msv'])) $msv=intval($param['msv']); else $msv='';
|
---|
| 34 | if (isset($param['av'])) $av=intval($param['av']); else $av='';
|
---|
| 35 | if (isset($param['id_circ'])) $id_circ=intval($param['id_circ']); else
|
---|
| 36 | if (isset($_SESSION['id_circ'])) $id_circ=intval($_SESSION['id_circ']); else $id_circ='0';
|
---|
| 37 | if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede='0';
|
---|
| 38 | if (isset($param['id_sez'])) $id_sez=intval($param['id_sez']); else $id_sez='';
|
---|
| 39 | if (isset($param['id_lista'])) $id_lista=intval($param['id_lista']); else $id_lista='0';
|
---|
| 40 | if (isset($param['prev_sez'])) $prev_sez=intval($param['prev_sez']); else $prev_sez='0';
|
---|
| 41 | if (isset($param['id_gruppo'])) $id_gruppo=intval($param['id_gruppo']); else $id_gruppo='0';
|
---|
| 42 | if (isset($param['update'])) $update=intval($param['update']); else $update='';
|
---|
| 43 | include("modules/Elezioni/funzionidata.php");
|
---|
| 44 | include("modules/Elezioni/ele.php");
|
---|
[360] | 45 | include_once("modules/Elezioni/ele_spoglio.php");
|
---|
[254] | 46 | global $votolista, $limite, $dettnulli,$disgiunto;
|
---|
| 47 | if(!isset($votolista)) $votolista=0;
|
---|
[257] | 48 | $sql="SELECT tipo_cons FROM ".$prefix."_ele_consultazione where id_cons_gen='$id_cons_gen'" ;
|
---|
| 49 | $res = $dbi->prepare("$sql");
|
---|
| 50 | $res->execute();
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | list($tipo_cons) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 54 | if ($tipo_cons!=3 or $votolista==1) $limite=0; #die ("limite: $limite");}
|
---|
[257] | 55 | $sql="SELECT count(id_circ) FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' ";
|
---|
| 56 | $res = $dbi->prepare("$sql");
|
---|
| 57 | $res->execute();
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | list($num_circ)=$res->fetch(PDO::FETCH_NUM);
|
---|
| 61 | $sql="SELECT solo_gruppo,disgiunto FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons' ";
|
---|
| 62 | $res = $dbi->prepare("$sql");
|
---|
| 63 | $res->execute();
|
---|
| 64 |
|
---|
| 65 |
|
---|
[338] | 66 |
|
---|
[257] | 67 | list($dettnulli,$disgiunto)=$res->fetch(PDO::FETCH_NUM);
|
---|
[338] | 68 |
|
---|
| 69 | $sql="SELECT circo FROM ".$prefix."_ele_tipo where tipo_cons='$tipo_cons' ";
|
---|
| 70 | $res = $dbi->prepare("$sql");
|
---|
| 71 | $res->execute();
|
---|
| 72 | list($conscirc)=$res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 73 | if ($conscirc){ // or $num_circ==1
|
---|
| 74 | if (!$id_circ){
|
---|
| 75 | if (!$id_sez){
|
---|
[257] | 76 | $sql="SELECT id_sez FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' and num_sez='1'";
|
---|
| 77 | $res = $dbi->prepare("$sql");
|
---|
| 78 | $res->execute();
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 | list($id_sez)=$res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 82 | }
|
---|
[257] | 83 | $sql="SELECT t1.id_circ FROM ".$prefix."_ele_sede as t1 left join ".$prefix."_ele_sezioni as t2 on t1.id_sede=t2.id_sede where t1.id_cons='$id_cons' and t2.id_sez='$id_sez'";
|
---|
| 84 | $res = $dbi->prepare("$sql");
|
---|
| 85 | $res->execute();
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | #$sql="SELECT id_circ FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' order by num_circ limit 0,1";
|
---|
[338] | 89 | //$res = $dbi->prepare("$sql");
|
---|
| 90 | //$res->execute();
|
---|
[257] | 91 |
|
---|
| 92 |
|
---|
[361] | 93 | if (!$res->rowCount()) die("Errore, non trovo circoscrizioni inserite! Consultare l'amministratore");
|
---|
[257] | 94 | list($id_circ)=$res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 95 | $_SESSION['id_circ']=$id_circ;
|
---|
| 96 | }
|
---|
[361] | 97 | $sql="select id_sede from ".$prefix."_ele_sede where id_circ='$id_circ'";
|
---|
[257] | 98 | $result = $dbi->prepare("$sql");
|
---|
| 99 | $result->execute();
|
---|
| 100 |
|
---|
| 101 |
|
---|
[254] | 102 | $i=0;
|
---|
[257] | 103 | while(list($tmp) = $result->fetch(PDO::FETCH_NUM)) $idsedi[$i++]=$tmp;$tmp=implode (",",$idsedi);
|
---|
[254] | 104 | unset($idsedi);$i=0;$idsezi=array();unset($result);
|
---|
[257] | 105 | $sql="SELECT id_sez FROM ".$prefix."_ele_sezioni where id_sede in ($tmp)";
|
---|
| 106 | $result = $dbi->prepare("$sql");
|
---|
| 107 | $result->execute();
|
---|
| 108 |
|
---|
| 109 |
|
---|
[254] | 110 | unset($tmp);
|
---|
[257] | 111 | while(list($tmp) = $result->fetch(PDO::FETCH_NUM)) $idsezi[$i++]=$tmp;
|
---|
[254] | 112 | $tmp=implode (",",$idsezi);
|
---|
| 113 | $sezi = "and id_sez in ($tmp)";
|
---|
[338] | 114 | $circo = "and id_circ=$id_circ";
|
---|
[254] | 115 | }else{
|
---|
| 116 | $sezi='';
|
---|
| 117 | $circo='';
|
---|
| 118 | }
|
---|
| 119 |
|
---|
| 120 | // Offset - visualizza il numero di elementi per pagina
|
---|
| 121 | $offset=2;
|
---|
| 122 | if (!isset($min)) $min=0;
|
---|
| 123 | $hiddenInfo = "<input type=\"hidden\" name=\"min\" value=\"$min\">";
|
---|
| 124 |
|
---|
| 125 | function numeri_sezione($nums) {
|
---|
| 126 | // tabella visualizzazione sezioni per numero
|
---|
[329] | 127 | global $aid,$bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $tipo_cons, $genere,$id_cons_gen,$id_cons,$id_lista,$ops, $perms,$id_sez,$num_ril,$status,$idrefgruppo,$votog,$votol,$votoc;
|
---|
[254] | 128 | $idrefgruppo='';
|
---|
| 129 | $solosede='';
|
---|
| 130 | if ($perms<32) {
|
---|
[257] | 131 | $sql="SELECT id_sede FROM ".$prefix."_ele_operatori where aid='$aid' and id_cons=$id_cons";
|
---|
| 132 | $res = $dbi->prepare("$sql");
|
---|
| 133 | $res->execute();
|
---|
| 134 |
|
---|
| 135 |
|
---|
[254] | 136 | if ($res) {
|
---|
[257] | 137 | list($solouna)=$res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 138 | if ($solouna>0) $solosede="and id_sede='$solouna'";
|
---|
| 139 | }
|
---|
| 140 | }
|
---|
[258] | 141 | $sql="SELECT num_sez, id_sez ,id_sede,colore FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' $solosede order by num_sez";
|
---|
[257] | 142 | $res = $dbi->prepare("$sql");
|
---|
| 143 | $res->execute();
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 | $max = $res->rowCount();
|
---|
[254] | 147 | //if ($max>=64){
|
---|
| 148 | $i=0;
|
---|
| 149 | echo "\n<table align=\"left\" width=\"100%\" border=\"3\"><tr bgcolor=\"$bgcolor1\"><td>";
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 | echo "<div id=\"navmenu\"> <ul>";
|
---|
[260] | 153 | while(list($sez_num, $sez_id ,$sede_id,$colore) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[307] | 154 | # $ops='';
|
---|
[254] | 155 | if(!$id_sez) {$id_sez=$sez_id; $id_sede=$sede_id;}
|
---|
| 156 | $i++;
|
---|
[258] | 157 | $sql="SELECT id_circ FROM ".$prefix."_ele_sede where id_cons='$id_cons' and id_sede='$sede_id' ";
|
---|
[257] | 158 | $result = $dbi->prepare("$sql");
|
---|
| 159 | $result->execute();
|
---|
| 160 |
|
---|
| 161 |
|
---|
| 162 | list($circ_id) = $result->fetch(PDO::FETCH_NUM);
|
---|
[260] | 163 |
|
---|
[254] | 164 | if(!$ops) $ops=1;
|
---|
[257] | 165 | $sql="SELECT num_sez FROM ".$prefix."_ele_sezioni where id_sez='$id_sez'";
|
---|
| 166 | $res2 = $dbi->prepare("$sql");
|
---|
| 167 | $res2->execute();
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | list($numero_sez) = $res2->fetch(PDO::FETCH_NUM);
|
---|
[260] | 171 | if ($sez_num==$numero_sez) {
|
---|
| 172 | $cursez= "style=\" background: $colore; border: solid; border-color: YELLOW; border-width: 4px; border-left: solid gray 4px; border-top: solid gray 4px; \"";}
|
---|
| 173 | else $cursez="style=\" background: $colore; \"";
|
---|
[254] | 174 | echo "\n<li $cursez><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$circ_id&id_sede=$sede_id&id_sez=$sez_id&ops=$ops&do=spoglio&id_lista=$id_lista\">$sez_num</a></b></li>\n";
|
---|
| 175 | }
|
---|
| 176 | //}
|
---|
| 177 | echo "</ul></div></td></tr></table>\n";
|
---|
| 178 | //}// fine tabella per numero sezioni
|
---|
| 179 | }
|
---|
| 180 | ///////////////////////////////////////////////////////////////////////////////////
|
---|
| 181 |
|
---|
| 182 |
|
---|
| 183 | function voti($id_cons,$do,$id_circ,$id_sede,$ops,$ov,$mv,$gv,$msv,$av,$id_lista) {
|
---|
[338] | 184 | global $aid,$bgcolor1, $bgcolor2, $prefix, $dbi, $offset, $min, $tipo_cons, $genere,$id_cons_gen,$prev_sez,$votog,$votol,$votoc,$conscirc,$id_sez,$ops,$circo;
|
---|
[254] | 185 |
|
---|
| 186 | echo "<table border=\"0\" width=\"760\" align=\"left\"><tr>";
|
---|
| 187 | echo "\n<td bgcolor=\"$bgcolor1\" align=\"left\">";
|
---|
| 188 | numeri_sezione(22);
|
---|
| 189 | echo "\n</td></tr><tr><td>\n";
|
---|
| 190 |
|
---|
| 191 |
|
---|
| 192 | ///////////////////////
|
---|
| 193 | // Circoscrizione : scelta
|
---|
| 194 | ///////////////////////
|
---|
[368] | 195 | # if($id_sez) $consez=" and id_sez
|
---|
| 196 | $sql="SELECT t1.id_sede,t2.id_circ,t1.id_sez FROM ".$prefix."_ele_operatori as t1,
|
---|
[254] | 197 | ".$prefix."_ele_sede as t2
|
---|
[257] | 198 | where t1.id_cons='$id_cons' AND t1.id_sede=t2.id_sede and t1.aid='$aid'";
|
---|
| 199 | $resoper = $dbi->prepare("$sql");
|
---|
| 200 | $resoper->execute();
|
---|
| 201 |
|
---|
| 202 |
|
---|
[368] | 203 | list($id_sede2,$id_circ2,$id_sez2) = $resoper->fetch(PDO::FETCH_NUM);
|
---|
| 204 | if($id_sez2) $id_sez=$id_sez2;
|
---|
[254] | 205 | if ($id_sede2 and !($id_sede==$id_sede2)) {
|
---|
| 206 | $id_sede=$id_sede2;
|
---|
| 207 | $id_circ=$id_circ2;
|
---|
| 208 | $do="spoglio";
|
---|
[368] | 209 | $sql="SELECT id_sez FROM ".$prefix."_ele_sezioni where id_sez='$id_sez'";
|
---|
| 210 | $res = $dbi->prepare("$sql");
|
---|
| 211 | $res->execute();
|
---|
| 212 | if(!$res->rowCount()) {
|
---|
| 213 | $sql="SELECT id_sez FROM ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sede=$id_sede order by num_sez limit 0,1";
|
---|
| 214 | $res = $dbi->prepare("$sql");
|
---|
| 215 | $res->execute();
|
---|
| 216 | list($id_sez) = $res->fetch(PDO::FETCH_NUM);
|
---|
| 217 | }
|
---|
[254] | 218 | }
|
---|
| 219 | if ($do == "circo") {
|
---|
| 220 | OpenTable();
|
---|
| 221 | echo "<tr><td><form name=\"voti\" action=\"admin.php\">"
|
---|
| 222 | ."<input type=\"hidden\" name=\"op\" value=\"voti\">"
|
---|
| 223 | ."<input type=\"hidden\" name=\"do\" value=\"sede\">"
|
---|
| 224 | // Circoscrizione: lista
|
---|
| 225 | //**************************************
|
---|
| 226 | .""._CIRCO.": "
|
---|
| 227 | ."<select name=\"id_circ\">";
|
---|
[257] | 228 | $sql="SELECT id_circ,descrizione FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' order by num_circ";
|
---|
| 229 | $res = $dbi->prepare("$sql");
|
---|
| 230 | $res->execute();
|
---|
| 231 |
|
---|
| 232 |
|
---|
| 233 | while(list($id,$descr) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[254] | 234 | if ($descr!="Tutte"){
|
---|
| 235 | if ($id == $id_circ) {
|
---|
| 236 | $sel = "selected";
|
---|
| 237 | } else {
|
---|
| 238 | $sel = "";
|
---|
| 239 | }
|
---|
| 240 | echo "<option value=\"$id\" $sel>$descr";
|
---|
| 241 | }
|
---|
| 242 | }
|
---|
| 243 | echo "</select>"
|
---|
| 244 | //***********************************
|
---|
| 245 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
| 246 | ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"
|
---|
| 247 | ."</form></td></tr>";
|
---|
| 248 | CloseTable();
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | ///////////////////////
|
---|
| 252 | // sede : scelta
|
---|
| 253 | ///////////////////////
|
---|
| 254 |
|
---|
| 255 |
|
---|
| 256 | if ($do == "sede") {
|
---|
| 257 | OpenTable();
|
---|
| 258 | echo "\n<tr><td><form name=\"sede\" action=\"admin.php\">";
|
---|
[257] | 259 | $sql="SELECT descrizione FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' AND id_circ='$id_circ' order by num_circ";
|
---|
| 260 | $res = $dbi->prepare("$sql");
|
---|
| 261 | $res->execute();
|
---|
| 262 |
|
---|
| 263 |
|
---|
| 264 | list( $descr_circ) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 265 | echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=circo\">"._CIRCO."</a> $descr_circ ->";
|
---|
| 266 | echo "<input type=\"hidden\" name=\"op\" value=\"voti\">"
|
---|
| 267 | ."<input type=\"hidden\" name=\"do\" value=\"spoglio\">"
|
---|
| 268 |
|
---|
| 269 | // Indirizzo: lista
|
---|
| 270 | //**************************************
|
---|
| 271 | .""._INDIRIZZO.": "
|
---|
| 272 | ."<select name=\"id_sede\">";
|
---|
[257] | 273 | $sql="SELECT id_sede,indirizzo FROM ".$prefix."_ele_sede where id_cons='$id_cons' and id_circ='$id_circ' order by indirizzo";
|
---|
| 274 | $res = $dbi->prepare("$sql");
|
---|
| 275 | $res->execute();
|
---|
| 276 |
|
---|
| 277 |
|
---|
[254] | 278 | // echo "$id_circ - $id_cons";
|
---|
[257] | 279 | while(list($id,$indir) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[254] | 280 | if ($id == $id_sede) {
|
---|
| 281 | $sel = "selected";
|
---|
| 282 | } else {
|
---|
| 283 | $sel = "";
|
---|
| 284 | }
|
---|
| 285 | echo "<option value=\"$id\" $sel>$indir";
|
---|
| 286 | }
|
---|
| 287 | echo "</select>"
|
---|
| 288 | //*************************************
|
---|
| 289 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
| 290 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
|
---|
| 291 | ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"
|
---|
| 292 | ."</form></td></tr>\n";
|
---|
| 293 | CloseTable();
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | ///////////////////////
|
---|
| 297 | // sezione : scelta
|
---|
| 298 | ///////////////////////
|
---|
| 299 | if ($do == "spoglio") {
|
---|
| 300 |
|
---|
| 301 |
|
---|
| 302 | //************************************
|
---|
| 303 | // Menu spoglio
|
---|
| 304 | //************************************
|
---|
[342] | 305 | $sql="select id_cons,id_sez,id_sede,num_sez, maschi, femmine from ".$prefix."_ele_sezioni where id_cons='$id_cons' and id_sez='$id_sez'";
|
---|
| 306 | $result = $dbi->prepare("$sql");
|
---|
| 307 | $result->execute();
|
---|
| 308 | list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine) = $result->fetch(PDO::FETCH_NUM);
|
---|
[360] | 309 | $sql="select tipo from ".$prefix."_ele_controlli where id_sez='$id_sez' group by tipo";
|
---|
| 310 | $rese = $dbi->prepare("$sql");
|
---|
| 311 | $rese->execute();
|
---|
| 312 | $id_comune=$_SESSION['id_comune'];
|
---|
[361] | 313 | $bordoini="style='cursor: pointer;";
|
---|
| 314 | $errbordoa='';
|
---|
| 315 | $errbordog='';
|
---|
| 316 | $errbordol='';
|
---|
[360] | 317 | while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) {
|
---|
[361] | 318 | if ($tipo=='affluenze') $errbordoa="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
| 319 | if ($tipo=='gruppo' or $tipo=='referendum') $errbordog="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
| 320 | if ($tipo=='lista') $errbordol="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
[360] | 321 | }
|
---|
[361] | 322 | $bordoa=$bordoini.$errbordoa."'";
|
---|
| 323 | $bordog=$bordoini.$errbordog."'";
|
---|
| 324 | $bordol=$bordoini.$errbordol."'";
|
---|
[360] | 325 | echo "<SCRIPT type=\"text/javascript\">\n";
|
---|
| 326 | echo "function vai_scelta(idrif){\n";
|
---|
| 327 | echo "window.document.location.href=idrif\n";
|
---|
| 328 | echo "}\n";
|
---|
| 329 | echo "</script>\n";
|
---|
| 330 | if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna='';
|
---|
| 331 | if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo='';
|
---|
| 332 | if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista='';
|
---|
| 333 | if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff='';
|
---|
[407] | 334 | echo "<div data-role=\"content\" data-theme=\"a\"><hr><h2>Sezione n. $num_sez";
|
---|
| 335 | $sql="SELECT chiusa FROM ".$prefix."_ele_cons_comune where id_cons='$id_cons'";
|
---|
| 336 | $res = $dbi->prepare("$sql");
|
---|
| 337 | $res->execute();
|
---|
| 338 | list($chiusa) = $res->fetch(PDO::FETCH_NUM);
|
---|
[413] | 339 | if ($chiusa==1) echo " -- CONSULTAZIONE NON ATTIVA";
|
---|
[407] | 340 | echo "</h2><table style=\"margin-left:auto; margin-right:auto;\"><tr>";
|
---|
[360] | 341 | #<a href=\"admin.php?id_comune=$id_comune&id_cons_gen=$id_cons_gen&ops=1\"></a>
|
---|
[384] | 342 | echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=1');\"><p style=\"margin-left:10px;margin-right:10px;\"><font color=\"$tcolora\"><b>"._AFFLUENZE."</font></b></p></td>\n";
|
---|
[360] | 343 | if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
|
---|
[384] | 344 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n";
|
---|
[360] | 345 | }
|
---|
| 346 | if($genere==2 and $votog)
|
---|
[384] | 347 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=4');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorg\">"._GRUPPO."</font></b></p></td>\n";
|
---|
[362] | 348 | elseif($genere>=4 and !$votoc)
|
---|
[384] | 349 | echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=3');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorl\">"._LISTAPREF."</font></b></p></td>\n";
|
---|
[360] | 350 | elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
|
---|
[384] | 351 | echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&id_circ=$id_circ&id_cons_gen=$id_cons_gen&do=spoglio&ops=3');\"><p style=\"margin-left:10px;margin-right:10px;\"><b><font color=\"$tcolorl\">"._LISTA."</font></b></p></td>\n";
|
---|
[360] | 352 | }
|
---|
| 353 | echo "</tr></table><hr></div>\n";
|
---|
| 354 | /*
|
---|
[342] | 355 | echo "<hr><table><tr><td width=\"200\"><font size =\"4\" color=\"black\" align=\"left\"><b>Sezione N. $num_sez</b></font></td><td><table><tr>";
|
---|
| 356 | echo "\n<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=1\">"._AFFLUENZE."</a></b></p></td>\n";
|
---|
| 357 | if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
|
---|
| 358 | echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=4\">"._GRUPPO."</a></b></p></td>\n";
|
---|
| 359 | }
|
---|
| 360 | if($genere==2 and $votog)
|
---|
| 361 | echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=4\">"._GRUPPO."</a></b></p></td>\n";
|
---|
| 362 | elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
|
---|
| 363 | echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><p style=\"margin-left:10px;margin-right:10px;\"><b><a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&id_sez=$id_sez&id_circ=$id_circ&id_sede=$id_sede&do=spoglio&ops=3\">"._LISTA."</a></b></p></td>\n";
|
---|
| 364 | }
|
---|
| 365 | echo "</tr></table></td></tr></table><hr>\n";
|
---|
[360] | 366 | */
|
---|
[254] | 367 | #############
|
---|
| 368 | # posizionamento in mancanza di scelta
|
---|
| 369 | #############
|
---|
| 370 | if (!$ops){
|
---|
| 371 | if (!$id_sez) { echo"";#import( pagina di help );
|
---|
| 372 | } else{
|
---|
[257] | 373 | $sql="SELECT data, orario from ".$prefix."_ele_rilaff where id_cons_gen=$id_cons_gen order by data desc,orario desc limit 0,1";
|
---|
[342] | 374 | $res = $dbi->prepare("$sql");
|
---|
| 375 | $res->execute();
|
---|
[257] | 376 | list($data,$orario)=$res->fetch(PDO::FETCH_NUM);
|
---|
| 377 | $sql="SELECT voti_complessivi from ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and orario='$orario' and data='$data'";
|
---|
[342] | 378 | $res = $dbi->prepare("$sql");
|
---|
| 379 | $res->execute();
|
---|
[257] | 380 | list($voti) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 381 | if (!$voti) $ops=1;
|
---|
| 382 | else {
|
---|
| 383 | if($genere<4){
|
---|
[257] | 384 | $sql="SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'";
|
---|
[342] | 385 | $res = $dbi->prepare("$sql");
|
---|
| 386 | $res->execute();
|
---|
[257] | 387 | list($voti) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 388 | if ($voti==0 or $genere<3) $ops=4;
|
---|
| 389 | }
|
---|
| 390 | if(!$ops) $ops=3;
|
---|
| 391 | }
|
---|
| 392 |
|
---|
| 393 | }
|
---|
| 394 | }
|
---|
| 395 | ############ fine posizionamento
|
---|
| 396 |
|
---|
| 397 | ///////////////////////////////////////////
|
---|
| 398 | // opzioni per le funzioni di immissione
|
---|
| 399 |
|
---|
| 400 | if ($ops == 1) {
|
---|
| 401 | votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
|
---|
| 402 | }else{
|
---|
| 403 | ############# Controllo flag per cancellazione consultazione
|
---|
| 404 | echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
|
---|
| 405 | ."//-->\n";
|
---|
| 406 | echo "function del_dati() {\n";
|
---|
| 407 | echo "if (document.getElementById('pwd3').checked==false) {\n";
|
---|
| 408 | echo "document.getElementById('update').value=\""._OK."\" \n";
|
---|
| 409 | echo "document.getElementById('do').value=\"0\" \n";
|
---|
| 410 | echo "}else{\n";
|
---|
| 411 | echo "document.getElementById('update').value=\""._DELETE."\" \n";
|
---|
| 412 | echo "document.getElementById('do').value=\"1\" \n";
|
---|
| 413 | echo "} \n";
|
---|
| 414 | echo "} \n";
|
---|
| 415 | echo "</script>\n";
|
---|
| 416 | }
|
---|
| 417 | if ($ops == 3) {
|
---|
| 418 | preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
| 419 | }
|
---|
| 420 | if ($ops == 4) {
|
---|
| 421 | preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
| 422 |
|
---|
| 423 | }
|
---|
| 424 |
|
---|
| 425 | }
|
---|
| 426 | CloseTable();
|
---|
| 427 |
|
---|
| 428 | }
|
---|
| 429 |
|
---|
[324] | 430 |
|
---|
| 431 |
|
---|
| 432 |
|
---|
[254] | 433 | if (!preg_match("/rec/",$op)) {
|
---|
| 434 | ele(); //menu
|
---|
| 435 | /* echo "\n<table align=\"left\" border=\"0\" width=\"200\"><tr bgcolor=\"$bgcolor1\">";
|
---|
| 436 | numeri_sezione(8);
|
---|
| 437 | echo "<td></td></tr></table>\n";*/
|
---|
| 438 | echo"</td></tr></table>";
|
---|
| 439 | }
|
---|
| 440 |
|
---|
| 441 | switch ($op){
|
---|
| 442 | case "voti": //fa eccezione perche' chiamata con minor numero di parametri - riesaminare
|
---|
| 443 | # voti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$id_lista);
|
---|
| 444 | voti($id_cons,$do,$id_circ,$id_sede,$ops,$ov,$mv,$gv,$msv,$av,$id_lista);
|
---|
| 445 | break;
|
---|
[258] | 446 | case "rec_add_votanti":
|
---|
| 447 | rec_add_votanti($vari);
|
---|
| 448 | break;
|
---|
[254] | 449 | default :
|
---|
| 450 | $op($vari); //chiamata a funzione variabile con parametri variabili (da cambiare!)
|
---|
| 451 | }
|
---|
| 452 | echo"</td></tr></table>";
|
---|
| 453 | include_once("modules/Elezioni/language/lang-$currentlang.php");
|
---|
| 454 | include ("footer.php");
|
---|
| 455 | ?>
|
---|
| 456 |
|
---|