- Timestamp:
- Feb 22, 2022, 10:40:08 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 39 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r344 r358 17 17 #$LIMITE=3; //fascia di separazione del maggioritario (15.000 abitanti) 18 18 # tempo di sessione: ini_set('session.gc_maxlifetime','3600'); 19 global $multicomune ;19 global $multicomune,$msglogout; 20 20 21 21 // Adattamento variabili superglobal … … 46 46 $param=strtolower($_SERVER['REQUEST_METHOD']) == 'get' ? $_GET : $_POST; 47 47 if (isset($param['aid'])) $aid=addslashes($param['aid']); else $aid=''; 48 if (isset($param['pwd'])) $pwd2=addslashes($param['pwd']); else $pwd2=''; 48 if (isset($param['pwd'])) $pwd2=addslashes($param['pwd']); else $pwd2=''; 49 if(isset($param['msglogout'])) $msglogout=intval($param['msglogout']); else $msglogout=0; 50 49 51 // Additional security (Union, CLike, XSS) 50 52 … … 163 165 $_SESSION['startdate']=$row['startdate']; 164 166 $_SESSION['adminmail']=$row['adminmail']; 165 if (isset($tema) and $tema=='facebook') 166 $_SESSION['tema']=$row['tema']; 167 else $_SESSION['tema']='default'; 167 # if (isset($tema) and $tema=='facebook') 168 # $_SESSION['tema']=$row['tema']; 168 169 $_SESSION['foot']=$row['foot']; 169 170 $_SESSION['lang']=$row['language']; … … 185 186 } 186 187 //fine 188 if (isset($param['tema'])) $_SESSION['tema']=$param['tema']; 189 if (!isset($_SESSION['tema'])) 190 $_SESSION['tema']='default'; 191 $tema=$_SESSION['tema']; 192 187 193 if (isset($param['aid'])) { 188 194 if (strlen($aid)>25 ) { die ("Nome utente troppo lungo: $aid"); } 189 195 if (!isset($param['id_ses']) or $param['id_ses'] != session_id()) logout(); 190 196 if (strstr( $aid," ")) { die ("Gli spazi non sono ammessi nel nome utente: $aid"); } 191 if (isset($_SESSION['aid'])){ 197 if (isset($_SESSION['aid'])){ 192 198 logout();//se hai gia' una sessione aperta non puoi postare 'aid' 193 199 }else{ 194 200 195 196 // $pwd2=$param['pwd']; 197 $mpwd=md5($pwd2); 198 199 // se superUserAdmin 200 ######## 201 $sth = $dbi->prepare("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'"); 202 $sth->execute(); 203 $row = $sth->fetch(PDO::FETCH_ASSOC); 204 $adminsuper=$row['adminsuper']; 205 if ($adminsuper==1) $id_comune='0'; 206 elseif (is_numeric($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']); 207 $sth = $dbi->prepare("select counter,admlanguage from ".$prefix."_authors where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune'"); 208 $sth->execute(); 209 $esiste=$sth->rowCount(); 210 211 212 if ($esiste){ 213 $row = $sth->fetch(PDO::FETCH_ASSOC); 201 // $pwd2=$param['pwd']; 202 $mpwd=md5($pwd2); 203 204 // se superUserAdmin 205 ######## 206 # $sth = $dbi->prepare("select adminsuper from ".$prefix."_authors where aid='$aid' and pwd='$mpwd'"); 207 # $sth->execute(); 208 # $row = $sth->fetch(PDO::FETCH_ASSOC); 209 if (isset($param['id_comune']) and intval($param['id_comune'])>0) $id_comune=intval($param['id_comune']); else $id_comune=0;; 210 # if ($adminsuper==1) $id_comune2=0; else 211 $id_comune2=$id_comune; 212 $sth = $dbi->prepare("select pwd,adminop,adminsuper,counter,admlanguage from ".$prefix."_authors where aid='$aid' and (id_comune='$id_comune2' or adminsuper='1')"); 213 $sth->execute(); 214 $esiste=$sth->rowCount(); 215 # $adminsuper=$row['adminsuper']; 216 $row = $sth->fetch(PDO::FETCH_ASSOC); 217 if(!$esiste) { 218 $msglogout=2; 219 logout(); 220 }else{ 221 if ($row['pwd']!=$mpwd) { 222 $msglogout=3; 223 logout(); 224 }elseif($row['adminop']==1) { 225 $msglogout=1; 226 logout(); 227 } 214 228 $counter=$row['counter']; 215 229 $tmplang=$row['admlanguage']; 216 $counter+=1;217 230 if(strlen($tmplang)==2) $language=$tmplang; 218 $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune '");231 $sth = $dbi->prepare("update ".$prefix."_authors set counter=$counter where aid='$aid' and pwd='$mpwd' and id_comune='$id_comune2'"); 219 232 $sth->execute(); 220 # $row = $sth->fetch(PDO::FETCH_ASSOC); 221 233 # $row = $sth->fetch(PDO::FETCH_ASSOC); 222 234 if ($esiste==1) { 223 235 # $_SESSION['dbi']=$dbi; … … 239 251 240 252 } 253 if(!isset($_SESSION['BASE'])) $_SESSION['BASE']=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 254 if(!isset($language)) $language=$_SESSION['lang']; 241 255 if (! isset($_SESSION['lang'])) $_SESSION['lang']=$language; 242 256 $currentlang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language; 243 if (isset($_SESSION['aid'])) 257 258 if (isset($_SESSION['aid'])) 244 259 { 245 260 //lettura sessione … … 248 263 $prefix=$_SESSION['prefix']; 249 264 $id_comune=$_SESSION['id_comune']; 265 if($id_comune==0) $rifcomune='58047'; else $rifcomune=$id_comune; 250 266 if (isset($_GET['id_cons_gen'])) $id_cons_gen=intval($_GET['id_cons_gen']); 251 267 else { 252 $sth = $dbi->prepare("select id_cons_gen from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)"); 268 $sql="SELECT t1.id_cons_gen FROM ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_comuni as t2 where t1.id_cons=t2.id_cons and t2.id_comune='$id_comune'"; 269 $sth = $dbi->prepare($sql); 253 270 $sth->execute(); 254 271 $row = $sth->fetch(PDO::FETCH_BOTH); … … 256 273 $id_cons_gen=$row[0]; 257 274 else 258 $id_cons_gen=0; 275 $id_cons_gen=0; #die("TEST IN CORSO : idconsgen: $id_cons_gen -- sql:select id_cons_gen from ".$prefix."_ele_cons_comune where preferita='1' and (id_comune='$id_comune' or id_comune=0)"); 259 276 } 260 277 $currentlang=$_SESSION['lang']; 261 $bgcolor1=$_SESSION['bgcolor1'];278 #$bgcolor1=$_SESSION['bgcolor1']; 262 279 $bgcolor2=$_SESSION['bgcolor2']; 263 280 $bgcolor1='#e7e7e7'; … … 265 282 266 283 $perms=ChiSei($id_cons_gen); 284 if($perms==0) logout(); 267 285 } 268 286 … … 272 290 /*********************************************************/ 273 291 function ChiSei($id_cons_gen){ 274 global $dbi ;292 global $dbi, $msglogout; 275 293 276 294 $aid=$_SESSION['aid']; … … 290 308 $adminop=$row[2]; 291 309 292 if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {310 #if (($adminsuper==1 || $admincomune==1 || $adminop==1)) { 293 311 if ($adminsuper==1) 294 312 return 256; 295 elseif ($adminop==1){ 296 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'"); 297 }elseif ($admincomune==1) { 313 elseif ($admincomune==1){ 314 return 64; 315 # $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'"); 316 }else{ 298 317 $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 299 $sth->execute(); 300 $row = $sth->fetch(PDO::FETCH_BOTH); 301 302 $id_cons=$row[0]; 318 $sth->execute(); 319 $row = $sth->fetch(PDO::FETCH_BOTH); 320 $id_cons=$row[0]; 303 321 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); 304 } 305 306 $sth->execute(); 307 $row = $sth->fetch(PDO::FETCH_BOTH); 308 309 if ($sth->rowCount()==1) $perms=$row[0]; else $perms=0; 322 } 323 $sth->execute(); 324 $row = $sth->fetch(PDO::FETCH_BOTH); 325 if($row[0]==0) $msglogout=1; 326 if ($sth->rowCount()==1) $perms=$row[0]; else { $msglogout=1; $perms=0; } 310 327 return $perms; 311 } else return 0;328 #} else return 0; 312 329 } 313 330 … … 321 338 322 339 function login() { 323 global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema; 324 $lang=strlen($_SESSION['lang'])==2 ? $_SESSION['lang']: $language; 340 global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema, $id_cons_gen, $perms, $msglogout; 325 341 if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']); 326 342 if (!isset($id_comune)) $id_comune=0; 327 session_regenerate_id(); 343 if(isset($_SESSION['aid'])){ 344 session_regenerate_id(); 345 } 346 $lang=(isset($_SESSION['lang']) and strlen($_SESSION['lang'])==2) ? $_SESSION['lang']: $language; 328 347 $id_ses=session_id(); 329 #die("test:$tema"); 348 330 349 //include("modules/Elezioni/language/lang-$lang.php"); 350 if($multicomune==''){ 351 $sth = $dbi->prepare("select multicomune from ".$prefix."_config"); 352 $sth->execute(); 353 list($multicomune) = $sth->fetch(PDO::FETCH_NUM); 354 } 331 355 include ("header.php"); 332 356 echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>"; 333 echo "<br>"; # method=\"post\" 334 echo "<form name=\"login\" method=\"post\" action=\"admin.php\">" 357 echo "<br>"; # method=\"post\" 358 if ($msglogout==1) echo "<h1 style=\"color:red;\">Utente non autorizzato</h1><br>"; 359 elseif ($msglogout==2) echo "<h1 style=\"color:red;\">Nome Utente non presente in archivio</h1><br>"; 360 elseif ($msglogout==3) echo "<h1 style=\"color:red;\">Password Errata</h1><br>"; 361 echo "<form name=\"login\" data-ajax=\"false\" method=\"post\" action=\"admin.php\">" 335 362 ."<table class=\"table-menu\">" 336 363 ."<tr><td>"._ADMINID."</td>" … … 377 404 Header("Location: admin.php?id_comune=$id_comune&language=$lang"); 378 405 */ 379 global $siteistat ;406 global $siteistat,$perms,$msglogout; 380 407 381 408 $ref="Location: admin.php?"; 409 #$ref="Location: https://www.eleonline.it/adminmob/admin.php?"; 382 410 if (isset($_SESSION['id_comune'])) 383 411 $id_comune=$_SESSION['id_comune']; … … 388 416 if (isset($_SESSION['lang'])) 389 417 $ref=$ref."&language=".$_SESSION['lang']; 390 418 $ref.="&msglogout=$msglogout"; 391 419 $_SESSION=array(); 392 420 session_unset(); … … 396 424 397 425 } 398 399 426 #include("TEST tema: $tema--"); 427 #include("modules/Elezioni/language/lang-".$_SESSION['lang'].".php"); 428 if(isset($id_cons_gen) and isset($id_comune)){ 429 if(!isset($id_cons)){ 430 # $sql = "SELECT t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen' and t2.id_comune='$id_comune'"; 431 $sql = "SELECT id_cons from ".$prefix."_ele_comuni where id_comune='$id_comune'"; 432 $sth = $dbi->prepare("$sql"); 433 $sth->execute(); 434 if ($sth->rowCount()) list($id_cons) = $sth->fetch(PDO::FETCH_NUM); 435 $_SESSION['id_cons']=$id_cons; 436 } 437 if(isset($id_cons)) { 438 $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where id_cons=$id_cons and aid='$aid' and id_comune=$id_comune"; 439 $resmod = $dbi->prepare("$sql"); 440 $resmod->execute(); 441 list($id_sez) = $resmod->fetch(PDO::FETCH_NUM); 442 if($id_sez) $tema='Futura2';#die( "TEST id_cons:$id_cons:"); 443 $_SESSION['tema']=$tema; 444 } 445 } 400 446 #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR']; 401 447 if (isset($param['op'])) $op=addslashes($param['op']); else $op='ele'; 402 448 //if (isset($param['op'])) $op=$param['op']; else $op='ele'; 449 #die( "OP: $op"); 403 450 if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) { 451 if($tema=='Futura2' and $op!='logout') 452 { 453 include("temi/$tema/index.php"); 454 testata(); 455 }else 404 456 switch($op) { 405 457 case "tipo": -
trunk/admin/aggiornadb.php
r357 r358 122 122 $ret=aggiorna($sql,$dbi,'',$num); 123 123 } 124 124 if(!controllo($prefix.'_ele_operatori','id_circ',++$num)) 125 { 126 $sql="ALTER TABLE `".$prefix."_ele_operatori` ADD `id_circ` INT(11) NOT NULL DEFAULT 0 AFTER `aid`"; 127 $ret=aggiorna($sql,$dbi,'',$num); 128 } 129 if(!controllo($prefix.'_ele_operatori','id_circ',++$num)) 130 { 131 $sql="ALTER TABLE `".$prefix."_ele_operatori` ADD `id_sez` INT(11) NOT NULL DEFAULT 0 AFTER `id_circ`"; 132 $ret=aggiorna($sql,$dbi,'',$num); 133 } 125 134 if(!controllo($prefix.'_ele_voti_lista','num_lista',++$num)) 126 135 { … … 318 327 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 319 328 329 $sql="ALTER TABLE `".$prefix."_ele_consultazione` ADD UNIQUE `descrizione` (`descrizione`(100))"; 330 $ret=aggiorna_index($sql,$dbi,$sql2,++$num); 320 331 321 332 ?> -
trunk/admin/header.php
r258 r358 6 6 /* info@eleonline.it luciano@aniene.net rgigli@libero.it */ 7 7 /************************************************************************/ 8 8 #aggiornare il db: ALTER TABLE `soraldo_ele_operatori` ADD `id_circ` INT(11) NOT NULL DEFAULT '0' AFTER `aid`, ADD `id_sez` INT(11) NOT NULL DEFAULT '0' AFTER `id_circ`; 9 9 10 10 if (!defined('ADMIN_FILE')) { 11 11 die ("You can't access this file directly..."); 12 12 } 13 if(isset($_SESSION['aid'])){ 14 include_once("modules/Elezioni/query.sql"); 13 15 14 #include("config.php"); 15 #$dbi = mysql_connect($dbhost, $dbuname, $dbpass); 16 #mysql_select_db($dbname); 17 if (isset($param['language'])) { 18 $_SESSION['lang']=substr($param['language'],0,2); 19 $lang=$_SESSION['lang']; 20 } 21 elseif (strlen($_SESSION['lang'])==2) $lang=$_SESSION['lang']; 22 else $lang=$language; 23 if ($_SESSION['tema']=='facebook') 16 $row=setconsultazione(); 17 if(isset($row[0])) { 18 $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2]; 19 } else { 20 $tipo_cons=0; $descr_cons=''; $id_cons_gen=0; 21 } 22 $row=tipocons(); 23 if(isset($row[0])) { 24 $genere=$row[0];$votog=$row[1];$votol=$row[2];$votoc=$row[3];$conscirc=$row[4]; 25 } else { 26 $genere=0;$votog=0;$votol=0;$votoc=0;$conscirc=0; 27 } 28 } 29 if (isset($param['language'])) { 30 $_SESSION['lang']=substr($param['language'],0,2); 31 $lang=$_SESSION['lang']; 32 } 33 elseif (strlen($_SESSION['lang'])==2) $lang=$_SESSION['lang']; 34 else $lang=$language; 35 include_once("modules/Elezioni/language/lang-$lang.php"); 36 37 38 ############### 39 if(!isset($nocell))$nocell=''; 40 ### tema mobile Futura 2 41 include("inc/mobile.php"); // riconoscimento mobile 42 $is_mobile=is_mobile(); 43 44 if($is_mobile && $nocell!=1){ 45 global $id_sez; 46 #####TEST sezione fissa da impostare iniziando con l'assegnazione del permesso all'operatore di sezione 47 #$id_sez=3378; 48 $tema="Futura2"; 49 } elseif (isset($_SESSION['tema'])) 24 50 $tema=$_SESSION['tema']; 25 else $tema='default'; 26 include("temi/$tema/index.php"); 27 include("modules/Elezioni/language/lang-$lang.php"); 51 $_SESSION['tema']=$tema; 52 #else 53 # $tema='Futura2'; 54 #include("temi/$tema/index.php"); 28 55 29 56 $bgcolor1="#b0b0b0"; 30 57 function head() { 31 global $csv,$tema ;58 global $csv,$tema,$id_cons_gen; 32 59 # echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; 33 60 echo "<!DOCTYPE HTML>\n"; … … 39 66 echo "<script type=\"text/javascript\" src=\"inc/ckeditor/ckeditor.js\"></script>"; //ckeditor 2015 40 67 echo "<link rel=\"StyleSheet\" href=\"temi/$tema/style.css\" type=\"text/css\">\n\n\n"; 68 if (file_exists("temi/$tema/themeutils.php")) { 69 include("temi/$tema/themeutils.php"); #incluso x tema mobile 70 } 41 71 echo "\n\n\n</head>\n<body style=\"background-image: url(temi/$tema/images/sfondo.jpg);\">"; 42 if (!$csv)testata($tema);72 # if (!$csv)testata($tema); 43 73 44 74 -
trunk/admin/inc/sql/db.sql
r357 r358 6 6 aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage 7 7 [_config] 8 sitename,siteurl,site_logo,slogan,startdate,adminmail,tema,foot,language,blocco,testata,nome_testata,fileout,copyright,versione,patch,siteistat,multicomune,flash,displayerrors,gkey,googlemaps,editor,tema_on,ed_user ,secret8 sitename,siteurl,site_logo,slogan,startdate,adminmail,tema,foot,language,blocco,testata,nome_testata,fileout,copyright,versione,patch,siteistat,multicomune,flash,displayerrors,gkey,googlemaps,editor,tema_on,ed_user 9 9 [_doc_cons] 10 10 id_cons,id_doc,tabella … … 46 46 id_cons,mid,title,preamble,content,editimage 47 47 [_ele_operatori] 48 id_cons,id_sede,id_comune,permessi,aid 48 id_cons,id_sede,id_comune,permessi,aid,id_circ,id_sez 49 49 [_ele_province] 50 50 id,descrizione -
trunk/admin/modules/Elezioni/ele.php
r336 r358 58 58 59 59 if (!$perms) $perms=ChiSei($id_cons_gen); 60 //include("modules/Elezioni/language/lang-$currentlang.php");60 include_once("modules/Elezioni/language/lang-$currentlang.php"); 61 61 //************************************************************************** 62 62 // ELE … … 71 71 # include("modules/Elezioni/testa.php"); 72 72 //immagine bullet 73 73 $bullet="<img src=\"temi/$tema/images/bullet.gif\" alt =\" \" align=\"left\" border=\"0\">"; 74 74 $bullet_red="<img src=\"temi/$tema/images/bullet_red.gif\" alt =\" \" align=\"left\" border=\"0\">"; 75 75 $bgcolor1='#e7e7e7'; … … 264 264 </td> 265 265 <td valign=\"top\" width=\"150\">"; 266 if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) ) {266 if ($op!='consultazione' and $perms>0 and $nrcirco and ($nrlista or $nrgruppo) and ! $espandi) { 267 267 echo "<a href=\"admin.php?op=voti&id_cons_gen=$id_cons_gen&do=spoglio\">$bullet "._GEST." "._SPOGLIO."</a><br>"; 268 268 if ($nraff) { -
trunk/admin/modules/Elezioni/ele_candidato.php
r352 r358 303 303 $num_cand++; 304 304 } 305 ################### 305 306 $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'"; 306 307 $sth = $dbi->prepare("$sql"); … … 311 312 $sth->execute(); 312 313 $result=$sth->rowCount(); 313 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')"; 314 $sql="insert into ".$prefix."_ele_log values ('$id_cons','$id_sez','$username','$data','$tempo','','ADD:id_lista:$id_lista,num_lista:$num_lista,cognome:$cognome,nome:$nome','".$prefix."_ele_candidati')"; 315 ######### 314 316 $sth = $dbi->prepare("$sql"); 315 317 $sth->execute(); … … 324 326 }elseif ($do == "update") { 325 327 $pro= $sthcan->fetch(PDO::FETCH_BOTH); 326 328 ################ 327 329 $sql="select id_gruppo,num_lista from ".$prefix."_ele_lista where id_lista='$id_lista'"; 328 330 $sth = $dbi->prepare("$sql"); … … 333 335 if (isset($simbolo)) {$cond.=", simbolo='$simbolo'";} 334 336 $sql="update ".$prefix."_ele_candidati set id_lista='$id_lista', num_lista='$num_lista', cognome='$cognome', nome='$nome', num_cand='$num_cand' $cond where id_cand='$id_cand' "; 337 ###### 335 338 $sth = $dbi->prepare("$sql"); 336 339 $sth->execute(); -
trunk/admin/modules/Elezioni/ele_consultazioni.php
r344 r358 83 83 echo "} \n"; 84 84 echo "</script>\n"; 85 86 ############## onsubmit=\"check_aid()\" 87 /* echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 88 ."//-->\n"; 89 echo "function check_aid() { 90 var elem=document.getElementById('descrcons'); var num=elem.length; alert (\"Please fill in your first name.\".num); 91 for (i=0; i < elem.length; i++) { var sel=elem[i].value; 92 if (elem[i].value == document.consultazione.descr_cons2.value) { 93 document.consultazione.descr_cons2.style.backgroundColor = \"#ccc\"; 94 document.consultazione.descr_cons2.focus(); 95 return false; 96 } 97 } 98 return false; 99 } 100 101 function hide(){ 102 var elem = document.getElementById('descrcons'); 103 elem.style.display = 'none'; 104 }"; 105 106 echo "</script>\n"; */ 107 ################### 108 $sql="select descrizione from ".$prefix."_ele_consultazione"; 109 $sth = $dbi->prepare("$sql"); 110 $sth->execute(); 111 $row = $sth->fetch(PDO::FETCH_NUM); 112 echo "<select id=\"descrcons\" style=\"visibility:hidden;\">"; 113 while(list($val)=$sth->fetch(PDO::FETCH_NUM)) { 114 echo "<option value=\"$val\">$val</option>"; 115 } 116 echo "</select>"; 85 117 ######################### 86 118 if (isset($help)) include("language/$language/ele_consultazioni.html"); … … 127 159 echo "<option value=\"$dfa1\" selected>$dfa1</option>"; anno(); 128 160 echo "</td></tr><tr>"; 129 $resdel = daticonscom(); 130 if(count($resdel)==0) 131 echo "<td><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\"></label></fieldset></td>"; 161 $sql="SELECT t1.tipo_cons,t2.id_cons FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_cons_gen='$id_cons_gen'"; 162 $sth = $dbi->prepare("$sql"); 163 $sth->execute(); 164 $resdel=$sth->rowCount(); 165 if($resdel==0) 166 echo "<td colspan=\"2\"><fieldset><legend>"._SPUNTALABEL1."</legend><label id=\"prov\">"._VIASPUNTAELIMINA." <input type=\"checkbox\" id=\"pwd3\"name=\"pwd3\" value=\"\" onclick=\"del_cons()\" size=\"200px\"></label></fieldset></td>"; 132 167 else echo "<td></td>"; 133 echo "< td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">"168 echo "</tr><tr><td><input type=\"submit\" id=\"update\" name=\"update\" value=\""._MODIFY."\">" 134 169 ."</td></tr></table></form>"; 135 170 } else { … … 249 284 $id_consulta=$id_cons_gen; 250 285 $sql="insert into ".$prefix."_ele_consultazione (descrizione,data_inizio,data_fine,tipo_cons) values ('$descr_cons2','$data_inizio','$data_fine','$tipocons')"; 251 $sth = $dbi->prepare("$sql"); 252 $sth->execute(); 253 286 try { 287 $sth = $dbi->prepare("$sql"); 288 $sth->execute(); 289 }catch(PDOException $e) { 290 if ($e->getCode() == 23000) 291 echo "<h2 style=\"color:red;\"> Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2"; 292 else 293 echo "<h2 style=\"color:red;\"> Inserimento fallito: ". $e->getMessage()."</h2"; 294 } 254 295 } else { 255 296 OpenTable(); … … 262 303 $data_fine="$dfa-$dfm-$dfg"; 263 304 $sql="update ".$prefix."_ele_consultazione set descrizione='$descr_cons2',data_inizio='$data_inizio',data_fine='$data_fine' WHERE id_cons_gen='$id_cons_gen'"; 264 $sth = $dbi->prepare("$sql"); 265 $sth->execute(); 305 try { 306 $sth = $dbi->prepare("$sql"); 307 $sth->execute(); 308 }catch(PDOException $e) { 309 if ($e->getCode() == 23000) 310 echo "<h2 style=\"color:red;\"> Inserimento fallito: Esiste già una consultazione con il nome \"$descr_cons2\"</h2"; 311 else 312 echo "<h2 style=\"color:red;\"> Inserimento fallito: ". $e->getMessage()."</h2"; 313 } 266 314 if (!$sth->rowCount()) return; 267 315 Header("Location: admin.php?op=consultazione&id_cons_gen=$id_cons_gen"); -
trunk/admin/modules/Elezioni/ele_controlli.php
r338 r358 388 388 389 389 if($err){ 390 if(!$id_lista) $id_lista=0; //$controllo; 391 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 392 $res = $dbi->prepare("$sql"); 393 $res->execute(); 390 $sql="select * from ".$prefix."_ele_controlli where tipo='lista' and id_sez='$id_sez' "; 391 $res = $dbi->prepare("$sql"); 392 $res->execute(); 393 if(!$res->rowCount()) { 394 if(!$id_lista) $id_lista=0; //$controllo; 395 $sql="insert into ".$prefix."_ele_controlli value('$id_cons','$id_sez','$tipo','$id_lista')"; 396 $res = $dbi->prepare("$sql"); 397 $res->execute(); 398 } 394 399 } 395 400 -
trunk/admin/modules/Elezioni/ele_operatori.php
r344 r358 26 26 if (isset($_GET['passwd'])) $passwd=addslashes($param['passwd']); else $passwd=''; 27 27 if (isset($_GET['passwd2'])) $passwd2=addslashes($param['passwd2']); else $passwd2=''; 28 if (isset($_GET['stato']) && $aid2!='admin') $stato=intval($param['stato']); else $stato=0; 28 29 29 30 include("modules/Elezioni/funzionidata.php"); … … 37 38 global $aid, $offset, $prefix, $dbi,$id_cons,$aid2,$id_sede,$id_cons_gen,$mex,$perms; 38 39 //echo $perms;die(); 40 39 41 $bgcolor1=$_SESSION['bgcolor1']; 40 42 $id_comune=$_SESSION['id_comune']; … … 44 46 $rescom->execute(); 45 47 list($descr_com) = $rescom->fetch(PDO::FETCH_NUM); 46 $sql="SELECT aid,name,email FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'";48 $sql="SELECT aid,name,email,adminop FROM ".$prefix."_authors where aid='$aid2' and id_comune='$id_comune'"; 47 49 $resmod = $dbi->prepare("$sql"); 48 50 $resmod->execute(); 49 list ($aid2,$name,$email ) = $resmod->fetch(PDO::FETCH_NUM);51 list ($aid2,$name,$email,$attivo) = $resmod->fetch(PDO::FETCH_NUM); 50 52 if (isset($_GET['mex'])){ 51 53 echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">"; … … 65 67 echo "</tr><tr align=\"center\">"; 66 68 echo "<td><input type=\"hidden\" name=\"pag_op\" value=\"admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=\">"; 67 echo "<select name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">";68 echo "<option value=\"\"> ";69 echo "<select id=\"aid2\" name=\"aid2\" onChange=\"top.location.href=this.form.pag_op.value+this.form.aid2.options[this.form.aid2.selectedIndex].value;return false\">"; 70 echo "<option value=\"\">Nuovo Utente"; 69 71 while(list($utente)=$resins->fetch(PDO::FETCH_NUM)){ 70 72 $sel= ($utente == $aid2) ? "selected":""; … … 86 88 echo "<td bgcolor=\"$bgcolor1\"><b>"._NOME."</b></td>" 87 89 ."<td bgcolor=\"$bgcolor1\"><b>"._EMAIL."</b></td>"; 90 echo "<td bgcolor=\"$bgcolor1\"><b>"._STATO."</b></td>"; 91 92 88 93 echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>"; 89 94 echo "<tr align=\"center\"><td>"; … … 98 103 echo "<td align=\"center\"><input type=password name=\"passwd2\" size=\"12\"></td>"; 99 104 echo "<td><input name=\"name\" value=\"$name\"></td>"; 100 echo "<td><input name=\"email\" value=\"$email\">"; 105 echo "<td><input name=\"email\" value=\"$email\"></td>"; 106 if($attivo==0) {$sel2="selected"; $sel3='';} else {$sel2=''; $sel3="selected";} 107 echo "<td><select name=\"stato\"><option value=\"0\" $sel2>Attivo<option value=\"1\" $sel3>Disattivo<option value=\"2\" >Elimina</select>"; 101 108 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\">"; 102 109 echo "<input type=\"hidden\" name=\"ok\" value=0></td>"; … … 113 120 } 114 121 115 function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune ) {122 function operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato) { 116 123 global $aid, $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang; 117 124 $perms=ChiSei($id_cons_gen); 125 if($passwd!=$passwd2) { 126 $mex="- Le password non coincidono! -<br>"; 127 header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex&stato=$stato"); 128 } 118 129 119 130 if ($perms!=256) $id_comune=$_SESSION['id_comune']; … … 124 135 $res->execute(); 125 136 $max=$res->rowCount(); 126 if ($ passwd==$passwd2 and $max==0){127 if ($aid2=='admin') $super=' 1,0,0,'; else $super = '0,1,0,';128 $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."', 0,$super'$currentlang')";137 if ($max==0){ 138 if ($aid2=='admin') $super='0,1,0,'; else $super = '0,0,0,'; 139 $sql="insert into ".$prefix."_authors (aid,name,id_comune,email,pwd,counter,adminop,admincomune,adminsuper,admlanguage) values ('$aid2','$name','$id_comune' , '$email','".md5($passwd)."','0',$super'$currentlang')"; 129 140 $res = $dbi->prepare("$sql"); 130 141 $res->execute(); … … 133 144 $res = $dbi->prepare("$sql"); 134 145 $res->execute(); 135 136 Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen ");146 } 147 Header("Location: admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2"); 137 148 }else{ 138 149 $mex=''; 139 if($passwd!=$passwd2) $mex="- Le password non coincidono! -<br>";140 150 if($max>0) $mex.=" - Utente <b>$aid2</b> presente in archivio! - "; 141 header("location:admin.php?op=operatori&id_cons_gen=$id_cons_gen&aid2=$aid2&name=$name&email=$email&mex=$mex");142 151 } 143 152 } elseif ($do == "update") { 144 $sql="update ".$prefix."_authors set name='$name',pwd='".md5($passwd)."', email='$email' where id_comune='$id_comune' and aid='$aid2' "; 145 $res = $dbi->prepare("$sql"); 146 $res->execute(); 153 if($passwd!='') $mexpwd="pwd='".md5($passwd)."',"; else $mexpwd=''; 154 if($stato==2){ 155 $sql="delete from ".$prefix."_authors where aid='$aid2' and id_comune=$id_comune"; 156 $res = $dbi->prepare("$sql"); 157 $res->execute(); 158 }else{ 159 $sql="update ".$prefix."_authors set name='$name', $mexpwd email='$email', adminop='$stato' where id_comune='$id_comune' and aid='$aid2' "; 160 $res = $dbi->prepare("$sql"); 161 $res->execute(); 162 } 147 163 $result=$res->rowCount(); 164 if($stato!=0){ 165 $sql="delete from ".$prefix."_ele_operatori where id_comune='$id_comune' and aid='$aid2' "; 166 $res = $dbi->prepare("$sql"); 167 $res->execute(); 168 } 148 169 if (!$result) return; 149 170 if ($aid2==$aid) $_SESSION['pwd']=md5($passwd); … … 157 178 // switch 158 179 //**************************** 159 if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune );180 if ($do) operatori($do,$aid2,$name,$email,$passwd,$passwd2,$id_comune,$stato); 160 181 ele(); 161 182 all(); -
trunk/admin/modules/Elezioni/ele_permessi.php
r344 r358 24 24 list($tipo_cons,$id_cons) = $res->fetch(PDO::FETCH_NUM); 25 25 if (isset($param['aid2'])) $aid2=addslashes($param['aid2']); else $aid2=''; 26 if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede= '';26 if (isset($param['id_sede'])) $id_sede=intval($param['id_sede']); else $id_sede=0; 27 27 if (isset($param['do'])) $do=addslashes($param['do']); else $do=''; 28 28 if (isset($param['permessi'])) $permessi=addslashes($param['permessi']); else $permessi=''; … … 30 30 if (isset($param['ok'])) $ok=intval($param['ok']); else $ok=''; 31 31 if (isset($param['mex'])) $mex=addslashes($param['mex']); else $mex=''; 32 if (isset($param['id_sez'])) $id_sez=intval($param['id_sez']); else $id_sez=0; 32 33 33 34 include("modules/Elezioni/funzionidata.php"); … … 39 40 //crea la pagina delle affluenze 40 41 function all() { 41 global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex ;42 global $adminop,$adminsuper,$admincomune,$aid, $offset, $prefix, $dbi,$id_cons,$aid2,$permessi,$id_sede,$id_cons_gen,$id_comune,$mex,$id_sez; 42 43 $bgcolor1=$_SESSION['bgcolor1']; 44 echo "<SCRIPT type=\"text/javascript\">\n\n<!--\n" 45 46 ."//-->\n"; 47 echo "function controlloref(idsede,idsez) {\n"; 48 echo "let element = window.document.getElementById(idsede); \n"; 49 echo "let elecontr = window.document.getElementById(idsez); \n"; 50 echo "element.selectedIndex = 0 ; \n"; 51 echo "}\n"; 52 echo "function controllosez(idsez, idsede) {\n"; 53 echo "let element = window.document.getElementById(idsez); \n"; 54 echo "let elecontr = window.document.getElementById(idsede); \n"; 55 echo "element.selectedIndex = 0; \n"; 56 echo "}\n"; 57 echo "</script>\n"; 43 58 if (isset($mex)){ 44 59 echo "<table align=\"center\"><tr><td style=\"background-color: rgb(255, 0, 0)\">"; … … 54 69 echo "<td><b>"._UTENTE."</b></td>" 55 70 ."<td bgcolor=\"$bgcolor1\"><b>"._SEDE."</b></td>" 71 ."<td bgcolor=\"$bgcolor1\"><b>"._SEZIONE."</b></td>" 56 72 ."<td bgcolor=\"$bgcolor1\"><b>"._PERMESSI."</b></td>"; 57 73 echo "<td bgcolor=\"$bgcolor1\"><b>"._FUNZIONI."</b></td></tr>"; … … 71 87 72 88 if (!$listmp) $listmp="''"; 73 $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune= 1and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati89 $sql="select aid from ".$prefix."_authors where id_comune=$id_comune and (admincomune=0 and adminop=0 and aid not in ($listmp)) order by aid"; // operatori registrati ma non ancora autorizzati 74 90 $resins = $dbi->prepare("$sql"); 75 91 $resins->execute(); 76 77 92 78 93 echo "<form name=\"autorizza\" action=\"admin.php\">" 79 94 ."<input type=\"hidden\" name=\"op\" value=\"permessi\">"; … … 90 105 $ressede = $dbi->prepare("$sql"); 91 106 $ressede->execute(); 92 echo "<td><select name=\"id_sede\">";107 echo "<td><select id=\"id_sede\" name=\"id_sede\" onchange=controllosez('id_sez','id_sede')>"; 93 108 echo "<option value=\"0\"> "._TUTTESEDI; 94 109 if($ressede->rowCount()) … … 99 114 } 100 115 echo "</select></td>"; 116 $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez"; 117 $ressez = $dbi->prepare("$sql"); 118 $ressez->execute(); 119 echo "<td><select id=\"id_sez\" name=\"id_sez\" onchange=controlloref('id_sede','id_sez')>"; 120 echo "<option value=\"0\"> "; 121 if($ressez->rowCount()) 122 while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){ 123 $sel= ($id == $id_sez) ? "selected":""; 124 $arr[$id]=$descr; 125 echo "<option value=\"$id\" $sel>$descr"; 126 } 127 echo "</select></td>"; 101 128 echo "<td><select name=\"permessi\">"; 102 129 if(!isset($permessi)) $permessi=16; … … 115 142 if($resmod->rowCount()){ 116 143 $i=1; 117 while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente ) = $resmod->fetch(PDO::FETCH_NUM)){144 while (list($id_cons2,$id_sede2,$id_comunetemp,$perm,$utente,$id_circ2,$id_sez2) = $resmod->fetch(PDO::FETCH_NUM)){ 118 145 $bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1']; 119 146 echo "<form name=\"modello$i\" action=\"admin.php\">" … … 128 155 $ressede = $dbi->prepare("$sql"); 129 156 $ressede->execute(); 130 echo "<td><select name=\"id_sede\">"; 131 echo "<option value=\"0\"> "._TUTTESEDI; 157 echo "<td><select id=\"id_sede$i\" name=\"id_sede\" onchange=controllosez('id_sez$i','id_sede$i')>"; 158 # if($id_sez2) 159 # echo "<option value=\"0\"> "; 160 # else 161 echo "<option value=\"0\"> "._TUTTESEDI; 132 162 while(list($id,$descr)=$ressede->fetch(PDO::FETCH_NUM)){ 133 163 $sel= ($id == $id_sede2) ? "selected":""; … … 136 166 } 137 167 echo "</select></td>"; 168 $sql="SELECT id_sez, num_sez from ".$prefix."_ele_sezioni where id_cons=$id_cons order by num_sez"; 169 $ressez = $dbi->prepare("$sql"); 170 $ressez->execute(); 171 echo "<td><select id=\"id_sez$i\" name=\"id_sez\" onchange=controlloref('id_sede$i','id_sez$i')>"; 172 echo "<option value=\"0\"> "; 173 if($ressez->rowCount()) 174 while(list($id,$descr)=$ressez->fetch(PDO::FETCH_NUM)){ 175 $sel= ($id == $id_sez2) ? "selected":""; 176 $arr[$id]=$descr; 177 echo "<option value=\"$id\" $sel>$descr"; 178 } 179 echo "</select></td>"; 138 180 echo "<td><select name=\"permessi\">"; 139 181 if(!isset($perm)) $perm=16; … … 153 195 } 154 196 155 function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune ) {197 function permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez) { 156 198 global $prefix, $dbi, $id_cons,$id_cons_gen,$currentlang; 157 199 $perms=ChiSei($id_cons_gen); … … 159 201 if ($perms>32 and $permessi<$perms and $aid2) { 160 202 if ($do == "autorizza") { 161 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid ) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2')";203 $sql="insert into ".$prefix."_ele_operatori (id_cons,id_sede,id_comune,permessi,aid,id_sez) values ('$id_cons','$id_sede','$id_comune','$permessi','$aid2','$id_sez')"; 162 204 $res = $dbi->prepare("$sql"); 163 205 $res->execute(); 164 206 Header("Location: admin.php?op=permessi&id_cons_gen=$id_cons_gen"); 165 207 } elseif ($do == "update") { 166 $sql="update ".$prefix."_ele_operatori set id_sede='$id_sede' , permessi='$permessi' where id_cons='$id_cons' and aid='$aid2' ";208 $sql="update ".$prefix."_ele_operatori set id_sede='$id_sede', permessi='$permessi', id_sez='$id_sez' where id_cons='$id_cons' and aid='$aid2' "; 167 209 $res = $dbi->prepare("$sql"); 168 210 $res->execute(); … … 178 220 // switch 179 221 //**************************** 180 if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune );222 if ($do) permessi($ok, $do,$aid2,$id_sede,$permessi,$id_comune,$id_sez); 181 223 ele(); 182 224 all(); -
trunk/admin/modules/Elezioni/ele_voti.php
r352 r358 413 413 $result = $dbi->prepare("$sql"); 414 414 $result->execute(); 415 415 416 416 417 417 list($numprefs,$fascia,$id_conf,$flagsg,$disgiunto)=$result->fetch(PDO::FETCH_NUM); … … 677 677 echo "<td bgcolor=\"$bgcolor1\" align=\"left\"><b>"._DESCR."</b></td>" 678 678 ."<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._VOTI."</b></td>"; 679 if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)680 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>";679 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) 680 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._NULLI_LISTE."</b></td>"; 681 681 if($disgiunto){ 682 682 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><b>"._SOLOLIS."</b></td>"; … … 775 775 $cond_sele="and id_lista=$id_lista3"; 776 776 echo "<td align=\"right\" $errcolor><input name=\"voti$i\" value=\"".$voti."\" size=\"7\" style=\"text-align:right\">"; 777 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;}777 # 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;} 778 778 if($disgiunto) {echo "</td><td align=\"right\"><input name=\"slpl$i\" value=\"".$slpl."\" size=\"7\" style=\"text-align:right\">"; $tslpl+=$slpl;} 779 779 echo "<input type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\"></td>"; … … 786 786 if(!$id_lista) { 787 787 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>"; 788 if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19)789 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>";788 # if($dettnulli && !$disgiunto && $tipo_cons!=18 && $tipo_cons!=19) 789 # echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tvnpl."</font></td>"; 790 790 if($disgiunto) 791 791 echo "<td bgcolor=\"$bgcolor1\" align=\"center\"><font size=\"3\">".$tslpl."</font></td>"; -
trunk/admin/modules/Elezioni/query.sql
r285 r358 65 65 $sql = "SELECT tipo_cons,descrizione,id_cons_gen FROM ".$prefix."_ele_consultazione order by data_fine desc limit 0,1 "; 66 66 else 67 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; 67 $sql = "SELECT t1.tipo_cons,t1.descrizione,t2.id_cons_gen FROM ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ". 68 $prefix."_ele_operatori as t3 where t3.id_comune=$id_comune and t3.id_comune=t2.id_comune and t1.id_cons_gen=t2.id_cons_gen and t2.chiusa='0' and (t3.id_cons=t2.id_cons or t3.id_cons=0) and t3.permessi>0 and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; 68 69 } 69 70 $sth = $dbi->prepare("$sql"); -
trunk/admin/modules/Elezioni/salva_aff.php
r344 r358 48 48 $res = $dbi->prepare("$query"); 49 49 $res->execute(); 50 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 51 list($id_cons)=$res->fetch(PDO::FETCH_NUM); 50 list($id_cons)=$res->fetch(PDO::FETCH_NUM); 52 51 $query="select id_parz from ".$prefix."_ele_voti_parziale where data='$data' and orario='$orario' and id_sez='$id_sez' and id_gruppo='$id_gruppo'"; 53 52 $res = $dbi->prepare("$query"); 54 53 $res->execute(); 55 54 $righe=$res->rowCount(); 56 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 55 list($id_parz)=$res->fetch(PDO::FETCH_NUM); 57 56 if($righe){ #la riga Ú presente e viene aggiorata 58 57 $arr=$res->fetch(PDO::FETCH_BOTH); … … 88 87 controllo_aff($id_cons,$id_sez,$id_parz); 89 88 include("ele_colora_sez.php"); 89 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 90 90 91 91 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&ops=1&do=spoglio"); -
trunk/admin/modules/Elezioni/salva_gruppi.php
r352 r358 123 123 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 124 124 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 125 125 126 ################################# 126 127 -
trunk/admin/modules/Elezioni/salva_liste.php
r352 r358 58 58 $res->execute(); 59 59 list($circo)=$res->fetch(PDO::FETCH_NUM); 60 61 60 if ($circo) $iscirco="and id_circ=$id_circ"; else $iscirco=''; 62 61 if($id_lista){ … … 90 89 91 90 ################## 92 # if($id_lista){ 91 # if($id_lista){ 92 93 #$andlis="and 93 94 if($pwd3==1) { 94 $sql="delete from ".$prefix."_ele_voti_candidati where id_cons='$id_cons' and id_sez='$id_sez'"; 95 if($id_lista) $condiz="and id_cand in (select id_cand from ".$prefix."_ele_candidati where id_cons='$id_cons' and id_lista='$id_lista')"; else $condiz=''; 96 $sql="delete from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' $condiz"; 95 97 $res = $dbi->prepare("$sql"); 96 98 $res->execute(); … … 111 113 112 114 }elseif($id_lista){ 115 113 116 foreach($idcand as $idkey=>$idc){ 114 117 $sql="select num_cand from ".$prefix."_ele_voti_candidati where id_sez='$id_sez' and id_cand='$idc'"; … … 161 164 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-16); 162 165 Header("Location: ".$BASE."admin.php?op=voti&id_cons_gen=$id_cons_gen&id_circ=$id_circ&id_sede=$id_sede&id_sez=$id_sez&do=spoglio&ops=$ops"); 166 167 168 169 163 170 ################################# 164 171 -
trunk/admin/versione.php
r357 r358 1 1 <?php 2 2 3 $versione = "3.0 rev 35 7";3 $versione = "3.0 rev 358"; 4 4 $version_number = $versione; 5 $datarel = "2 9 dicembre 2021";5 $datarel = "23 febbraio 2022"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7 -
trunk/client/versione.php
r357 r358 1 1 <?php 2 2 3 $versione = "3.0 rev 35 7";3 $versione = "3.0 rev 358"; 4 4 $version_number = $versione; 5 $datarel = "2 9 dicembre 2021";5 $datarel = "23 febbraio 2022"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7
Note:
See TracChangeset
for help on using the changeset viewer.