public function localizarPropostaAction() { $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); $get = Zend_Registry::get('get'); $idAgente = $get->idAgente; $tblPreProjeto = new PreProjeto(); $rsPreProjeto = $tblPreProjeto->listarPropostasResultado($this->idAgente, $this->idResponsavel, $idAgente); $arrPropostas = array(); $i = 0; $x = 0; $identificadores = array(); foreach ($rsPreProjeto as $prop) { if (!in_array($prop->idAgente . $prop->idPreProjeto, $identificadores)) { $arrPropostas[$x]['CNPJCPF'] = $prop->CNPJCPF; $arrPropostas[$x]['idAgente'] = $prop->idAgente; $arrPropostas[$x]['NomeProponente'] = utf8_encode($prop->NomeProponente); $arrPropostas[$x]['idPreProjeto'] = $prop->idPreProjeto; $arrPropostas[$x]['NomeProjeto'] = utf8_encode($prop->NomeProjeto); $x++; } $identificadores[$i] = $prop->idAgente . $prop->idPreProjeto; $i++; } if (count($rsPreProjeto) > 0) { $this->montaTela("manterpropostaincentivofiscal/localizarproposta.phtml", array("propostas" => $arrPropostas)); } else { echo "<table class='tabela'><tr><td class='centro'>Não foi encontrado nenhum registro.</td></tr></table>"; } }