public function comboAjaxAction() { $this->_helper->layout->disableLayout(); // desabilita o Zend_Layout // recebe o idUF via post $post = Zend_Registry::get('post'); $id = (int) $post->id; // integração MODELO e VISÃO $Municipios = new Municipios(); $result = $Municipios->combo(array('idUFIBGE = ?' => $id)); $a = 0; if (count($result) > 0) { foreach ($result as $registro) { $arrayMunicipios[$a]['id'] = $registro['id']; $arrayMunicipios[$a]['descricao'] = utf8_encode($registro['descricao']); $a++; } $jsonEncode = json_encode($arrayMunicipios); echo json_encode(array('resposta' => true, 'conteudo' => $arrayMunicipios)); } else { echo json_encode(array('resposta' => false)); } die; }
public function alterarlicitacaoAction() { /* =============================================================================== */ /* ==== VERIFICA PERMISSAO DE ACESSO DO PROPONENTE A PROPOSTA OU AO PROJETO ====== */ /* =============================================================================== */ $this->verificarPermissaoAcesso(false, true, false); //$this->_helper->layout->disableLayout(); $this->view->modalidadeConteudo = $this->modalidade; $this->view->tipoLicitacaoConteudo = $this->tipoLicitacao; $this->view->tipoCompraConteudo = $this->tipoCompra; $uf = new Uf(); $this->view->ufConteudo = $uf->buscar(array(), array('Sigla')); $get = Zend_Registry::get('get'); $this->view->idlicitacao = $get->idlicitacao; $this->view->idpronac = $get->idpronac; $this->view->itensVinculados = array(); $this->view->fornecedores = array(); if ($this->view->idlicitacao != '') { $licitacaoDao = new Licitacao(); $resposta = $licitacaoDao->buscarLicitacao($this->view->idlicitacao); $this->view->tipoCompra = $resposta[0]->tpCompra; $this->view->modalidade = $resposta[0]->tpModalidade; $this->view->tipoLicitacao = $resposta[0]->tpLicitacao; $this->view->nrProcesso = $resposta[0]->nrProcesso; $this->view->nrLicitacao = $resposta[0]->nrLicitacao; $this->view->objeto = $resposta[0]->dsObjeto; $this->view->fundamentoLegal = $resposta[0]->dsFundamentoLegal; $this->view->dataPublicacaoEdital = date('d/m/Y', strtotime($resposta[0]->dtPublicacaoEdital)); $this->view->dataAberturaLicitacao = date('d/m/Y', strtotime($resposta[0]->dtAberturaLicitacao)); $this->view->dataEncerramentoLicitacao = date('d/m/Y', strtotime($resposta[0]->dtEncerramentoLicitacao)); $this->view->valorLicitacao = $resposta[0]->vlLicitacao; $this->view->dataHomologacao = date('d/m/Y', strtotime($resposta[0]->dtHomologacao)); $this->view->codigoMunicipio = $resposta[0]->cdMunicipio; $this->view->dsMunicipio = $resposta[0]->dsMunicipio; $this->view->uf = $resposta[0]->UF; $this->view->justificativa = $resposta[0]->dsJustificativa; $licitacaoxagentesDao = new Licitacaoxagentes(); $this->view->fornecedores = $licitacaoxagentesDao->buscarFornecedoresLicitacao($this->view->idlicitacao); $tbLicitacaoPlanilhaAprovacao = new Licitacaoxplanilhaaprovacao(); $this->view->itensVinculados = $tbLicitacaoPlanilhaAprovacao->itensVinculados($this->view->idlicitacao); $Municipios = new Municipios(); $this->view->combocidades = $Municipios->combo(array('idUFIBGE = ?' => $resposta[0]->UF)); } }