public function imprimirResultadoContaBancariaAction()
 {
     //FUNÇÃO ACESSADA SOMENTE PELO TEC., COORD. E COORD. GERAL DE ACOMPANHAMENTO
     if ($this->idPerfil != 121 && $this->idPerfil != 122 && $this->idPerfil != 123) {
         parent::message("Você não tem permissão para acessar essa área do sistema!", "principal", "ALERT");
     }
     //DEFINE PARAMETROS DE ORDENACAO / QTDE. REG POR PAG. / PAGINACAO
     if ($this->_request->getParam("qtde")) {
         $this->intTamPag = $this->_request->getParam("qtde");
     }
     $order = array();
     //==== parametro de ordenacao  ======//
     if ($this->_request->getParam("ordem")) {
         $ordem = $this->_request->getParam("ordem");
         if ($ordem == "ASC") {
             $novaOrdem = "DESC";
         } else {
             $novaOrdem = "ASC";
         }
     } else {
         $ordem = "ASC";
         $novaOrdem = "ASC";
     }
     //==== campo de ordenacao  ======//
     if ($this->_request->getParam("campo")) {
         $campo = $this->_request->getParam("campo");
         $order = array($campo . " " . $ordem);
         $ordenacao = "&campo=" . $campo . "&ordem=" . $ordem;
     } else {
         $campo = null;
         $order = array(1);
         //idPronac
         $ordenacao = null;
     }
     $pag = 1;
     $get = Zend_Registry::get('post');
     if (isset($get->pag)) {
         $pag = $get->pag;
     }
     $inicio = $pag > 1 ? ($pag - 1) * $this->intTamPag : 0;
     /* ================== PAGINACAO ======================*/
     $where = array();
     if (!empty($_POST['pronac'])) {
         $this->view->pronac = $_POST['pronac'];
         $where["(p.AnoProjeto+p.Sequencial) = ?"] = $_POST['pronac'];
     }
     if (!empty($_POST['tpPessoa']) || $_POST['tpPessoa'] == '0') {
         $this->view->tpPessoa = $_POST['tpPessoa'];
         $where["a.TipoPessoa = ?"] = $_POST['tpPessoa'];
     }
     if (!empty($_POST['ocorrencia']) && $_POST['ocorrencia'] != '000') {
         $this->view->ocorrencia = $_POST['ocorrencia'];
         $where["c.OcorrenciaCB = ?"] = $_POST['ocorrencia'];
     }
     if (!empty($_POST['estadoConta'])) {
         $this->view->estadoConta = $_POST['estadoConta'];
         if ($_POST['estadoConta'] == 1) {
             $where["c.ContaBloqueada = ?"] = '000000000000';
         } else {
             $where["c.ContaBloqueada <> ?"] = '000000000000';
         }
     }
     if (!empty($_POST['tpDtLtCap'])) {
         //SE O USUARIO NÃO INFORMAR A DATA CORRETAMENTE, O SISTEMA RETORNA A MSG.
         if (empty($_POST['dtInicioLtCap'])) {
             parent::message("Faltou informar a data para a realizarmos a pesquisa!", "operacional/conta-bancaria", "ALERT");
         } else {
             $d1 = Data::dataAmericana($_POST['dtInicioLtCap']);
             $this->view->dtInicioLtCap = $_POST['dtInicioLtCap'];
             //SE O USUARIO INFORMAR QUE DESEJA FAZER UMA ANALISE ENTRE DUAS DATAS E NAO INFORMAR A SEGUNDA DATA, O SISTEMA RETORNA A MSG.
             if ($_POST['tpDtLtCap'] == "entre" && empty($_POST['dtFimLtCap'])) {
                 parent::message("Faltou informar a data final para a realizarmos a pesquisa!", "operacional/conta-bancaria", "ALERT");
             }
             if ($_POST['tpDtLtCap'] == "igual") {
                 $where["c.DtLoteRemessaCL BETWEEN '{$d1} 00:00:00' AND '{$d1} 23:59:59.999'"] = '';
             } else {
                 if ($_POST['tpDtLtCap'] == "entre") {
                     $d2 = Data::dataAmericana($_POST['dtFimLtCap']);
                     $this->view->dtFimLtCap = $_POST['dtFimLtCap'];
                     $where["c.DtLoteRemessaCL BETWEEN '{$d1} 00:00:00' AND '{$d2} 23:59:59.999'"] = '';
                 } else {
                     if ($_POST['tpDtLtCap'] == "maior") {
                         $where["c.DtLoteRemessaCL >= ?"] = $d1 . ' 00:00:00';
                     } else {
                         if ($_POST['tpDtLtCap'] == "menor") {
                             $where["c.DtLoteRemessaCL <= ?"] = $d1 . ' 23:59:59.999';
                         }
                     }
                 }
             }
             $this->view->tpDtLtCap = $_POST['tpDtLtCap'];
         }
     }
     $Orgaos = new Orgaos();
     $idSecretaria = $Orgaos->buscar(array('codigo = ?' => $this->idOrgao))->current();
     if (isset($idSecretaria) && !empty($idSecretaria)) {
         if ($idSecretaria->idSecretaria == 160) {
             $where['p.Area = ?'] = 2;
         } else {
             $where['p.Area <> ?'] = 2;
         }
     }
     $ContaBancaria = new ContaBancaria();
     $total = $ContaBancaria->painelContasBancarias($where, $order, null, null, true);
     $fim = $inicio + $this->intTamPag;
     $totalPag = (int) ($total % $this->intTamPag == 0 ? $total / $this->intTamPag : $total / $this->intTamPag + 1);
     $tamanho = $fim > $total ? $total - $inicio : $this->intTamPag;
     $busca = $ContaBancaria->painelContasBancarias($where, $order, $tamanho, $inicio);
     $this->view->qtdRegistros = $total;
     $this->view->dados = $busca;
     $this->_helper->layout->disableLayout();
     // Desabilita o Zend Layout
 }