$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; include_once($configPath); if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { if (isset($_GET["draw"])) { $return = array(); $return["draw"] = (int)$_GET["draw"]; $return["recordsTotal"] = (int)0; $return["recordsFiltered"] = (int)0; $bind = array(); $sql = "SELECT * FROM b_form WHERE soft_delete = 'N' "; if (!empty($_SESSION["ente"]->codice)) { $sql .= " AND codice_ente = :codice_ente "; $bind[":codice_ente"] = $_SESSION["ente"]->codice; } else { $sql .= " AND codice_ente = 0 "; } $ris_utenti = $pdo->go($sql,$bind); if ($ris_utenti->rowCount() > 0) { $return["recordsTotal"] = (int)$ris_utenti->rowCount(); $filterApplied = false; if (!empty($_GET["search"]["value"])) { $filterApplied = true; $sql .= " AND ( "; $suddivisione = suddivisione_pdo($_GET["search"]["value"],"id"); $sql .= "(" . $suddivisione["sql"] . ") "; $bind = array_merge($bind,$suddivisione["bind"]); $sql .= ") "; } $order = "id ASC "; $sql .= "ORDER BY " . $order; if ($_GET["length"] !== "-1") { $sql.= "LIMIT ". (int)$_GET["start"] .", " . (int)$_GET["length"]; } $ris_utenti = $pdo->go($sql,$bind); if ($ris_utenti->rowCount() > 0) { if ($filterApplied) { $return["recordsFiltered"] = (int)$ris_utenti->rowCount(); } else { $return["recordsFiltered"] = $return["recordsTotal"]; } $return["data"] = array(); while($record = $ris_utenti->fetch(PDO::FETCH_ASSOC)) { $stato = "bg-disabled"; $stato_label = __('disattivo'); if ($record["attivo"]=="S") { $stato = "bg-active"; $stato_label = __('attivo'); } $row = array(); $row[] = '