Changeset 406 for trunk/admin
- Timestamp:
- Feb 28, 2024, 3:32:10 PM (9 months ago)
- Location:
- trunk/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r400 r406 340 340 if (isset($_GET['id_cons_gen'])) {$id_cons_gen=intval($_GET['id_cons_gen']);} 341 341 else { 342 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));343 $sql="select t1.id_cons_gen from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and t1.data_fine>'$oggi'and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0) limit 0,1"; # TEST: and id_sez>0342 # $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 343 $sql="select t1.id_cons_gen from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and date_add(t1.data_fine, interval 3 day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0) limit 0,1"; # TEST: and id_sez>0 344 344 $rese = $dbi->prepare("$sql"); 345 345 $rese->execute(); … … 370 370 /* Login Function */ 371 371 /*********************************************************/ 372 function ChiSei($id _cons_gen){373 global $dbi, $msglogout ;372 function ChiSei($idcg){ 373 global $dbi, $msglogout, $id_cons_gen; 374 374 375 375 $aid=$_SESSION['aid']; … … 377 377 $pwd=$_SESSION['pwd']; 378 378 $id_comune=$_SESSION['id_comune']; 379 379 #echo "prima: $idcg - dopo: $id_cons_gen<br>"; 380 380 $perms=0; 381 381 $sql="select adminsuper, admincomune, adminop from ".$prefix."_authors where aid='$aid' and pwd='$pwd' and (id_comune='$id_comune' or id_comune=0)"; … … 394 394 elseif($oper) {$msglogout=1; return 0;} # id_cons='$id_cons' and 395 395 else { 396 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));397 $sql="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_cons_gen='$id_cons_gen' and t1.chiusa='0' and t1.id_comune='$id_comune' and t2.data_fine>$oggi";396 # $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 397 $sql="select t1.id_cons, t1.id_cons_gen from ".$prefix."_ele_cons_comune as t1, ".$prefix."_ele_consultazione as t2 where t1.id_cons_gen=t2.id_cons_gen and t1.chiusa='0' and t1.id_comune='$id_comune' and date_add(t2.data_fine, interval 3 day)>CURDATE()"; 398 398 $sth = $dbi->prepare("$sql"); 399 $sth->execute(); #die("TEST: $sql"); 400 if(!$sth->rowCount()) {$msglogout=1; $perms=0; return $perms;} 401 list($id_cons) = $sth->fetch(PDO::FETCH_NUM); 399 $sth->execute(); 400 if(!$sth->rowCount()) { $msglogout=1; $perms=0; return $perms;} 401 list($id_cons,$idcg) = $sth->fetch(PDO::FETCH_NUM); 402 if (!$id_cons_gen) $id_cons_gen=$idcg; 402 403 $sql="select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid'"; 403 404 $sth = $dbi->prepare("$sql"); 404 $sth->execute(); #die("TEST: $sql");405 $sth->execute(); 405 406 list($perms) = $sth->fetch(PDO::FETCH_NUM); 407 return $perms; 406 408 } 407 409 } … … 416 418 417 419 function login() { 418 global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema, $ id_cons_gen, $perms, $msglogout;420 global $param,$prefix,$dbi,$multicomune,$siteistat,$language,$tema, $perms, $msglogout;#, $id_cons_gen 419 421 if (isset($param['id_comune'])) $id_comune=intval($param['id_comune']); 420 422 if (!isset($id_comune)) $id_comune=0; … … 433 435 include ("header.php"); 434 436 echo "<div align=\"middle\"><font class=\"title\"><b>"._GESTIONE."</b></font></center>"; 435 echo "<br>"; # method=\"post\"436 437 if ($msglogout==1) echo "<h1 style=\"color:red;\">Utente non autorizzato</h1><br>"; 437 438 elseif ($msglogout==2) echo "<h1 style=\"color:red;\">Nome Utente non presente in archivio</h1><br>"; … … 506 507 #include("TEST tema: $tema--"); 507 508 #include("modules/Elezioni/language/lang-".$_SESSION['lang'].".php"); 508 509 #die( "$sql <br> TEST id_cons_gen:$id_cons_gen:".$_SESSION['id_cons_gen']); 509 510 if(isset($id_cons_gen) and isset($id_comune)){ 510 if(!isset($id_cons)){ 511 if(!isset($id_cons)){ 511 512 # $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'"; 512 513 $sql = "SELECT id_cons from ".$prefix."_ele_comuni where id_comune='$id_comune'"; … … 531 532 die(); 532 533 } 533 list($id_sez) = $resmod->fetch(PDO::FETCH_NUM); #die("qui:$id_sez:$sql"); 534 if($id_sez) { 535 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 536 $sql="select t1.id_cons_gen,t1.descrizione,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_comune=$id_comune and t1.data_fine>'$oggi' and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and id_sez>0 and permessi>0)"; 534 list($id_sez) = $resmod->fetch(PDO::FETCH_NUM); 535 if($id_sez) { 536 $sql="select t1.id_cons_gen,t1.descrizione,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_comune=$id_comune and date_add(t1.data_fine, interval 3 day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and id_sez>0 and permessi>0)"; 537 537 $resmod = $dbi->prepare("$sql"); 538 538 $resmod->execute(); 539 539 if ($resmod->rowCount()>0) { 540 $tema='Futura2'; #die( "TEST id_cons:$id_cons:".$_SESSION['aid']); 540 list($id_cons_gen, $desc,$id_cons)=$resmod->fetch(PDO::FETCH_NUM); 541 $tema='Futura2'; 541 542 $_SESSION['tema']=$tema; 542 543 } #else {die("TEST: $sql"); logout();} 543 544 } 544 } 545 $perms=ChiSei($id_cons_gen); #die("qui".$_SESSION['aid']);545 } 546 $perms=ChiSei($id_cons_gen); 546 547 if($perms==0) {logout();} 547 548 } … … 551 552 //if (isset($param['op'])) $op=$param['op']; else $op='ele'; 552 553 # 553 #die("TEST: qui $aid $id_cons $id_sez ".$_SESSION['aid']);554 #die("TEST: qui2 op:$op - $aid $id_cons $id_sez ".$_SESSION['aid']); 554 555 555 556 if (isset($_SESSION['aid']) AND $_SESSION['remote']==$_SERVER['REMOTE_ADDR']) { -
trunk/admin/modules/Elezioni/query.sql
r400 r406 1 <?php1 <?php 2 2 3 3 if (!defined('ADMIN_FILE')) { … … 66 66 else 67 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 $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 date_add(t1.data_fine, interval 3 day)>CURDATE() and t3.aid='$aid' order by t1.data_fine desc limit 0,1 "; 69 69 70 } 70 71 $sth = $dbi->prepare("$sql"); … … 96 97 { 97 98 global $perms,$dbi,$prefix,$currentlang,$aid,$id_comune; 98 if ($perms<128) { 99 $sql="select t3.id_cons, t2.descrizione,t4.genere, t2.id_cons_gen, t3.chiusa from ".$prefix."_ele_operatori as t1, ".$prefix."_ele_consultazione as t2, ".$prefix."_ele_cons_comune as t3, ".$prefix."_ele_tipo as t4 where t4.lingua='$currentlang' and t2.tipo_cons=t4.tipo_cons and t1.aid='$aid' and t1.permessi>0 and t3.id_cons_gen=t2.id_cons_gen and (t1.id_cons=t3.id_cons or t1.permessi=64) and t1.id_comune=t3.id_comune and t1.id_comune=$id_comune and t3.chiusa='0' order by t2.data_inizio desc"; 99 100 if ($perms<64) { 101 $sql="select t2.id_cons,t1.descrizione,t4.genere,t1.id_cons_gen,t2.chiusa from ".$prefix."_ele_consultazione as t1, ".$prefix."_ele_cons_comune as t2, ".$prefix."_ele_tipo as t4 where t1.id_cons_gen=t2.id_cons_gen and t2.id_comune=$id_comune and t1.tipo_cons=t4.tipo_cons and date_add(t1.data_fine, interval 3 day)>CURDATE() and t2.id_cons in (select id_cons from ".$prefix."_ele_operatori where aid='$aid' and permessi>0)"; 102 } 103 elseif ($perms<128) { 104 $sql="select t3.id_cons, t2.descrizione,t4.genere, t2.id_cons_gen, t3.chiusa from ".$prefix."_ele_operatori as t1, ".$prefix."_ele_consultazione as t2, ".$prefix."_ele_cons_comune as t3, ".$prefix."_ele_tipo as t4 where t4.lingua='$currentlang' and t2.tipo_cons=t4.tipo_cons and t1.aid='$aid' and t1.permessi>0 and t3.id_cons_gen=t2.id_cons_gen and (t1.id_cons=t3.id_cons or t1.permessi=64) and t1.id_comune=t3.id_comune and t1.id_comune=$id_comune order by t2.data_inizio desc"; 100 105 }else{ 101 106 $sql="SELECT '', t1.descrizione,t2.genere, t1.id_cons_gen,'' FROM ".$prefix."_ele_consultazione as t1,".$prefix."_ele_tipo as t2 where t2.lingua='$currentlang' and t1.tipo_cons=t2.tipo_cons order by t1.data_inizio desc"; 102 } 107 } #die("$sql"); 103 108 $sth = $dbi->prepare("$sql"); 104 109 $sth->execute(); -
trunk/admin/versione.php
r405 r406 1 1 <?php 2 2 3 $versione = "3.0 rev 40 5";3 $versione = "3.0 rev 406"; 4 4 $version_number = $versione; 5 5 $datarel = "28 febbraio 2024";
Note:
See TracChangeset
for help on using the changeset viewer.