check(true)) { die(); } } if (!empty($_SESSION["utente"])) { $badge = 0; if ($_SESSION["utente"]->gerarchia > 10) { $ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice,$_SESSION["utente"]->codice,"concorsi"); $ids = implode(",",$ids); } $bind_bad = []; $sql_bad = "SELECT SUM(b_concorsi.badge) AS totale FROM b_concorsi WHERE b_concorsi.codice > 0 "; if ($_SESSION["utente"]->gerarchia > 10) { $sql_bad .= " AND b_concorsi.codice IN ({$ids}) "; } if (!$_SESSION["utente"]->fromHere()) { $sql_bad .= " AND codice_ente = :codice_ente"; $bind_bad[":codice_ente"] = $_SESSION["utente"]->codice_ente; } $ris_badge = $pdo->go($sql_bad,$bind_bad); $badge += $ris_badge->fetch(PDO::FETCH_COLUMN); if ($badge > 0) { echo "" . $badge . ""; } } ?>