Changeset 361
- Timestamp:
- Mar 17, 2022, 4:12:48 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r360 r361 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,$msglogout,$language ;19 global $multicomune,$msglogout,$language,$id_sez; 20 20 21 21 // Adattamento variabili superglobal … … 301 301 $session=$_SESSION['remote']; 302 302 303 $perms=ChiSei($id_cons_gen); #die("qui".$_SESSION['aid']); 304 if($perms==0) {logout();} 305 } 303 } 304 306 305 307 306 … … 325 324 $adminsuper=$row[0]; 326 325 $admincomune=$row[1]; 327 $ adminop=$row[2];326 $oper=$row[2]; 328 327 329 328 #if (($adminsuper==1 || $admincomune==1 || $adminop==1)) { … … 333 332 return 64; 334 333 # $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='0' and aid='$aid' and id_comune='$id_comune'"); 335 336 $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 334 elseif($oper) {$msglogout=1; return 0;} # id_cons='$id_cons' and 335 else { 336 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 337 $sql="SELECT id_sez FROM ".$prefix."_ele_operatori where aid='$aid' and permessi>0 and id_cons in (select t1.id_cons from ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.id_comune='$id_comune' and t2.data_fine>$oggi)"; 338 $sth = $dbi->prepare("$sql"); 339 $sth->execute(); #die("TEST: $sql"); 340 if($sth->rowCount()) {$perms=16; return $perms;} 341 else {$msglogout=1; return 0;} 342 } 343 /* $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 337 344 $sth->execute(); 338 345 $row = $sth->fetch(PDO::FETCH_BOTH); … … 340 347 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); 341 348 342 $sth->execute(); 343 $row = $sth->fetch(PDO::FETCH_BOTH);344 if($row[0]==0) $msglogout=1;345 if ( $sth->rowCount()==1) $perms=$row[0]; else {$msglogout=1; $perms=0; }346 347 return $perms; 349 $sth->execute(); 350 list($perms)=$sth->fetch(PDO::FETCH_NUM); 351 # $row = die("test:$sql".$row[0] ); 352 if (!$perms) {die("qui: select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); $msglogout=1; $perms=0; } 353 354 return $perms; */ 348 355 #} else return 0; 349 356 } … … 379 386 elseif ($msglogout==2) echo "<h1 style=\"color:red;\">Nome Utente non presente in archivio</h1><br>"; 380 387 elseif ($msglogout==3) echo "<h1 style=\"color:red;\">Password Errata</h1><br>"; 388 elseif ($msglogout==4) echo "<h1 style=\"color:red;\">Accesso non ammesso da cellulare</h1><br>"; 381 389 echo "<form name=\"login\" data-ajax=\"false\" method=\"post\" action=\"admin.php\">" 382 390 ."<table class=\"table-menu\">" … … 471 479 $tema='Futura2'; #die( "TEST id_cons:$id_cons:".$_SESSION['aid']); 472 480 $_SESSION['tema']=$tema; 473 } else logout();481 } #else {die("TEST: $sql"); logout();} 474 482 } 475 483 } 476 } 477 484 $perms=ChiSei($id_cons_gen); #die("qui".$_SESSION['aid']); 485 if($perms==0) {logout();} 486 } 478 487 479 488 #echo "op:".$param['op']." -- aid:".$_SESSION['aid']."remote:".$_SESSION['remote']."REMOTE:".$_SERVER['REMOTE_ADDR']; -
trunk/admin/aggiornadb.php
r360 r361 98 98 { 99 99 $sql="alter table `".$prefix."_config` change column `Versione` `versione` int(3)"; 100 $ret=aggiorna($sql,$dbi,'',$num); 101 } 102 103 if(!controllo($prefix.'__ele_voti_parziale','data',++$num)) 104 { 105 $sql="ALTER TABLE `".$prefix."_ele_voti_parziale` CHANGE `data` `data` DATE NOT NULL DEFAULT '1900-01-01'"; 106 $ret=aggiorna($sql,$dbi,'',$num); 107 } 108 109 if(!controllo($prefix.'__ele_rilaff','data',++$num)) 110 { 111 $sql="ALTER TABLE `".$prefix."_ele_rilaff` CHANGE `data` `data` DATE NOT NULL DEFAULT '1900-01-01'"; 100 112 $ret=aggiorna($sql,$dbi,'',$num); 101 113 } … … 361 373 $ret=aggiorna_index($tab,$ind,$dbi,$sql2,++$num); 362 374 363 375 echo "<br>Modifica Charset del database<br>"; 376 #$sql="ALTER DATABASE $dbname CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'"; 377 #$res = $dbi->prepare("$sql"); 378 #$res->execute(); 379 # alter table $table DEFAULT CHARSET=utf8 COLLATE utf8_general_ci 380 $sql="SELECT table_name,column_name,column_default,column_type,is_nullable FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '$dbname' and (character_set_name='latin1' or collation_name like 'latin%')"; 381 $res = $dbi->prepare("$sql"); 382 $res->execute(); 383 $tab=''; 384 while(list($nometab,$campo,$def,$tipo,$nul)=$res->fetch(PDO::FETCH_NUM)) { 385 if($tab!=$nometab){ 386 $sql="alter table $nometab DEFAULT CHARSET=utf8 COLLATE utf8_general_ci"; 387 try{ 388 $res2 = $dbi->prepare("$sql"); 389 $res2->execute(); 390 } 391 catch(PDOException $e) 392 { 393 die( $sql . "<br>" . $e->getMessage()); 394 } 395 $tab=$nometab; echo "Tabella: $nometab<br>"; 396 } 397 if($def!='') $default="DEFAULT '$def'"; else $default=''; 398 if($nul=='NO') $nullable='NOT NULL'; else $nullable='NULL'; 399 $sql="ALTER TABLE $nometab CHANGE $campo $campo $tipo CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' $nullable $default;"; 400 echo "-- $campo<br>"; 401 try{ 402 $res2 = $dbi->prepare("$sql"); 403 $res2->execute(); 404 } 405 catch(PDOException $e) 406 { 407 $default="DEFAULT $def"; 408 $sql="ALTER TABLE $nometab CHANGE $campo $campo $tipo CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' $nullable $default;"; 409 try{ 410 $res2 = $dbi->prepare("$sql"); 411 $res2->execute(); 412 } 413 catch(PDOException $e) 414 { 415 die( $sql . "<br>" . $e->getMessage()); 416 } 417 } 418 } 419 $sql="SELECT table_name FROM INFORMATION_SCHEMA.tables WHERE TABLE_SCHEMA = '$dbname' and table_collation like 'latin%'"; 420 $res = $dbi->prepare("$sql"); 421 $res->execute(); 422 $tab=''; 423 while(list($nometab)=$res->fetch(PDO::FETCH_NUM)) { 424 $sql="alter table $nometab DEFAULT CHARSET=utf8 COLLATE utf8_general_ci"; 425 try{ 426 echo "Tabella: $nometab <br>"; 427 $res2 = $dbi->prepare("$sql"); 428 $res2->execute(); 429 } 430 catch(PDOException $e) 431 { 432 die( $sql . "<br>" . $e->getMessage()); 433 } 434 } 435 echo "<br><br>"; 364 436 ?> -
trunk/admin/modules/Elezioni/ele_spoglio.php
r360 r361 592 592 }elseif(!$errcolor && $numrec) $errcolor="style=\"background-color: #99CC33;\""; 593 593 echo "<td align=\"center\" $errcolor><b> $num_lista </b></td>" 594 ."<td align=\"left\" onClick=\"vai_lista('id_rif$i');\"><b>$descr_lista</b></td>";594 ."<td align=\"left\" style=\"cursor: pointer;\" onClick=\"vai_lista('id_rif$i');\"><b>$descr_lista</b></td>"; 595 595 ## $cond_sele="and id_lista=$id_lista3"; 596 596 echo "<td align=\"right\"><input name=\"voti$i\" value=\"".$voti."\" size=\"7\" onfocus=\"select();\" style=\"text-align:right; $bordcolor;\"><input id=\"id_rif$i\" type=\"hidden\" name=\"id_lista$i\" value=\"$id_lista3\">"; -
trunk/admin/modules/Elezioni/ele_voti.php
r360 r361 91 91 92 92 93 if (!$res->rowCount()) die("Errore, non trovo circoscrizioni inserite! Consultare l'amministratore"); 93 if (!$res->rowCount()) die("Errore, non trovo circoscrizioni inserite! Consultare l'amministratore"); 94 94 list($id_circ)=$res->fetch(PDO::FETCH_NUM); 95 95 $_SESSION['id_circ']=$id_circ; 96 96 } 97 $sql="select id_sede from ".$prefix."_ele_sede where id_circ='$id_circ'"; 97 $sql="select id_sede from ".$prefix."_ele_sede where id_circ='$id_circ'"; 98 98 $result = $dbi->prepare("$sql"); 99 99 $result->execute(); … … 307 307 $rese->execute(); 308 308 $id_comune=$_SESSION['id_comune']; 309 $bordoa=''; 310 $bordog=''; 311 $bordol=''; 309 $bordoini="style='cursor: pointer;"; 310 $errbordoa=''; 311 $errbordog=''; 312 $errbordol=''; 312 313 while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) { 313 if ($tipo=='affluenze') $bordoa="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 314 if ($tipo=='gruppo' or $tipo=='referendum') $bordog="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 315 if ($tipo=='lista') $bordol="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\""; 316 } 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);"; 317 } 318 $bordoa=$bordoini.$errbordoa."'"; 319 $bordog=$bordoini.$errbordog."'"; 320 $bordol=$bordoini.$errbordol."'"; 317 321 echo "<SCRIPT type=\"text/javascript\">\n"; 318 322 echo "function vai_scelta(idrif){\n"; -
trunk/admin/temi/Futura2/index.php
r360 r361 32 32 33 33 list($id_sez) = $res->fetch(PDO::FETCH_NUM);#include("TEST:$id_sez:$sql:"); 34 if (!$id_sez) { 35 $BASE=substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['REQUEST_URI'], "/")-18); 36 Header("Location: ".$BASE."admin.php?op=logout&msglogout=4"); 34 37 38 } 35 39 if(isset($row[0])) { 36 40 $tipo_cons=$row[0]; $descr_cons=$row[1]; $id_cons_gen=$row[2]; … … 109 113 $rese = $dbi->prepare("$sql"); 110 114 $rese->execute(); 111 $bordoa=''; 112 $bordog=''; 113 $bordol=''; 115 $bordoini="style='cursor: pointer;"; 116 $errbordoa=''; 117 $errbordog=''; 118 $errbordol=''; 114 119 while (list($tipo)=$rese->fetch(PDO::FETCH_NUM)) { 115 if ($tipo=='affluenze') $ bordoa="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";116 if ($tipo=='gruppo' or $tipo=='referendum') $ bordog="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";117 if ($tipo=='lista') $ bordol="style=\"border: 6px solid; border-color: rgb(255, 0, 0);\"";120 if ($tipo=='affluenze') $errbordoa="border: 6px solid; border-color: rgb(255, 0, 0);"; 121 if ($tipo=='gruppo' or $tipo=='referendum') $errbordog="border: 6px solid; border-color: rgb(255, 0, 0);"; 122 if ($tipo=='lista') $errbordol="border: 6px solid; border-color: rgb(255, 0, 0);"; 118 123 } 124 $bordoa=$bordoini.$errbordoa."'"; 125 $bordog=$bordoini.$errbordog."'"; 126 $bordol=$bordoini.$errbordol."'"; 119 127 if($rese->rowCount()) $segna="style=\"background-color: #dd0000;\""; else $segna=''; 120 128 if($ops=="4" ) {$bgcolorg="yellow"; $tcolorg='blue';} else {$bgcolorg="grey"; $tcolorg='white';} #$active_gruppo=" class=\"ui-btn-active\""; else $active_gruppo=''; -
trunk/admin/versione.php
r360 r361 1 1 <?php 2 2 3 $versione = "3.0 rev 36 0";3 $versione = "3.0 rev 361"; 4 4 $version_number = $versione; 5 $datarel = "1 4marzo 2022";5 $datarel = "17 marzo 2022"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7 -
trunk/client/versione.php
r360 r361 1 1 <?php 2 2 3 $versione = "3.0 rev 36 0";3 $versione = "3.0 rev 361"; 4 4 $version_number = $versione; 5 $datarel = "1 4marzo 2022";5 $datarel = "17 marzo 2022"; 6 6 $version = "Eleonline $version_number (<i>Data Release: $datarel</i>)"; 7 7
Note:
See TracChangeset
for help on using the changeset viewer.