Changeset 400 for trunk/admin/admin.php
- Timestamp:
- Feb 25, 2024, 3:57:45 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin.php
r397 r400 387 387 $admincomune=$row[1]; 388 388 $oper=$row[2]; 389 390 #if (($adminsuper==1 || $admincomune==1 || $adminop==1)) {391 389 if ($adminsuper==1) 392 390 return 256; … … 397 395 else { 398 396 $oggi=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); 399 $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)";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"; 400 398 $sth = $dbi->prepare("$sql"); 401 399 $sth->execute(); #die("TEST: $sql"); 402 if($sth->rowCount()) {$perms=16; return $perms;} 403 else {$msglogout=1; return 0;} 404 } 405 /* $sth = $dbi->prepare("select id_cons from ".$prefix."_ele_cons_comune where id_comune='$id_comune' and id_cons_gen='$id_cons_gen'"); 406 $sth->execute(); 407 $row = $sth->fetch(PDO::FETCH_BOTH); 408 $id_cons=$row[0]; 409 $sth = $dbi->prepare("select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid' and id_comune='$id_comune'"); 410 411 $sth->execute(); 412 list($perms)=$sth->fetch(PDO::FETCH_NUM); 413 # $row = die("test:$sql".$row[0] ); 414 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; } 415 416 return $perms; */ 417 #} else return 0; 400 if(!$sth->rowCount()) {$msglogout=1; $perms=0; return $perms;} 401 list($id_cons) = $sth->fetch(PDO::FETCH_NUM); 402 $sql="select permessi from ".$prefix."_ele_operatori where id_cons='$id_cons' and aid='$aid'"; 403 $sth = $dbi->prepare("$sql"); 404 $sth->execute(); #die("TEST: $sql"); 405 list($perms) = $sth->fetch(PDO::FETCH_NUM); 406 } 418 407 } 419 408
Note:
See TracChangeset
for help on using the changeset viewer.