[254] | 1 | <?php
|
---|
| 2 | /************************************************************************/
|
---|
| 3 | /* Eleonline - Raccolta e diffusione dei dati elettorali */
|
---|
| 4 | /* by Roberto Gigli & Luciano Apolito */
|
---|
| 5 | /* http://www.eleonline.it */
|
---|
| 6 | /* info@eleonline.it luciano@aniene.net rgigli@libero.it */
|
---|
| 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 | ///////////////////////
|
---|
| 195 |
|
---|
[257] | 196 | $sql="SELECT t1.id_sede,t2.id_circ 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 |
|
---|
| 203 | list($id_sede2,$id_circ2) = $resoper->fetch(PDO::FETCH_NUM);
|
---|
[254] | 204 | if ($id_sede2 and !($id_sede==$id_sede2)) {
|
---|
| 205 | $id_sede=$id_sede2;
|
---|
| 206 | $id_circ=$id_circ2;
|
---|
| 207 | $do="spoglio";
|
---|
[257] | 208 | $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";
|
---|
| 209 | $res = $dbi->prepare("$sql");
|
---|
| 210 | $res->execute();
|
---|
| 211 |
|
---|
| 212 |
|
---|
| 213 | list($id_sez) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 214 | }
|
---|
| 215 | if ($do == "circo") {
|
---|
| 216 | OpenTable();
|
---|
| 217 | echo "<tr><td><form name=\"voti\" action=\"admin.php\">"
|
---|
| 218 | ."<input type=\"hidden\" name=\"op\" value=\"voti\">"
|
---|
| 219 | ."<input type=\"hidden\" name=\"do\" value=\"sede\">"
|
---|
| 220 | // Circoscrizione: lista
|
---|
| 221 | //**************************************
|
---|
| 222 | .""._CIRCO.": "
|
---|
| 223 | ."<select name=\"id_circ\">";
|
---|
[257] | 224 | $sql="SELECT id_circ,descrizione FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' order by num_circ";
|
---|
| 225 | $res = $dbi->prepare("$sql");
|
---|
| 226 | $res->execute();
|
---|
| 227 |
|
---|
| 228 |
|
---|
| 229 | while(list($id,$descr) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[254] | 230 | if ($descr!="Tutte"){
|
---|
| 231 | if ($id == $id_circ) {
|
---|
| 232 | $sel = "selected";
|
---|
| 233 | } else {
|
---|
| 234 | $sel = "";
|
---|
| 235 | }
|
---|
| 236 | echo "<option value=\"$id\" $sel>$descr";
|
---|
| 237 | }
|
---|
| 238 | }
|
---|
| 239 | echo "</select>"
|
---|
| 240 | //***********************************
|
---|
| 241 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
| 242 | ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"
|
---|
| 243 | ."</form></td></tr>";
|
---|
| 244 | CloseTable();
|
---|
| 245 | }
|
---|
| 246 |
|
---|
| 247 | ///////////////////////
|
---|
| 248 | // sede : scelta
|
---|
| 249 | ///////////////////////
|
---|
| 250 |
|
---|
| 251 |
|
---|
| 252 | if ($do == "sede") {
|
---|
| 253 | OpenTable();
|
---|
| 254 | echo "\n<tr><td><form name=\"sede\" action=\"admin.php\">";
|
---|
[257] | 255 | $sql="SELECT descrizione FROM ".$prefix."_ele_circoscrizione where id_cons='$id_cons' AND id_circ='$id_circ' order by num_circ";
|
---|
| 256 | $res = $dbi->prepare("$sql");
|
---|
| 257 | $res->execute();
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 | list( $descr_circ) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 261 | echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=circo\">"._CIRCO."</a> $descr_circ ->";
|
---|
| 262 | echo "<input type=\"hidden\" name=\"op\" value=\"voti\">"
|
---|
| 263 | ."<input type=\"hidden\" name=\"do\" value=\"spoglio\">"
|
---|
| 264 |
|
---|
| 265 | // Indirizzo: lista
|
---|
| 266 | //**************************************
|
---|
| 267 | .""._INDIRIZZO.": "
|
---|
| 268 | ."<select name=\"id_sede\">";
|
---|
[257] | 269 | $sql="SELECT id_sede,indirizzo FROM ".$prefix."_ele_sede where id_cons='$id_cons' and id_circ='$id_circ' order by indirizzo";
|
---|
| 270 | $res = $dbi->prepare("$sql");
|
---|
| 271 | $res->execute();
|
---|
| 272 |
|
---|
| 273 |
|
---|
[254] | 274 | // echo "$id_circ - $id_cons";
|
---|
[257] | 275 | while(list($id,$indir) = $res->fetch(PDO::FETCH_NUM)) {
|
---|
[254] | 276 | if ($id == $id_sede) {
|
---|
| 277 | $sel = "selected";
|
---|
| 278 | } else {
|
---|
| 279 | $sel = "";
|
---|
| 280 | }
|
---|
| 281 | echo "<option value=\"$id\" $sel>$indir";
|
---|
| 282 | }
|
---|
| 283 | echo "</select>"
|
---|
| 284 | //*************************************
|
---|
| 285 | ."<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"
|
---|
| 286 | ."<input type=\"hidden\" name=\"id_circ\" value=\"$id_circ\">"
|
---|
| 287 | ."<input type=\"submit\" name=\"update\" value=\""._OK."\">"
|
---|
| 288 | ."</form></td></tr>\n";
|
---|
| 289 | CloseTable();
|
---|
| 290 | }
|
---|
| 291 |
|
---|
| 292 | ///////////////////////
|
---|
| 293 | // sezione : scelta
|
---|
| 294 | ///////////////////////
|
---|
| 295 | if ($do == "spoglio") {
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | //************************************
|
---|
| 299 | // Menu spoglio
|
---|
| 300 | //************************************
|
---|
[342] | 301 | $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'";
|
---|
| 302 | $result = $dbi->prepare("$sql");
|
---|
| 303 | $result->execute();
|
---|
| 304 | list($id_cons2,$id_sez2,$id_sede,$num_sez, $maschi, $femmine) = $result->fetch(PDO::FETCH_NUM);
|
---|
[360] | 305 | $sql="select tipo from ".$prefix."_ele_controlli where id_sez='$id_sez' group by tipo";
|
---|
| 306 | $rese = $dbi->prepare("$sql");
|
---|
| 307 | $rese->execute();
|
---|
| 308 | $id_comune=$_SESSION['id_comune'];
|
---|
[361] | 309 | $bordoini="style='cursor: pointer;";
|
---|
| 310 | $errbordoa='';
|
---|
| 311 | $errbordog='';
|
---|
| 312 | $errbordol='';
|
---|
[360] | 313 | while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) {
|
---|
[361] | 314 | if ($tipo=='affluenze') $errbordoa="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
| 315 | if ($tipo=='gruppo' or $tipo=='referendum') $errbordog="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
| 316 | if ($tipo=='lista') $errbordol="border: 6px solid; border-color: rgb(255, 0, 0);";
|
---|
[360] | 317 | }
|
---|
[361] | 318 | $bordoa=$bordoini.$errbordoa."'";
|
---|
| 319 | $bordog=$bordoini.$errbordog."'";
|
---|
| 320 | $bordol=$bordoini.$errbordol."'";
|
---|
[360] | 321 | echo "<SCRIPT type=\"text/javascript\">\n";
|
---|
| 322 | echo "function vai_scelta(idrif){\n";
|
---|
| 323 | echo "window.document.location.href=idrif\n";
|
---|
| 324 | echo "}\n";
|
---|
| 325 | echo "</script>\n";
|
---|
| 326 | if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna='';
|
---|
| 327 | if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo='';
|
---|
| 328 | if($ops=="3") {$bgcolorl="yellow"; $tcolorl='blue';} else {$bgcolorl="grey"; $tcolorl='white';} # $active_lista=" class=\"ui-btn-active\""; else $active_lista='';
|
---|
| 329 | if($ops=="1") {$bgcolora="yellow"; $tcolora='blue';} else {$bgcolora="grey"; $tcolora='white';} # $active_aff=" class=\"ui-btn-active\""; else $active_aff='';
|
---|
| 330 | echo "<div data-role=\"content\" data-theme=\"a\"><hr><table style=\"margin-left:auto; margin-right:auto;\"><tr>";
|
---|
| 331 | #<a href=\"admin.php?id_comune=$id_comune&id_cons_gen=$id_cons_gen&ops=1\"></a>
|
---|
| 332 | echo "\n<td bgcolor=\"$bgcolora\" align=\"center\" $bordoa onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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";
|
---|
| 333 | if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
|
---|
| 334 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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";
|
---|
| 335 | }
|
---|
| 336 | if($genere==2 and $votog)
|
---|
| 337 | echo "<td bgcolor=\"$bgcolorg\" align=\"center\" $bordog onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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] | 338 | elseif($genere>=4 and !$votoc)
|
---|
| 339 | echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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] | 340 | elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
|
---|
| 341 | echo "<td bgcolor=\"$bgcolorl\" align=\"center\"$bordol onClick=\"vai_scelta('admin.php?op=voti&id_comune=$id_comune&id_sez=$id_sez&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";
|
---|
| 342 | }
|
---|
| 343 | echo "</tr></table><hr></div>\n";
|
---|
| 344 | /*
|
---|
[342] | 345 | 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>";
|
---|
| 346 | 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";
|
---|
| 347 | if(!($genere==4) and !($votog)){ //if(!($genere==4) and !($tipo_cons==10 or $tipo_cons==11)){
|
---|
| 348 | 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";
|
---|
| 349 | }
|
---|
| 350 | if($genere==2 and $votog)
|
---|
| 351 | 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";
|
---|
| 352 | elseif(($genere>2 or $votog)){ //if(($genere>2 or $tipo_cons==10 or $tipo_cons==11)){
|
---|
| 353 | 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";
|
---|
| 354 | }
|
---|
| 355 | echo "</tr></table></td></tr></table><hr>\n";
|
---|
[360] | 356 | */
|
---|
[254] | 357 | #############
|
---|
| 358 | # posizionamento in mancanza di scelta
|
---|
| 359 | #############
|
---|
| 360 | if (!$ops){
|
---|
| 361 | if (!$id_sez) { echo"";#import( pagina di help );
|
---|
| 362 | } else{
|
---|
[257] | 363 | $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] | 364 | $res = $dbi->prepare("$sql");
|
---|
| 365 | $res->execute();
|
---|
[257] | 366 | list($data,$orario)=$res->fetch(PDO::FETCH_NUM);
|
---|
| 367 | $sql="SELECT voti_complessivi from ".$prefix."_ele_voti_parziale where id_sez='$id_sez' and orario='$orario' and data='$data'";
|
---|
[342] | 368 | $res = $dbi->prepare("$sql");
|
---|
| 369 | $res->execute();
|
---|
[257] | 370 | list($voti) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 371 | if (!$voti) $ops=1;
|
---|
| 372 | else {
|
---|
| 373 | if($genere<4){
|
---|
[257] | 374 | $sql="SELECT sum(voti) from ".$prefix."_ele_voti_gruppo where id_sez='$id_sez'";
|
---|
[342] | 375 | $res = $dbi->prepare("$sql");
|
---|
| 376 | $res->execute();
|
---|
[257] | 377 | list($voti) = $res->fetch(PDO::FETCH_NUM);
|
---|
[254] | 378 | if ($voti==0 or $genere<3) $ops=4;
|
---|
| 379 | }
|
---|
| 380 | if(!$ops) $ops=3;
|
---|
| 381 | }
|
---|
| 382 |
|
---|
| 383 | }
|
---|
| 384 | }
|
---|
| 385 | ############ fine posizionamento
|
---|
| 386 |
|
---|
| 387 | ///////////////////////////////////////////
|
---|
| 388 | // opzioni per le funzioni di immissione
|
---|
| 389 |
|
---|
| 390 | if ($ops == 1) {
|
---|
| 391 | votanti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av);
|
---|
| 392 | }else{
|
---|
| 393 | ############# Controllo flag per cancellazione consultazione
|
---|
| 394 | echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n"
|
---|
| 395 | ."//-->\n";
|
---|
| 396 | echo "function del_dati() {\n";
|
---|
| 397 | echo "if (document.getElementById('pwd3').checked==false) {\n";
|
---|
| 398 | echo "document.getElementById('update').value=\""._OK."\" \n";
|
---|
| 399 | echo "document.getElementById('do').value=\"0\" \n";
|
---|
| 400 | echo "}else{\n";
|
---|
| 401 | echo "document.getElementById('update').value=\""._DELETE."\" \n";
|
---|
| 402 | echo "document.getElementById('do').value=\"1\" \n";
|
---|
| 403 | echo "} \n";
|
---|
| 404 | echo "} \n";
|
---|
| 405 | echo "</script>\n";
|
---|
| 406 | }
|
---|
| 407 | if ($ops == 3) {
|
---|
| 408 | preferenze($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
| 409 | }
|
---|
| 410 | if ($ops == 4) {
|
---|
| 411 | preferenze_gruppi($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops);
|
---|
| 412 |
|
---|
| 413 | }
|
---|
| 414 |
|
---|
| 415 | }
|
---|
| 416 | CloseTable();
|
---|
| 417 |
|
---|
| 418 | }
|
---|
| 419 |
|
---|
[324] | 420 |
|
---|
| 421 |
|
---|
| 422 |
|
---|
[254] | 423 | if (!preg_match("/rec/",$op)) {
|
---|
| 424 | ele(); //menu
|
---|
| 425 | /* echo "\n<table align=\"left\" border=\"0\" width=\"200\"><tr bgcolor=\"$bgcolor1\">";
|
---|
| 426 | numeri_sezione(8);
|
---|
| 427 | echo "<td></td></tr></table>\n";*/
|
---|
| 428 | echo"</td></tr></table>";
|
---|
| 429 | }
|
---|
| 430 |
|
---|
| 431 | switch ($op){
|
---|
| 432 | case "voti": //fa eccezione perche' chiamata con minor numero di parametri - riesaminare
|
---|
| 433 | # voti($id_cons,$do,$id_circ,$id_sede,$id_sez,$ops,$ov,$mv,$gv,$msv,$av,$id_lista);
|
---|
| 434 | voti($id_cons,$do,$id_circ,$id_sede,$ops,$ov,$mv,$gv,$msv,$av,$id_lista);
|
---|
| 435 | break;
|
---|
[258] | 436 | case "rec_add_votanti":
|
---|
| 437 | rec_add_votanti($vari);
|
---|
| 438 | break;
|
---|
[254] | 439 | default :
|
---|
| 440 | $op($vari); //chiamata a funzione variabile con parametri variabili (da cambiare!)
|
---|
| 441 | }
|
---|
| 442 | echo"</td></tr></table>";
|
---|
| 443 | include_once("modules/Elezioni/language/lang-$currentlang.php");
|
---|
| 444 | include ("footer.php");
|
---|
| 445 | ?>
|
---|
| 446 |
|
---|