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.
54 righe
2.4 KiB
54 righe
2.4 KiB
<? |
|
$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_impostazioni_dati_minimi WHERE soft_delete = 'N' "; |
|
$risultati = $pdo->go($sql,$bind); |
|
if ($risultati->rowCount() > 0) { |
|
if ($_GET["length"] !== "-1") { $sql.= "LIMIT ". (int)$_GET["start"] .", " . (int)$_GET["length"]; } |
|
$risultati = $pdo->go($sql,$bind); |
|
if ($risultati->rowCount() > 0) { |
|
$return["recordsFiltered"] = $return["recordsTotal"]; |
|
$return["data"] = array(); |
|
$tipologie = getTipologieAffidamento(false); |
|
while($record = $risultati->fetch(PDO::FETCH_ASSOC)) { |
|
$stato = "bg-danger"; |
|
$stato_label = __('disattivo'); |
|
if ($record["attivo"]=="S") { |
|
$stato = "bg-success"; |
|
$stato_label = __('attivo'); |
|
} |
|
$record["tipologie"] = json_decode($record["tipologie"],true); |
|
$row = array(); |
|
$row[] = '<div id="flag_'.$record["codice"].'" class="status_flag '.$stato.'"><span class="sr-only">'.$stato_label.'</span></div>'; |
|
$row[] = $record["titolo"]; |
|
$row[] = $record["tipo"]; |
|
ob_start(); |
|
foreach($record["tipologie"] AS $idTipo) { |
|
echo $tipologie[$idTipo]["titolo"] ?? "errore"; |
|
echo "<br>"; |
|
} |
|
$row[] = ob_get_clean(); |
|
$row[] = $record["obbligatorio"]; |
|
$row[] = "<button onClick=\"showModalWithURL('/backend/dati-gara/edit.php?codice={$record["codice"]}')\" title='".__("modifica")."' class='btn-info btn btn-sm' style='padding-top:6px;'><span class='fa fa-pencil-alt'></span></a>"; |
|
$row[] = "<button title='".__("disabilita")."' class='btn btn-sm btn-warning' onclick='disabilita(".$record["codice"].",\"dati-gara\");'><span class='fa fa-sync'></span></button>"; |
|
$return["data"][] = $row; |
|
} |
|
} else { |
|
$return["data"] = array(); |
|
} |
|
} else { |
|
$return["error"] = "No record"; |
|
} |
|
|
|
echo json_encode($return); |
|
} |
|
} |
|
?>
|
|
|