Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
31 righe
1.1 KiB
31 righe
1.1 KiB
<? |
|
if (!isset($root)) { |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!$_SESSION["utente"]->check(true)) { die(); } |
|
} |
|
if (!empty($_SESSION["utente"])) { |
|
$badge = 0; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice,$_SESSION["utente"]->codice,"gare"); |
|
$ids = implode(",",$ids); |
|
} |
|
$bind_bad = []; |
|
$sql_bad = "SELECT SUM(b_gare.badge) AS totale |
|
FROM b_gare |
|
WHERE b_gare.codice > 0 "; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$sql_bad .= " AND b_gare.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 "<span data-target='/backend/gare/badge.php' class='badge badge-danger badge-count'>" . $badge . "</span>"; |
|
} |
|
} |
|
|
|
?>
|
|
|