} $sOrder = substr_replace($sOrder, "", -2); if ($sOrder == " ORDER BY ") { $sOrder = ""; } } $sWhere = ""; if (isset($_GET['sSearch']) && $_GET['sSearch'] != "") { $sWhere = " and ("; for ($i = 0; $i < count($aColumns); $i++) { $sWhere .= $aColumns[$i] . "::text ILIKE '%" . $_GET['sSearch'] . "%' OR "; } $sWhere = substr_replace($sWhere, "", -3); $sWhere .= ')'; } $total = $certificado->getNumeroFilasCertificados2($sWhere); $sCondicion = $sWhere . $sOrder . $sLimit; //$paginado = $persona->getNumeroFilas($sCondicion, $_GET['condiciongarante']); $paginado = $certificado->getNumeroFilasCertificados2($sCondicion); //$id_entidad = $_GET['identidad']; $registrosCertificados = $certificado->listaCertificados($sCondicion); //print_r($registrosCertificados); if ($registrosCertificados == "[]") { $json = $registrosCertificados; } else { $json = json_encode($registrosCertificados); } //echo $json;exit(); echo '{"sEcho":' . intval($_GET['sEcho']) . ', "iTotalRecords":' . $paginado . ', "iTotalDisplayRecords":' . $total . ',"aaData": ' . $json . ' }'; break; case "getCertificado":