public function imprimirLocalizacaoFisicaProjetoAction()
 {
     $this->intTamPag = 10;
     //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);
         //idManterPortaria
         $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();
     $where['Orgao in (?)'] = $this->permissoesOrgao;
     if (isset($_POST['filtro']) || isset($_GET['filtro'])) {
         $filtro = isset($_POST['filtro']) ? $_POST['filtro'] : $_GET['filtro'];
         $this->view->filtro = $filtro;
     }
     if (isset($_POST['pronac']) && !empty($_POST['pronac']) || isset($_GET['pronac']) && !empty($_GET['pronac'])) {
         $where['p.AnoProjeto+p.Sequencial = ?'] = isset($_POST['pronac']) ? $_POST['pronac'] : $_GET['pronac'];
         $this->view->pronac = isset($_POST['pronac']) ? $_POST['pronac'] : $_GET['pronac'];
         unset($where['Orgao in (?)']);
     }
     if (isset($_POST['tecnico']) && !empty($_POST['tecnico']) || isset($_GET['tecnico']) && !empty($_GET['tecnico'])) {
         $where['p.Logon = ?'] = isset($_POST['tecnico']) ? $_POST['tecnico'] : $_GET['tecnico'];
         $this->view->tecnico = isset($_POST['tecnico']) ? $_POST['tecnico'] : $_GET['tecnico'];
     }
     if (isset($_POST['vinculada']) && !empty($_POST['vinculada']) || isset($_GET['vinculada']) && !empty($_GET['vinculada'])) {
         $where['p.Orgao = ?'] = isset($_POST['vinculada']) ? $_POST['vinculada'] : $_GET['vinculada'];
         $this->view->vinculada = isset($_POST['vinculada']) ? $_POST['vinculada'] : $_GET['vinculada'];
     }
     $LocalizacaoFisicaModel = new LocalizacaoFisicaModel();
     $total = $LocalizacaoFisicaModel->localizarProjetos($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 = $LocalizacaoFisicaModel->localizarProjetos($where, $order, $tamanho, $inicio);
     if (isset($get->xls) && $get->xls) {
         $html = '';
         $html .= '<table style="border: 1px">';
         $html .= '<tr><td style="border: 1px dotted black; background-color: #EAF1DD; font-size: 16; font-weight: bold;" colspan="8">Localizar Projeto</td></tr>';
         $html .= '<tr><td style="border: 1px dotted black; background-color: #EAF1DD; font-size: 10" colspan="8">Data do Arquivo: ' . Data::mostraData() . '</td></tr>';
         $html .= '<tr><td colspan="8"></td></tr>';
         $html .= '<tr>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">#</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">PRONAC</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Nome do Projeto</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">CPF / CNPJ</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Proponente</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Localização</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Técnico</th>';
         $html .= '</tr>';
         $x = 1;
         foreach ($busca as $d) {
             $cpfcnpj = Validacao::mascaraCPFCNPJ($d->CgcCpf);
             $html .= '<tr>';
             $html .= '<td style="border: 1px dotted black;">' . $x . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $d->Pronac . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $d->NomeProjeto . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $cpfcnpj . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $d->NomeProponente . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $d->Localizacao . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $d->NomeTecnico . '</td>';
             $html .= '</tr>';
             $x++;
         }
         $html .= '</table>';
         header("Content-Type: application/vnd.ms-excel");
         header("Content-Disposition: inline; filename=Localizar_Projeto.xls;");
         echo $html;
         die;
     } else {
         $this->view->qtdRegistros = $total;
         $this->view->dados = $busca;
         $this->_helper->layout->disableLayout();
         // Desabilita o Zend Layout
     }
 }
示例#2
0
<table class="tabela">
    <tr>
        <th width="30%">N&ordm; Pronac</th>
        <th>Nome do Projeto</th>
    </tr>
    <tr class="linha" align="center">
        <td><?php 
echo isset($this->projeto->pronac) && !empty($this->projeto->pronac) ? $this->projeto->pronac : '<em>Não informado</em>';
?>
</td>
        <td><?php 
echo isset($this->projeto->NomeProjeto) && !empty($this->projeto->NomeProjeto) ? $this->projeto->NomeProjeto : '<em>Não informado</em>';
?>
</td>
    </tr>
    <tr>
        <th>CNPJ/CPF</th>
        <th>Nome do Proponente</th>
    </tr>
    <tr class="linha" align="center">
        <td><?php 
echo isset($this->projeto->CNPJCPF) && !empty($this->projeto->CNPJCPF) ? Validacao::mascaraCPFCNPJ($this->projeto->CNPJCPF) : '<em>Não informado</em>';
?>
</td>
        <td><?php 
echo isset($this->projeto->NomeProponente) && !empty($this->projeto->NomeProponente) ? $this->projeto->NomeProponente : '<em>Não informado</em>';
?>
</td>
    </tr>
</table>
 /**
  * Método para realizar a buscar de agentes por cpf/cnpj ou por nome
  * @access public
  * @param void
  * @return void
  */
 public function buscaragenteAction()
 {
     $this->autenticacao();
     // caso o formulário seja enviado via post
     if ($this->getRequest()->isPost()) {
         // recebe os dados do formulário
         $post = Zend_Registry::get('post');
         $cpf = Mascara::delMaskCPF(Mascara::delMaskCNPJ($post->cpf));
         // deleta a máscara
         $nome = $post->nome;
         try {
             // validação dos campos
             if (empty($cpf) && empty($nome)) {
                 throw new Exception("Dados obrigatórios não informados:<br /><br />é necessário informar o CPF/CNPJ ou o Nome!");
             } else {
                 if (!empty($cpf) && strlen($cpf) != 11 && strlen($cpf) != 14) {
                     // valida cnpj/cpf
                     throw new Exception("O CPF/CNPJ informado é inválido!");
                 } else {
                     if (!empty($cpf) && strlen($cpf) == 11 && !Validacao::validarCPF($cpf)) {
                         // valida cpf
                         throw new Exception("O CPF informado é inválido!");
                     } else {
                         if (!empty($cpf) && strlen($cpf) == 14 && !Validacao::validarCNPJ($cpf)) {
                             // valida cnpj
                             throw new Exception("O CNPJ informado é inválido!");
                         } else {
                             // redireciona para a página com a busca dos dados com paginação
                             $this->_redirect("agentes/listaragente?cpf=" . $cpf . "&nome=" . $nome);
                         }
                     }
                 }
             }
             // fecha else
         } catch (Exception $e) {
             $this->view->message = $e->getMessage();
             $this->view->message_type = "ERROR";
             $this->view->cpf = !empty($cpf) ? Validacao::mascaraCPFCNPJ($cpf) : '';
             // caso exista, adiciona a máscara
             $this->view->nome = $nome;
         }
     }
     // fecha if
 }
 public function imprimirExtratoDeContaCaptacaoAction()
 {
     $this->_helper->layout->disableLayout();
     // Desabilita o Zend Layout
     $post = Zend_Registry::get('post');
     //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);
         //PRONAC
         $ordenacao = null;
     }
     $pag = 1;
     if (isset($post->pag)) {
         $pag = $post->pag;
     }
     $inicio = $pag > 1 ? ($pag - 1) * $this->intTamPag : 0;
     /* ================== PAGINACAO ======================*/
     $Usuariosorgaosgrupos = new Usuariosorgaosgrupos();
     $orgaoSuperior = $Usuariosorgaosgrupos->buscarOrgaoSuperiorUnico($this->getIdOrgao);
     $where = array();
     $where['c.siTransferenciaRecurso = ?'] = 0;
     $where['o.idSecretaria = ?'] = $orgaoSuperior->org_superior;
     if (isset($_POST['pronac']) && !empty($_POST['pronac']) || isset($_GET['pronac']) && !empty($_GET['pronac'])) {
         $where["c.AnoProjeto+c.Sequencial = ?"] = isset($_POST['pronac']) ? $_POST['pronac'] : $_GET['pronac'];
         $this->view->pronacProjeto = isset($_POST['pronac']) ? $_POST['pronac'] : $_GET['pronac'];
     }
     if (isset($_POST['tipoFiltro']) || isset($_GET['tipoFiltro'])) {
         $filtro = isset($_POST['tipoFiltro']) ? $_POST['tipoFiltro'] : $_GET['tipoFiltro'];
         $this->view->filtro = $filtro;
         switch ($filtro) {
             case '':
                 //captou 20%
                 $where['SAC.dbo.fnPercentualCaptado(c.AnoProjeto, c.Sequencial) >= ?'] = 20;
                 break;
             case 'nc':
                 //não captou 20%
                 $where['SAC.dbo.fnPercentualCaptado(c.AnoProjeto, c.Sequencial) < ?'] = 20;
                 break;
         }
     } else {
         $where['SAC.dbo.fnPercentualCaptado(c.AnoProjeto, c.Sequencial) >= ?'] = 20;
     }
     $tbCaptacao = new Captacao();
     $total = $tbCaptacao->buscaExtratoCaptacao($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;
     if (isset($_POST['pronac']) && !empty($_POST['pronac']) || isset($_GET['pronac']) && !empty($_GET['pronac'])) {
         $busca = $tbCaptacao->buscaExtratoCaptacao($where, $order);
     } else {
         $busca = $tbCaptacao->buscaExtratoCaptacao($where, $order, $tamanho, $inicio);
     }
     if (isset($post->xls) && $post->xls) {
         $html = '';
         $html .= '<table style="border: 1px">';
         $html .= '<tr><td style="border: 1px dotted black; background-color: #EAF1DD; font-size: 16; font-weight: bold;" colspan="12">Transferência de Recurso</td></tr>';
         $html .= '<tr><td style="border: 1px dotted black; background-color: #EAF1DD; font-size: 10" colspan="12">Data do Arquivo: ' . Data::mostraData() . '</td></tr>';
         $html .= '<tr><td colspan="12"></td></tr>';
         $html .= '<tr>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">#</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">PRONAC</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Situação</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">CPF/CNPJ</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Incentivador</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">N&ordm; do Lote</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Dt. do Lote</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Dt. Capta&ccedil;&atilde;o</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Tipo de Apoio</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Conta Liberada</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">% Captado</th>';
         $html .= '<th style="border: 1px dotted black; background-color: #9BBB59;">Vl. Captado</th>';
         $html .= '</tr>';
         $i = 1;
         foreach ($busca as $projeto) {
             if (isset($projeto->DtLiberacao) && !empty($projeto->DtLiberacao)) {
                 $DtLiberacao = 'Sim';
             } else {
                 $DtLiberacao = '<span style="color:red; font-weight: bold;">Não</span>';
             }
             $CaptacaoReal = 'R$ ' . number_format($projeto->CaptacaoReal, '2', ',', '.');
             $html .= '<tr>';
             $html .= '<td style="border: 1px dotted black;">' . $i . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->PRONAC . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->Situacao . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . Validacao::mascaraCPFCNPJ($projeto->CgcCpfMecena) . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->Incentivador . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->NumeroRecibo . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . date("d/m/Y", strtotime($projeto->DtChegadaRecibo)) . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . date("d/m/Y", strtotime($projeto->DtRecibo)) . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->TipoApoio . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $DtLiberacao . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $projeto->Percentual . '</td>';
             $html .= '<td style="border: 1px dotted black;">' . $CaptacaoReal . '</td>';
             $html .= '</tr>';
             $i++;
         }
         $html .= '</table>';
         header("Content-Type: application/vnd.ms-excel");
         header("Content-Disposition: inline; filename=Transferencia_de_recurso.xls;");
         echo $html;
         die;
     } else {
         $this->view->dados = $busca;
         $this->_helper->layout->disableLayout();
         // Desabilita o Zend Layout
     }
 }
 public function detalhardispensaAction()
 {
     /* =============================================================================== */
     /* ==== VERIFICA PERMISSAO DE ACESSO DO PROPONENTE A PROPOSTA OU AO PROJETO ====== */
     /* =============================================================================== */
     $this->verificarPermissaoAcesso(false, true, false);
     //        $this->_helper->layout->disableLayout();
     $post = Zend_Registry::get('get');
     $this->view->iddispensa = $post->iddispensa;
     $this->view->idpronac = $post->idpronac;
     $dispensaLicitacaoDao = new Dispensalicitacao();
     $resposta = $dispensaLicitacaoDao->buscarDispensaLicitacao(array(' dis.idDispensaLicitacao = ? ' => $this->view->iddispensa));
     $this->view->nrDispensaLicitacao = $resposta[0]->nrDispensaLicitacao;
     $this->view->motivoDispensa = $resposta[0]->dsDispensaLicitacao;
     $this->view->valorContratado = number_format($resposta[0]->vlContratado, 2, ',', '.');
     $this->view->dataContrato = date('d/m/Y', strtotime($resposta[0]->dtContrato));
     $this->view->TipoPessoa = $resposta[0]->TipoPessoa;
     $this->view->idAgente = $resposta[0]->idAgente;
     $this->view->CNPJCPF = Validacao::mascaraCPFCNPJ($resposta[0]->CNPJCPF);
     $this->view->Descricao = $resposta[0]->Descricao;
     $tbDispensalicitacaoxplanilhaaprovacao = new Dispensalicitacaoxplanilhaaprovacao();
     $this->view->itensVinculados = $tbDispensalicitacaoxplanilhaaprovacao->itensVinculados($this->view->iddispensa);
     $ArquivoDispensaLicitacaoDao = new Arquivodispensalicitacao();
     $this->view->documentosAnexados = $ArquivoDispensaLicitacaoDao->buscarArquivos($this->view->iddispensa);
 }