permission($id_modulo)) { $bind = [":codice_gestore"=>$_SESSION["ente"]->codice]; $sql_d = "SELECT count(codice) AS totale, stato FROM b_gare WHERE codice > 0 "; if (!$_SESSION["utente"]->fromHere()) { $sql_d .= " AND codice_ente = :codice_ente"; $bind[":codice_ente"] = $_SESSION["utente"]->codice_ente; } $ris_d = $pdo->go($sql_d." GROUP BY stato ORDER BY stato",$bind); if ($ris_d->rowCount() > 0) { $totale = 0; $ris_d = $ris_d->fetchAll(PDO::FETCH_ASSOC); foreach($ris_d AS $gareTotale) { $totale += $gareTotale["totale"]; } $stati = gara::getStati(); ob_start(); ?>