Ejemplo n.º 1
0
    public function RelManifestacao($data_inicial, $data_final)
    {
        require_once "../modelo/manifestacao.cls.php";
        require_once "../controle/data.gti.php";
        $man = new clsManifestacao();
        $data = new gtiData();
        $data_inicial = implode("-", array_reverse(explode("/", $data_inicial)));
        $data_final = implode("-", array_reverse(explode("/", $data_final)));
        $con = new gtiConexao();
        $con->gtiConecta();
        $SQL = 'SELECT 
			manifestacao_id 
			FROM 
			vw_manifestacao
			WHERE
			data_criacao >= \'' . $data_inicial . '\'
			AND 
			data_criacao <= \'' . $data_final . '\'
			ORDER BY data_criacao;
			;';
        $tbl = $con->gtiPreencheTabela($SQL);
        $con->gtiDesconecta();
        $cont = 0;
        $rel = array();
        foreach ($tbl as $chave => $linha) {
            $i = 0;
            $man->SetCodigo($linha['manifestacao_id']);
            $man->ConsultarPorCodigo();
            $rel[$cont][$i++] = $cont + 1;
            $rel[$cont][$i++] = $man->GetCodigo();
            $rel[$cont][$i++] = $data->ConverteDataBR($man->GetDataCriacao());
            $rel[$cont][$i++] = utf8_decode($man->GetTipo());
            switch ($man->GetIdentificacao()) {
                case 'S':
                    $rel[$cont][$i++] = 'Sigiloso';
                    $rel[$cont][$i++] = utf8_decode($man->GetNome());
                    break;
                case 'I':
                    $rel[$cont][$i++] = 'Identificado';
                    $rel[$cont][$i++] = utf8_decode($man->GetNome());
                    break;
                default:
                    $rel[$cont][$i++] = 'Anônimo';
                    $rel[$cont][$i++] = utf8_decode('N&atilde;o Informado');
                    break;
            }
            $rel[$cont][$i++] = utf8_decode($man->GetAssunto());
            $rel[$cont][$i++] = utf8_decode($man->GetDepartamentosSimples());
            $rel[$cont][$i++] = utf8_decode($man->GetClientela());
            $rel[$cont][$i++] = utf8_decode($man->GetStatus());
            $cont++;
        }
        return $rel;
    }