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.
62 righe
2.1 KiB
62 righe
2.1 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (isset($_GET["draw"]) && isset($_GET["codice_operatore"]) && isset($_SESSION["utente"])) { |
|
|
|
$return = array(); |
|
$return["draw"] = (int)$_GET["draw"]; |
|
$return["recordsTotal"] = (int)0; |
|
$return["recordsFiltered"] = (int)0; |
|
|
|
$total = Communicator::listMessageOE($_GET["codice_operatore"],false,[],[],0,-1); |
|
if (!empty($total)) { |
|
$return["recordsTotal"] = (int)count($total); |
|
$filters = []; |
|
if (!empty($_GET["search"]["value"])) { |
|
$filters["*"] = $_GET["search"]["value"]; |
|
} |
|
|
|
$order = []; |
|
$orderKey = "data"; |
|
switch($_GET["order"][0]["column"]) { |
|
case "0": $orderKey = "letto"; break; |
|
case "2": $orderKey = "timestamp"; break; |
|
} |
|
if ($_GET["order"][0]["dir"] == "desc") { |
|
$order[$orderKey] = "DESC"; |
|
} else { |
|
$order[$orderKey] = "ASC"; |
|
} |
|
$comunicazioni = Communicator::listMessageOE($_GET["codice_operatore"],false,$filters,$order,$_GET["start"],$_GET["length"]); |
|
if (count($comunicazioni) > 0) { |
|
$return["recordsFiltered"] = $return["recordsTotal"]; |
|
$return["data"] = array(); |
|
|
|
foreach($comunicazioni AS $comunicazione) { |
|
$row = array(); |
|
ob_start(); |
|
if ($comunicazione["letto"] == "N") { ?> |
|
<strong><span class="fa fa-envelope text-danger"></span> |
|
<? } ?> |
|
<a href="#" onClick="showMSG(<?= $comunicazione["codice"] ?>);" title="<?= __('visualizza') ?>"> |
|
<?= $comunicazione["oggetto"] ?> |
|
</a> |
|
<? |
|
if ($comunicazione["letto"] == "N") { ?> |
|
</strong> |
|
<? } |
|
$row[] = ob_get_clean(); |
|
$row[] = Modulo::getInfo($comunicazione["sezione"])["titolo"] ?? ""; |
|
$row[] = mysql2datetime($comunicazione["timestamp"]); |
|
$return["data"][] = $row; |
|
} |
|
} else { |
|
$return["data"] = array(); |
|
} |
|
} else { |
|
$return["data"] = array(); |
|
} |
|
|
|
echo json_encode($return); |
|
} |
|
?>
|
|
|