Public function PesquisaClienteGrupo($pesquisa) { $String = new CString(); $resultado = parent::ListaEmpresaGrupos($String->convertem($pesquisa, 1)); echo json_encode($resultado); }
Public function PesquisaClienteGrupo($pesquisa) { $String = new CString(); //recebo o paametro vindo do form $parametro = isset($_POST['pesquisaClienteCategoria']) ? $_POST['pesquisaClienteCategoria'] : null; $msg = ""; //começo a concatenar a tabela $msg .= "<table class='table table-hover tablePesquisaClienteGrupo' id='tabela' border='1'>"; $msg .= " <thead>"; $msg .= " <tr >"; $msg .= " <th>Cód</th>"; $msg .= " <th>Tipo</th>"; $msg .= " <th class='EmpresaGrupo' ><a href='#'>Nome</a></th>"; $msg .= " </tr>"; $msg .= " </thead>"; $msg .= " <tbody>"; $resultado = parent::ListaEmpresaGrupos($String->convertem($pesquisa, 1)); //resgata os dados na tabela if ($resultado) { foreach ($resultado as $res) { $msg .= "<tr tabindex='0'>"; $msg .= "<td class='cod'>" . $res->getCodFontePagadora() . "</td>"; $msg .= "<td class='tipo'>" . $res->getTipoFontePagadora() . "</td>"; $msg .= "<td class='EmpresaGrupo'><a href='#'>" . $res->getFontePagadora() . "</a></td>"; $msg .= "</tr>"; } } else { $msg = ""; $msg .= "Nenhum resultado foi encontrado..."; ?> <script> $("#pesquisaClienteCategoria").val(''); </script> <?php } $msg .= " </tbody>"; $msg .= "</table>"; //retorna a msg concatenada echo $msg; }