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.
87 righe
2.4 KiB
87 righe
2.4 KiB
|
|
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
$id_modulo = "contratti.documentale"; |
|
|
|
if (!empty($_GET['codice_contratto']) && !empty($_GET['soggetto']) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_contratto"]) && $_SESSION["utente"]->permission($id_modulo)) { |
|
|
|
$contratto = stipula::init($_GET['codice_contratto']); |
|
|
|
if(!empty($contratto)){ |
|
|
|
$return = array(); |
|
$return["draw"] = (int)$_GET["draw"]; |
|
$return["recordsTotal"] = (int)0; |
|
$return["recordsFiltered"] = (int)0; |
|
|
|
switch($_GET["order"][0]["column"]) { |
|
case "0": |
|
null ; |
|
break; |
|
case "1": |
|
null ; |
|
break; |
|
case "2": |
|
null ; |
|
break; |
|
case "3": |
|
null; |
|
break; |
|
case "4": |
|
$orderKey = 'timestamp_creazione'; |
|
break; |
|
} |
|
|
|
if ($_GET["order"][0]["dir"] == "desc") { |
|
$orders[$orderKey] = "DESC"; |
|
} else { |
|
$orders[$orderKey] = "ASC"; |
|
} |
|
|
|
$soggetto = $_GET['soggetto']; |
|
|
|
$soggetti = $contratto->getSoggetti($soggetto, null, $_GET['codice_oe']); |
|
|
|
if(!empty($soggetti)){ |
|
$return["recordsTotal"] = (int)count($soggetti); |
|
|
|
foreach ($soggetti as $soggetto) { |
|
|
|
|
|
$row = array(); |
|
|
|
$row[] = "<span> $soggetto[nome] " . $soggetto['cognome'] ?? null . " </span>"; |
|
$row[] = "<span>$soggetto[id_univoco]</span>"; |
|
|
|
ob_start(); |
|
foreach ($soggetto['ruoli'] as $ruolo) { |
|
?> |
|
<p><?= $ruolo ?></p> |
|
<? |
|
} |
|
$row[] = ob_get_clean(); |
|
$row[] = "<span>".oeManager::getOE($soggetto['codice_oe'])['ragione_sociale'] ?? null ."</span>"; |
|
$row[] = "<button type='button' onclick='showModalWithURL(\"/backend/contratti/documentale/dettagliSoggettoAssociato.php?codice_contratto={$contratto->info['codice']}&codice_soggetto_oe={$soggetto['codice']}\")' class='btn btn-primary btn-sm'><span class='fa fa-search'></span></button>"; |
|
|
|
$return["data"][] = $row; |
|
} |
|
|
|
$return["recordsFiltered"] = (int)count($soggetti); |
|
|
|
}else{ |
|
$return["data"] = array(); |
|
} |
|
|
|
}else{ |
|
$return["data"] = array(); |
|
} |
|
|
|
|
|
|
|
|
|
echo json_encode($return); |
|
} |
|
|
|
?>
|