コード例 #1
0
<?php

$status = 'NO';
$resultados = null;
try {
    include_once '../../config.php';
    if (isset($_SESSION['idPessoaProprietario'])) {
        $tipoAnuncio = new AnuncioTipo(Conf::pegCnxPadrao());
        $tipoAnuncio->setDescricao($_POST['consulta']);
        $resultados = $tipoAnuncio->consultar();
        $status = sizeof($resultados) > 0 ? 'OK' : 'NO';
    }
} catch (PDOException $e) {
    $status = 'ERRO';
}
echo json_encode(array('status' => $status, 'resultados' => $resultados));