entiBeneficiari(); $return = array(); $return["draw"] = (int)$_GET["draw"]; $return["recordsTotal"] = (int)0; $return["recordsFiltered"] = (int)0; $filters = []; if (isset($_GET["stato"]) && $_GET["stato"]!=="") { $filters["b_concorsi.stato"] = $_GET["stato"]; } $total = publicConcorso::getList($_SESSION["ente"]->codice,$filters,[],0,-1); if (!empty($total)) { $return["recordsTotal"] = (int)count($total); if (!empty($_GET["search"]["value"])) { $filters["*"] = $_GET["search"]["value"]; } if (isset($_GET["ente"]) && $_GET["ente"]!=="") { $filters["b_concorsi.codice_ente"] = $_GET["ente"]; } $order = null; $orderKey = "b_concorsi.codice"; switch($_GET["order"][0]["column"]) { case "2": $orderKey = "b_concorsi.codice"; break; case "4": $orderKey = "b_concorsi.oggetto"; break; case "5": $orderKey = "b_concorsi_round.pubblicazione"; break; case "6": $orderKey = "b_concorsi_round.scadenza"; break; } if ($_GET["order"][0]["dir"] == "desc") { $order[$orderKey] = "DESC"; } else { $order[$orderKey] = "ASC"; } $risultati = publicConcorso::getList($_SESSION["ente"]->codice,$filters,$order,$_GET["start"],$_GET["length"]); if (count($risultati) > 0) { if (!empty($_GET["search"]["value"])) { $return["recordsFiltered"] = (int)count($risultati); } else { $return["recordsFiltered"] = $return["recordsTotal"]; } $return["data"] = array(); $stati = concorso::getStati(); $update_scadute = $pdo->prepare("UPDATE b_concorsi SET stato = 21 WHERE codice = :codice AND stato = 20"); $tipologie = getTipologieAffidamento(); $procedure = getProcedure(); foreach($risultati AS $record) { if (!empty($record["scadenza"]) && ($record["fase_attiva"] == $record["numero"]) && strtotime($record["scadenza"]) < time() && $record["stato"] == 20) { $update_scadute->execute([":codice"=>$record["codice"]]); $record["stato"] = 21; } $stato = $stati[$record["stato"]]; $row = array(); $row[] = '
'; $row[] = __($stato["titolo"]); $row[] = $record["id"]; $row[] = str_replace(",","
",$record["cig"]); $path = "/concorsi/dettaglio.php?codice={$record["codice"]}"; ob_start(); ?> 1) { $row[] = $enti[$record["codice_ente"]]["denominazione"] ?? ""; } $row[] = "" . __("Dettagli") . ""; $return["data"][] = $row; } } else { $return["data"] = array(); } } else { $return["data"] = array(); } echo json_encode($return); } ?>