$bind = array();
$gerarchia_massima = 100;
if (!isset($_SESSION["ente"])) {
$gerarchia_minima = 0;
$sql = "SELECT b_utenti.codice FROM b_utenti WHERE ";
} else {
$gerarchia_minima = 9;
$bind[":codice"] = $_SESSION["ente"]->codice;
$sql = "SELECT b_utenti.codice FROM b_utenti
JOIN r_collaborazioni ON b_utenti.codice = r_collaborazioni.codice_utente
JOIN b_enti ON r_collaborazioni.codice_ente = b_enti.codice ";
if ($_SESSION["utente"]->fromHere()) {
$bind[":codice"] = $_SESSION["ente"]->codice;
$sql .= "WHERE (b_enti.codice = :codice OR b_enti.sua = :codice) AND ";
} else {
$bind[":codice"] = $_SESSION["utente"]->codice_ente;
$sql .= "WHERE (b_enti.codice = :codice) AND ";
}
$sql .= " r_collaborazioni.monitoraggio = 'N' AND ";
}
$i = 0;
$ruoli = utente::ruoli();
$where = [];
foreach($ruoli AS $id => $ruolo) {
$i++;
if ($ruolo["gerarchia"] > $gerarchia_minima && $ruolo["gerarchia"] < $gerarchia_massima) {
$bind[":ruolo{$i}"] = $id;
$where[] = " b_utenti.ruolo = :ruolo{$i} ";
}
}
if (count($where) > 0) {
$sql .= "(" . implode(" OR ",$where) . ")";
}
$ris_utenti = $pdo->go($sql,$bind);
if ($ris_utenti->rowCount() > 0) {
?>
|
# |
= __("Cognome") ?> |
= __("Nome") ?> |
= __("E-mail") ?> |
= __("Ruolo") ?> |
if ($certificabili) { ?>
= __("Certificato") ?> |
} ?>
|
if ($_SESSION["utente"]->isSupportoOrRoot()) { ?> | | } ?>
} else {
alertManager::printWarningBox(__("Nessun risultato"));
}
?>