public function encaminhacoordacompanhamentoAction() { //retorna o id do agente logado $auth = Zend_Auth::getInstance(); // pega a autenticação $agente = GerenciarPautaReuniaoDAO::consultaAgenteUsuario($auth->getIdentity()->usu_codigo); $idAgenteEncaminhar = $agente['idAgente']; //echo "<pre>"; print_r($_POST); die; $idAgenteReceber = $_POST['AgenteId']; $Orgao = $_POST['passaValor']; $AgentePerfil = $_POST['AgentePerfil']; $PRONAC = $_POST['PRONAC']; $NomeProjeto = $_POST['NomeProjeto']; $ID_PRONAC = $_POST['ID_PRONAC']; $idPedidoAlteracao = $_POST['idPedidoAlteracao']; $tpAlteracaoProjeto = $_POST['tpAlteracaoProjeto']; $justificativa = $_POST['justificativa']; if ($justificativa == 'Digite a justificativa...') { $justificativa = ''; } $idAgenteRemetente = $this->getIdUsuario; $idPerfilRemetente = $this->codGrupo; xd($_POST); $db = Zend_Registry::get('db'); $db->setFetchMode(Zend_DB::FETCH_OBJ); try { $db->beginTransaction(); //ALTERA O STATUS DE '0' PARA '1' NA TABELA tbPedidoAlteracaoProjeto $sqlAlteraVariavelAltProj = ReadequacaoProjetos::retornaSQLencaminhar("sqlAlteraVariavelAltProj", $ID_PRONAC, $idPedidoAlteracao, $tpAlteracaoProjeto, $justificativa, $Orgao, $idAgenteReceber); $db->fetchAll($sqlAlteraVariavelAltProj); //ALTERA O STATUS DE '0' PARA '1' NA TABELA tbPedidoAlteracaoXTipoAlteracao $sqlAlteraVariavelTipoAlt = ReadequacaoProjetos::retornaSQLencaminhar("sqlAlteraVariavelTipoAlt", $ID_PRONAC, $idPedidoAlteracao, $tpAlteracaoProjeto, $justificativa, $Orgao, $idAgenteReceber); $db->fetchAll($sqlAlteraVariavelTipoAlt); if ($tpAlteracaoProjeto == 7) { $sqlAlteraVariavelTipoAlt = ReadequacaoProjetos::retornaSQLencaminhar("sqlAlteraVariavelTipoAlt", $ID_PRONAC, $idPedidoAlteracao, 10, $justificativa, $Orgao, $idAgenteReceber); $db->fetchAll($sqlAlteraVariavelTipoAlt); } // INSERE OS VALORES NA TABELA tbAvaliacaoItemPedidoAlteracao $sqlEncaminhar = ReadequacaoProjetos::retornaSQLencaminhar("sqlCoordAcompEncaminhar", $ID_PRONAC, $idPedidoAlteracao, $tpAlteracaoProjeto, $justificativa, $Orgao, $idAgenteReceber); $db->fetchAll($sqlEncaminhar); //RETORNA EM VARIÁVEIS OS DADOS DO LOG ANTERIOR PARA INSERIR NA TABELA tbAcaoAvaliacaoItemPedidoAlteracao $sqlproposta = ReadequacaoProjetos::retornaSQLencaminhar("sqlRecuperarRegistro", $ID_PRONAC, $idPedidoAlteracao, $tpAlteracaoProjeto, $justificativa, $Orgao, $idAgenteReceber); $dados = $db->fetchAll($sqlproposta); $idAvaliacaoItemPedidoAlteracao = $dados[0]->idAvaliacaoItemPedidoAlteracao; //122 = Coord Acompanhamento //93 = Coord Parecerista //94 = Parecerista //129 = Tecnico if ($AgentePerfil == 122) { $tipoAg = '3'; } else { if ($AgentePerfil == 93) { $tipoAg = '2'; } else { if ($AgentePerfil == 94) { $tipoAg = '1'; } else { if ($AgentePerfil == 121 or $AgentePerfil == 129) { $tipoAg = '5'; } } } } // INSERE OS VALORES NA TABELA tbAcaoAvaliacaoItemPedidoAlteracao $sqlEncaminhar2 = ReadequacaoProjetos::retornaSQLtbAcao($idAvaliacaoItemPedidoAlteracao, $justificativa, $tipoAg, $Orgao, $idAgenteReceber, $idAgenteRemetente, $idPerfilRemetente); $db->fetchAll($sqlEncaminhar2); $db->commit(); parent::message("Projeto encaminhado com sucesso!", "verificarreadequacaodeprojeto/verificarreadequacaodeprojetocoordacompanhamento", "CONFIRM"); } catch (Zend_Exception $e) { $db->rollBack(); parent::message("Erro ao encaminhar Projeto", "verificarreadequacaodeprojeto/verificarreadequacaodeprojetocoordacompanhamento", "ERROR"); } }