$contratto->info['codice'], 'codice_classe_documentale' => $_GET['codice_classe_documentale'] ]; switch($_GET["order"][0]["column"]) { case "0": null ; break; case "1": null ; break; case "2": null ; break; case "3": null; break; case "4": null; break; case "5": $orderKey = 'timestamp_creazione'; break; } if ($_GET["order"][0]["dir"] == "desc") { $orders[$orderKey] = "DESC"; } else { $orders[$orderKey] = "ASC"; } $richieste = RichiestaDocumentale::getRichieste($filters, $orders); $classe_documentale = ContrattoDocumentale::getInfo($_GET['codice_classe_documentale'])->info; if (!empty($richieste)) { $return["recordsTotal"] = (int)count($richieste); $richieste = rispostaDocumentale::getBadge($contratto->info['codice'], $richieste, "sa"); $countRecordFiltered = 0; foreach($richieste as $richiesta) { $oe = oeManager::getOE($richiesta['codice_oe']); $row = array(); $row[] = ""; $row[] = "". $classe_documentale['titolo'] .""; if (!empty($oe['codice'])) { $row[] = "". $oe['ragione_sociale'] .""; } $row[] = "
". ($richiesta['bloccante'] == 'S') ? __('Si') : __('No') ."
"; $row[] = "" . mysql2datetime($richiesta["timestamp_creazione"]) . ""; if (!empty($richiesta['statoLabel'])) { $row[] = "". __($richiesta['statoLabel']['titolo']) . ""; }elseif(!empty($richiesta['statoBadges'])){ ob_start(); foreach ($richiesta['statoBadges'] as $stat => $value) { ?> '> ". __('Errore visualizzazione Stati').""; } $row[] = ""; if(!empty($_GET['stato'])){ if (!empty($richiesta['statoLabel']) && $richiesta['statoLabel']['key'] == $_GET['stato'] ) { $countRecordFiltered++; $return["data"][] = $row; }elseif(!empty($richiesta['statoBadges']) && $richiesta['statoBadges'][$_GET['stato']]['contatori'] > 0){ $countRecordFiltered++; $return["data"][] = $row; } }else{ $countRecordFiltered++; $return["data"][] = $row; } } $return["recordsFiltered"] = (int)$countRecordFiltered; }else { $return["data"] = array(); } }else{ $return["data"] = array(); } echo json_encode($return); } ?>