コード例 #1
0
 /**
  * 
  */
 public static function salvarPrazo(Prazo $prazo)
 {
     try {
         Controlador::getInstance()->getConnection()->connection->beginTransaction();
         if (!isset($prazo->prazo->id_usuario_destino) || $prazo->prazo->id_usuario_destino == '') {
             $prazo->prazo->id_usuario_destino = NULL;
         }
         $prazo->id_unid_origem = isset($prazo->prazo->id_unid_origem) ? $prazo->prazo->id_unid_origem : Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE_ORIGINAL;
         $prazo->id_usuario_origem = Controlador::getInstance()->usuario->ID;
         $stmt = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO TB_CONTROLE_PRAZOS (NU_PROC_DIG_REF, ID_USUARIO_ORIGEM, ID_USUARIO_DESTINO, ID_UNID_ORIGEM, ID_UNID_DESTINO, DT_PRAZO, TX_SOLICITACAO)\n            VALUES (?,?,?,?,?,?,?)");
         $stmt->bindParam(1, $prazo->prazo->nu_proc_dig_ref, PDO::PARAM_STR);
         $stmt->bindParam(2, $prazo->prazo->id_usuario_origem, PDO::PARAM_INT);
         $stmt->bindParam(3, $prazo->prazo->id_usuario_destino, PDO::PARAM_INT);
         $stmt->bindParam(4, $prazo->prazo->id_unid_origem, PDO::PARAM_INT);
         $stmt->bindParam(5, $prazo->prazo->id_unid_destino, PDO::PARAM_INT);
         $stmt->bindParam(6, Util::formatDate($prazo->prazo->dt_prazo), PDO::PARAM_STR);
         $stmt->bindParam(7, $prazo->prazo->tx_solicitacao, PDO::PARAM_STR);
         $stmt->execute();
         new Log('TB_CONTROLE_PRAZOS', Controlador::getInstance()->getConnection()->connection->lastInsertId('TB_CONTROLE_PRAZOS_SQ_PRAZO_SEQ'), Zend_Auth::getInstance()->getIdentity()->ID, 'inserir');
         Controlador::getInstance()->getConnection()->connection->commit();
         return new Output(array('success' => 'true', 'message' => 'Prazo cadastrado com sucesso!'));
     } catch (Exception $e) {
         Controlador::getInstance()->getConnection()->connection->rollBack();
         return new Output(array('success' => 'false', 'error' => $e->getMessage()));
     }
 }
コード例 #2
0
ファイル: Arvore.php プロジェクト: roquebrasilia/sgdoc-codigo
 /**
  * 
  */
 public function getVinculacaoDocumento($digital, $pageName, $vinculacao)
 {
     try {
         $sttm = Controlador::getInstance()->getConnection()->connection->prepare("SELECT DCP.DIGITAL AS PAI, DCF.DIGITAL AS FILHO FROM TB_DOCUMENTOS_VINCULACAO DV\nINNER JOIN TB_DOCUMENTOS_CADASTRO DCP ON DCP.ID = DV.ID_DOCUMENTO_PAI\nINNER JOIN TB_DOCUMENTOS_CADASTRO DCF ON DCF.ID = DV.ID_DOCUMENTO_FILHO\nWHERE DCP.DIGITAL = ? AND DV.FG_ATIVO = 1 AND ST_ATIVO = 1 AND ID_VINCULACAO = ?");
         $sttm->bindParam(1, $digital, PDO::PARAM_STR);
         $sttm->bindParam(2, $vinculacao, PDO::PARAM_INT);
         $sttm->execute();
         $out = $sttm->fetchAll(PDO::FETCH_ASSOC);
         $str = null;
         if (!empty($out)) {
             foreach ($out as $key => $value) {
                 $supp = null;
                 $ausente = !Documento::validarDocumentoAreaDeTrabalho($value['FILHO']) ? array('classe' => 'ausente', 'title' => 'Este documento nao esta na sua área de trabalho.', 'ausente' => 'true') : array('classe' => '', 'title' => '', 'ausente' => 'false');
                 if (true) {
                     $supp = "\n                        \t\t<ul class='ajax'>\n                        \t\t\t<li id='{$value['FILHO']}'><span class='{$ausente['classe']}'>\n                        \t\t\t\t{url:'{$pageName}?action=getElementList&ownerEl={$value['FILHO']}',idElemento:'{$value['FILHO']}',stAusente:{$ausente['ausente']}}</span>\n                        \t\t\t</li>\n                        \t\t</ul>\n                        \t\t";
                 }
                 $documento = current(CFModelDocumento::factory()->findByParam(array('DIGITAL' => $value['FILHO'])));
                 $data = Util::formatDate($documento->DT_DOCUMENTO) ? Util::formatDate($documento->DT_DOCUMENTO) : "Data Não informada";
                 $str .= "\n                    \t\t<li class='text' title='{$ausente['title']}' id='{$value['FILHO']}'>\n                    \t\t\t<span class='{$ausente['classe']}'>{$value['FILHO']}</span>\n                    \t\t\t[ {$documento->ASSUNTO} - {$data} ]                \n                    \t\t\t{$supp}\n                    \t\t</li>\n                    \t\t";
             }
         }
     } catch (PDOException $e) {
         $str = FAILED;
     }
     return $str;
 }
コード例 #3
0
 /**
  * 
  */
 public static function alterarProcesso(Processo $processo)
 {
     try {
         Controlador::getInstance()->getConnection()->connection->beginTransaction();
         $processo->processo->fg_prazo = $processo->processo->fg_prazo == 'true' ? 1 : 0;
         $stmt = Controlador::getInstance()->getConnection()->connection->prepare("UPDATE TB_PROCESSOS_CADASTRO SET \n                ASSUNTO = ?,\n                ASSUNTO_COMPLEMENTAR = ?,\n                INTERESSADO = ?,\n                ORIGEM = ?,\n                DT_AUTUACAO = ?,\n                DT_PRAZO = ?,\n                FG_PRAZO = ?,\n                PROCEDENCIA = ?\n                WHERE NUMERO_PROCESSO = ?");
         $stmt->bindParam(1, $processo->processo->assunto, PDO::PARAM_INT);
         //DATA_ENTRADA' ,
         $stmt->bindParam(2, $processo->processo->assunto_complementar, PDO::PARAM_STR);
         //TIPO' ,
         $stmt->bindParam(3, $processo->processo->interessado, PDO::PARAM_INT);
         //NUMERO' ,
         $stmt->bindParam(4, $processo->processo->origem, PDO::PARAM_INT);
         //ORIGEM' ,
         $stmt->bindParam(5, Util::formatDate($processo->processo->dt_autuacao), PDO::PARAM_STR);
         //INTERESSADO' ,
         $stmt->bindParam(6, Util::formatDate($processo->processo->dt_prazo), PDO::PARAM_STR);
         //ASSUNTO' ,
         $stmt->bindParam(7, $processo->processo->fg_prazo, PDO::PARAM_INT);
         //INTERNO = 1 , ExTERNO = 0' ,
         $stmt->bindParam(8, $processo->processo->procedencia, PDO::PARAM_STR);
         //CARGO' ,
         $stmt->bindParam(9, $processo->processo->numero_processo, PDO::PARAM_STR);
         //ASSINATURA' ,
         $stmt->execute();
         $acao = "Cadastrado complementado.";
         $destino = "XXXXX";
         $usuario = Controlador::getInstance()->usuario;
         $id_usuario = $usuario->ID;
         $nome_usuario = $usuario->NOME;
         $id_unidade = $usuario->ID_UNIDADE;
         $oDiretoria = DaoUnidade::getUnidade($id_unidade);
         $diretoria = $oDiretoria['nome'];
         $tx_diretoria = $oDiretoria['nome'] . ' - ' . $oDiretoria['sigla'];
         $stmm = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO TB_HISTORICO_TRAMITE_PROCESSOS" . " (NUMERO_PROCESSO,ID_USUARIO,USUARIO,ID_UNIDADE,DIRETORIA,ACAO,ORIGEM,DESTINO,DT_TRAMITE)" . " VALUES(?,?,?,?,?,?,?,?,CLOCK_TIMESTAMP())");
         $stmm->bindParam(1, $processo->processo->numero_processo, PDO::PARAM_STR);
         $stmm->bindParam(2, $id_usuario, PDO::PARAM_INT);
         $stmm->bindParam(3, $nome_usuario, PDO::PARAM_STR);
         $stmm->bindParam(4, $id_unidade, PDO::PARAM_INT);
         $stmm->bindParam(5, $diretoria, PDO::PARAM_STR);
         $stmm->bindParam(6, $acao, PDO::PARAM_STR);
         $stmm->bindParam(7, $tx_diretoria, PDO::PARAM_STR);
         $stmm->bindParam(8, $destino, PDO::PARAM_STR);
         $stmm->execute();
         Controlador::getInstance()->getConnection()->connection->commit();
         return new Output(array('success' => 'true'));
     } catch (PDOException $e) {
         Controlador::getInstance()->getConnection()->connection->rollback();
         return new Output(array('success' => 'false', 'error' => $e->getMessage()));
     }
 }
コード例 #4
0
 /**
  * @return Output
  * @param Despacho $despacho
  */
 public static function inserirDespachoProcesso(Despacho $despacho)
 {
     try {
         $stmt = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO TB_DESPACHOS_PROCESSOS (NUMERO_PROCESSO, DT_CADASTRO, ID_USUARIO,\n                USUARIO, DT_DESPACHO, ID_UNIDADE, DIRETORIA, ASSINATURA_DESPACHO, TEXTO_DESPACHO, COMPLEMENTO)\n            VALUES (?,CLOCK_TIMESTAMP(),?,?,?,?,?,?,?,?)");
         $stmt->bindParam(1, $despacho->numero_processo, PDO::PARAM_STR);
         $stmt->bindParam(2, $despacho->id_usuario, PDO::PARAM_INT);
         $stmt->bindParam(3, $despacho->usuario, PDO::PARAM_STR);
         $stmt->bindParam(4, Util::formatDate($despacho->data_despacho), PDO::PARAM_STR);
         $stmt->bindParam(5, $despacho->id_unidade, PDO::PARAM_INT);
         $stmt->bindParam(6, $despacho->diretoria, PDO::PARAM_STR);
         $stmt->bindParam(7, $despacho->assinatura, PDO::PARAM_STR);
         $stmt->bindParam(8, $despacho->texto, PDO::PARAM_STR);
         $stmt->bindParam(9, $despacho->complemento, PDO::PARAM_STR);
         $stmt->execute();
         return new Output(array('success' => 'true'));
     } catch (Exception $e) {
         return new Output(array('success' => 'false', 'error' => $e->getMessage()));
     }
 }
コード例 #5
0
ファイル: cf.php プロジェクト: roquebrasilia/sgdoc-codigo
 $persist = CFModelDocumentoDemanda::factory();
 $persist->beginTransaction();
 $factory = TPDocumentoDemanda::factory();
 $priority = current(CFModelPrioridade::factory()->find($_REQUEST['PRIORIDADE']));
 $usuario = Zend_Auth::getInstance()->getStorage()->read();
 $digital = CFModelDigital::factory()->next($usuario->ID_UNIDADE);
 if (!$digital) {
     throw new Exception('Não existe digitais disponíveis!');
 }
 $_REQUEST['SOLICITACAO'] = $_REQUEST['SOLICITACAO'];
 $_REQUEST['PROCEDENCIA'] = 'I';
 $_REQUEST['TIPO'] = 'MONITORAMENTO';
 # MONITORAMENTO! @todo parametrizar...
 $_REQUEST['NUMERO'] = $digital;
 $_REQUEST['DT_DOCUMENTO'] = Util::formatDate($_REQUEST['DT_DOCUMENTO']);
 $_REQUEST['DT_PRAZO'] = Util::formatDate($_REQUEST['DT_PRAZO']);
 $_REQUEST['DIRETORIA'] = $usuario->DIRETORIA;
 $_REQUEST['ORIGEM'] = $usuario->DIRETORIA;
 $_REQUEST['DT_CADASTRO'] = date('Y-m-d');
 $_REQUEST['DIGITAL'] = $digital;
 $_REQUEST['ULTIMO_TRAMITE'] = sprintf('Área de Trabalho - %s', $usuario->DIRETORIA);
 $_REQUEST['ID_UNIDADE'] = $usuario->ID_UNIDADE;
 $_REQUEST['ID_USUARIO'] = $usuario->ID;
 $_REQUEST['ID_UNID_CAIXA_SAIDA'] = $usuario->ID_UNIDADE;
 $_REQUEST['USUARIO'] = $usuario->NOME;
 $_REQUEST['NM_PRIORIDADE'] = $priority->PRIORIDADE;
 $lastId = $factory->create($_REQUEST);
 $documento = $persist->find($lastId);
 $idDocumentoPai = current($persist->findByParam(array('DIGITAL' => $_REQUEST['DIGITAL_REFERENCIA'])));
 $_REQUEST['DIGITAL_PAI'] = $idDocumentoPai->DIGITAL;
 if (empty($documento)) {
コード例 #6
0
$pdf->Cell(70, 5, "ASSUNTO", 1, 0, 'C');
$pdf->Cell(15, 5, "AUTUACAO", 1, 1, 'C');
foreach (Tramite::getProcessosGuiaRecibo() as $key => $processo) {
    try {
        $stmt = Controlador::getInstance()->getConnection()->connection->prepare("SELECT NUMERO_PROCESSO,I.INTERESSADO AS INTERESSADO,A.ASSUNTO AS ASSUNTO, DT_AUTUACAO\r\n                FROM TB_PROCESSOS_CADASTRO PC\r\n                INNER JOIN TB_PROCESSOS_ASSUNTO A ON A.ID = PC.ASSUNTO\r\n                INNER JOIN TB_PROCESSOS_INTERESSADOS I ON I.ID = PC.INTERESSADO\r\n                WHERE NUMERO_PROCESSO = ? LIMIT 1");
        $stmt->bindParam(1, $processo, PDO::PARAM_INT);
        $stmt->execute();
        $out = $stmt->fetch(PDO::FETCH_ASSOC);
        if (!empty($out)) {
            $pdf->SetFont("Arial", "", 6);
            $pdf->Cell(5, 5, ++$cont, 1, 'C');
            $pdf->Cell(30, 5, $processo, 1, 0, 'C');
            $pdf->Cell(70, 5, $out['INTERESSADO'], 1, 0, 'C');
            $pdf->Cell(70, 5, $out['ASSUNTO'], 1, 0, 'C');
            $pdf->SetFont("Arial", "", 5);
            $pdf->Cell(15, 5, Util::formatDate($out['DT_AUTUACAO']), 1, 1, 'C');
        }
    } catch (PDOException $e) {
        throw new Exception($e);
    }
}
$pdf->Ln(10);
$pdf->Cell(5, 5, "", 0, 0, 'C');
$pdf->SetFont("Arial", "B", 6);
$pdf->Cell(180, 5, "COMPROVANTE DE RECEBIMENTO", 0, 0, 'C');
$pdf->Cell(5, 5, "", 0, 1, 'L');
$pdf->ln(5);
$pdf->SetFont("Arial", "", 7);
$pdf->Cell(95, 20, "ASSINATURA: _____________________________________________________", 0, 0, 'C');
$pdf->Cell(95, 20, utf8_decode("DATA: ________/ _______/ ________    HORÁRIO: ____ : ____ "), 0, 1, 'C');
$pdf->Output("Guia de Recibo.pdf", "I");
コード例 #7
0
            }
        </style>
        <link rel="stylesheet" type="text/css" href="plugins/tree/css/style.css" />
    </head>
    <body>
        <div class="contextMenu" id="menu-tree-apensos-processos">
            <li class="expandAll"><img alt="" src="plugins/tree/css/images/expand.png"/></li>
            <li class="collapseAll"><img alt="" src="plugins/tree/css/images/collapse.png"/></li>
        </div>
        <ul id="tree-apensos-processos" class="arvoreDocumentos">
        	<?php 
$processo = current(CFModelProcesso::factory()->findByParam(array('NUMERO_PROCESSO' => $numero_processo)));
$assuntoDao = DaoAssuntoProcesso::getAssunto((int) $processo->ASSUNTO);
$assunto = $assuntoDao['assunto'];
$classe = Processo::validarProcessoAreaDeTrabalho($numero_processo) ? 'root' : 'root root-ausente';
$data = Util::formatDate($processo->DT_AUTUACAO) ? Util::formatDate($processo->DT_AUTUACAO) : "Data Não informada";
?>
            <li class="<?php 
print $classe;
?>
" id='<?php 
print $arvore->getRootId();
?>
'>
            	<span title="Processo mais relevante da arvore"><?php 
print $numero_processo;
?>
</span>
            	[ <?php 
print $assunto;
?>
コード例 #8
0
            <li class='<?php 
print $classe;
?>
' id='<?php 
print $rootId;
?>
'>
            	<span title="Documento mais relevante da arvore"><?php 
print $root;
?>
</span>
            	[ <?php 
print $documento->ASSUNTO;
?>
 - <?php 
print Util::formatDate($documento->DT_DOCUMENTO) ? Util::formatDate($documento->DT_DOCUMENTO) : "Data Não informada";
?>
 ]
                <ul><?php 
print $elementos;
?>
</ul>
            </li>
        </ul>
    </body>


</html>

<style type="text/css">
コード例 #9
0
 public static function salvarDocumento(Documento $documento)
 {
     try {
         $ultimo_tramite = "Área de Trabalho - " . DaoUnidade::getUnidade(null, 'nome');
         $acao = "Documento cadastrado";
         $id_usuario = Zend_Auth::getInstance()->getIdentity()->ID;
         $id_unidade = $documento->documento->id_unid_area_trabalho ? $documento->documento->id_unid_area_trabalho : Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE;
         $id_unidade_historico = Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE_ORIGINAL;
         $destino = "XXXXX";
         Controlador::getInstance()->getConnection()->connection->beginTransaction();
         $stmt = Controlador::getInstance()->getConnection()->connection->prepare("\n                INSERT INTO TB_DOCUMENTOS_CADASTRO\n                    (DT_DOCUMENTO, DT_ENTRADA, TIPO,NUMERO, ORIGEM, INTERESSADO,\n                    ID_ASSUNTO, ASSUNTO_COMPLEMENTAR, CARGO,ASSINATURA, DESTINO, \n                    RECIBO, TECNICO_RESPONSAVEL, ID_USUARIO, ID_UNIDADE,\n                    PROCEDENCIA, DT_CADASTRO, DIGITAL, DT_PRAZO, ID_UNID_AREA_TRABALHO,\n                    ULTIMO_TRAMITE)\n                VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\n            ");
         $stmt->bindParam(1, Util::formatDate($documento->documento->data_documento), PDO::PARAM_STR);
         //DT_DOCUMENTO' ,
         $stmt->bindParam(2, Util::formatDate($documento->documento->data_entrada), PDO::PARAM_STR);
         //DT_ENTRADA' ,
         $stmt->bindParam(3, $documento->documento->tipo, PDO::PARAM_STR);
         //TIPO' ,
         $stmt->bindParam(4, $documento->documento->numero, PDO::PARAM_STR);
         //NUMERO' ,
         $stmt->bindParam(5, $documento->documento->origem, PDO::PARAM_STR);
         //ORIGEM' ,
         $stmt->bindParam(6, $documento->documento->interessado, PDO::PARAM_STR);
         //INTERESSADO' ,
         $stmt->bindParam(7, $documento->documento->assunto, PDO::PARAM_INT);
         //ID_ASSUNTO' ,
         $stmt->bindParam(8, $documento->documento->assunto_complementar, PDO::PARAM_STR);
         //ASSUNTO_COMPLEMENTAR' ,
         $stmt->bindParam(9, $documento->documento->cargo, PDO::PARAM_STR);
         //CARGO' ,
         $stmt->bindParam(10, $documento->documento->assinatura, PDO::PARAM_STR);
         //ASSINATURA' ,
         $stmt->bindParam(11, $documento->documento->destino, PDO::PARAM_STR);
         //DESTINO' ,
         $stmt->bindParam(12, $documento->documento->recibo, PDO::PARAM_STR);
         //RECIBO' ,
         $stmt->bindParam(13, $documento->documento->tecnico_responsavel, PDO::PARAM_STR);
         //TECNICO_RESPONSAVEL' ,
         $stmt->bindParam(14, $id_usuario, PDO::PARAM_INT);
         //ID_USUARIO' ,
         $stmt->bindParam(15, $id_unidade_historico, PDO::PARAM_INT);
         //ID_UNIDADE' ,
         $stmt->bindParam(16, $documento->documento->procedencia, PDO::PARAM_STR);
         //PROCEDENCIA' ,
         $stmt->bindParam(17, date("Y-m-d"), PDO::PARAM_STR);
         //DT_CADASTRO' ,
         $stmt->bindParam(18, $documento->documento->digital, PDO::PARAM_STR);
         //DIGITAL' ,
         $stmt->bindParam(19, Util::formatDate($documento->documento->prazo), PDO::PARAM_STR);
         //PRAZO' ,
         $stmt->bindParam(20, $id_unidade, PDO::PARAM_INT);
         //ID_UNID_AREA_TRABALHO' ,
         $stmt->bindParam(21, $ultimo_tramite, PDO::PARAM_STR);
         //'ULTIMO_TRAMITE'
         $stmt->execute();
         $id = Controlador::getInstance()->getConnection()->connection->lastInsertId('TB_DOCUMENTOS_CADASTRO_ID_SEQ');
         $sttt = Controlador::getInstance()->getConnection()->connection->prepare("\n                UPDATE TB_DIGITAL SET USO = '1', ID_USUARIO = ? WHERE DIGITAL = ? AND ID_UNIDADE = ?\n            ");
         $sttt->bindParam(1, $id_usuario, PDO::PARAM_INT);
         $sttt->bindParam(2, $documento->documento->digital, PDO::PARAM_STR);
         $sttt->bindParam(3, $id_unidade, PDO::PARAM_INT);
         $sttt->execute();
         $nome_usuario = Zend_Auth::getInstance()->getIdentity()->NOME;
         $diretoria = DaoUnidade::getUnidade($id_unidade_historico, 'nome');
         $objOrigem = DaoUnidade::getUnidade($id_unidade);
         $tx_origem = $objOrigem['nome'] . ' - ' . $objOrigem['sigla'];
         $stmm = Controlador::getInstance()->getConnection()->connection->prepare("\n                INSERT INTO TB_HISTORICO_TRAMITE_DOCUMENTOS \n                    (DIGITAL,ID_USUARIO,USUARIO,ID_UNIDADE,DIRETORIA,ACAO,ORIGEM,DESTINO,DT_TRAMITE) \n                VALUES (?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP(0))\n            ");
         $stmm->bindParam(1, $documento->documento->digital, PDO::PARAM_STR);
         $stmm->bindParam(2, $id_usuario, PDO::PARAM_INT);
         $stmm->bindParam(3, $nome_usuario, PDO::PARAM_STR);
         $stmm->bindParam(4, $id_unidade_historico, PDO::PARAM_INT);
         $stmm->bindParam(5, $diretoria, PDO::PARAM_STR);
         $stmm->bindParam(6, $acao, PDO::PARAM_STR);
         $stmm->bindParam(7, $tx_origem, PDO::PARAM_STR);
         $stmm->bindParam(8, $destino, PDO::PARAM_STR);
         $stmm->execute();
         Controlador::getInstance()->getConnection()->connection->commit();
         return new Output(array('success' => 'true', 'id' => $id));
     } catch (PDOException $e) {
         Controlador::getInstance()->getConnection()->connection->rollback();
         LogError::sendReport($e);
         return new Output(array('success' => 'false', 'error' => $e->getMessage()));
     }
 }
コード例 #10
0
 function showWarenkorb()
 {
     $AC = anyC::get("Seminar");
     $AC->addAssocV3("SeminarVon", ">=", Util::parseDate("de_DE", Util::formatDate("de_DE", time())));
     $count = array();
     for ($i = 0; $i < 21; $i++) {
         $count[$i] = $i;
     }
     $T = new HTMLTable(3, "Events");
     $T->setTableStyle("width:100%;");
     while ($S = $AC->getNextEntry()) {
         $I = new HTMLInput("AnzahlKarten" . $S->getID(), "select", "0", $count);
         $I->style("width:80px;text-align:right;");
         $I->onchange("CustomerPage.rme('recalc', ['" . $S->getID() . "', this.value], function(response){ \$('#PreisGesamt" . $S->getID() . "').html(response) });");
         if (isset($_SESSION["ticketDataSelection"])) {
             $I->setValue($_SESSION["ticketDataSelection"][$S->getID()]);
         }
         $Adresse = new Adresse($S->A("SeminarAdresseID"));
         $T->addRow(array("<b>" . $S->A("SeminarName") . "</b>, " . Util::CLDateParser($S->A("SeminarVon")) . " ab " . Util::CLTimeParser($S->A("SeminarStart")) . " Uhr, " . $Adresse->A("ort")));
         $T->addRowColspan(1, 3);
         $T->addRow(array($I, Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * 1, true), Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * $I->getValue(), true)));
         $T->addCellStyle(1, "text-align:right;");
         $T->addCellStyle(2, "text-align:right;");
         $T->addCellStyle(3, "text-align:right;");
         $T->addCellID(3, "PreisGesamt" . $S->getID());
         $T->addRow(array("&nbsp;"));
         $T->addRowColspan(1, 3);
     }
     $I = new Button("Weiter", "");
     $I->onclick("CustomerPage.rme('handleForm', \$('#ticketShop').serialize(), function(){ document.location.reload(); })");
     $I->className("submitFormButton");
     $T->addRow($I);
     $T->addRowColspan(1, 3);
     $IA = new HTMLInput("action", "hidden", "handleSelection");
     return "<form id=\"ticketShop\">" . $T . $IA . "</form>";
 }
コード例 #11
0
 private static function inserirPrazo(Controlador $controle, Prazo $prazo)
 {
     //try {
     //Controlador::getInstance()->getConnection()->connection->beginTransaction();
     if (!isset($prazo->prazo->id_usuario_destino) || $prazo->prazo->id_usuario_destino == '') {
         $prazo->prazo->id_usuario_destino = NULL;
     }
     $prazo->id_unid_origem = isset($prazo->prazo->id_unid_origem) ? $prazo->prazo->id_unid_origem : Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE_ORIGINAL;
     //$prazo->id_usuario_origem = Controlador::getInstance()->usuario->ID;
     $prazo->id_usuario_origem = $controle->usuario->ID;
     $dt_prazo = Util::formatDate($prazo->prazo->dt_prazo);
     $pai = strlen($prazo->prazo->nu_proc_dig_ref_pai) > 0 ? $prazo->prazo->nu_proc_dig_ref_pai : null;
     $idPrazoPai = null;
     if (isset($prazo->prazo->id_prazo_pai)) {
         $idPrazoPai = $prazo->prazo->id_prazo_pai > 0 ? $prazo->prazo->id_prazo_pai : null;
     }
     //$stmt = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO TB_CONTROLE_PRAZOS (NU_PROC_DIG_REF, ID_USUARIO_ORIGEM, ID_USUARIO_DESTINO, ID_UNID_ORIGEM, ID_UNID_DESTINO, DT_PRAZO, TX_SOLICITACAO)
     //VALUES (?,?,?,?,?,?,?)");
     $stmt = $controle->getConnection()->connection->prepare("INSERT INTO TB_CONTROLE_PRAZOS (NU_PROC_DIG_REF, ID_USUARIO_ORIGEM, ID_USUARIO_DESTINO, ID_UNID_ORIGEM, ID_UNID_DESTINO, DT_PRAZO, TX_SOLICITACAO)\n            VALUES (?,?,?,?,?,?,?)");
     $stmt->bindParam(1, $prazo->prazo->nu_proc_dig_ref, PDO::PARAM_STR);
     $stmt->bindParam(2, $prazo->prazo->id_usuario_origem, PDO::PARAM_INT);
     $stmt->bindParam(3, $prazo->prazo->id_usuario_destino, PDO::PARAM_INT);
     $stmt->bindParam(4, $prazo->prazo->id_unid_origem, PDO::PARAM_INT);
     $stmt->bindParam(5, $prazo->prazo->id_unid_destino, PDO::PARAM_INT);
     $stmt->bindParam(6, $dt_prazo, PDO::PARAM_STR);
     $stmt->bindParam(7, $prazo->prazo->tx_solicitacao, PDO::PARAM_STR);
     $stmt->execute();
     //$lastIdPrazo = Controlador::getInstance()->getConnection()->connection->lastInsertId('TB_CONTROLE_PRAZOS_SQ_PRAZO_SEQ');
     $lastIdPrazo = $controle->getConnection()->connection->lastInsertId('TB_CONTROLE_PRAZOS_SQ_PRAZO_SEQ');
     //$sttt = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO EXT__SNAS__TB_CONTROLE_PRAZOS (ID,NU_PROC_DIG_REF_PAI, ID_PRAZO_PAI) VALUES (:id, :dig_ref_pai, :id_pai);");
     $sttt = $controle->getConnection()->connection->prepare("INSERT INTO EXT__SNAS__TB_CONTROLE_PRAZOS (ID,NU_PROC_DIG_REF_PAI, ID_PRAZO_PAI) VALUES (:id, :dig_ref_pai, :id_pai);");
     $sttt->bindParam(id, $lastIdPrazo, PDO::PARAM_INT);
     $sttt->bindParam(dig_ref_pai, $pai, PDO::PARAM_STR);
     $sttt->bindParam(id_pai, $idPrazoPai, PDO::PARAM_INT);
     $sttt->execute();
     new Log('TB_CONTROLE_PRAZOS', $lastIdPrazo, Zend_Auth::getInstance()->getIdentity()->ID, 'inserir');
     /*
                 Controlador::getInstance()->getConnection()->connection->commit();
     
                 return new Output(array('success' => 'true', 'message' => 'Prazo cadastrado com sucesso!'));
             } catch (Exception $e) {
                 Controlador::getInstance()->getConnection()->connection->rollBack();
                 return new Output(array('success' => 'false', 'error' => $e->getMessage()));
             }
     */
 }
コード例 #12
0
 /**
  * 
  */
 public function prepararCadastro($numero_processo, $interessado, $assunto, $assunto_complementar, $tipo_origem, $origem, $dt_autuacao, $dt_prazo)
 {
     /* Obs: Informacoes importante devem vir antes da validacao das mesmas */
     $this->numero_processo = $numero_processo;
     $this->assunto = trim($assunto);
     $this->assunto_complementar = $assunto_complementar ? $assunto_complementar : 'Em Branco';
     $this->interessado = str_replace(' ', '', trim($interessado));
     $this->dt_autuacao = Util::formatDate($dt_autuacao);
     $this->origem = trim($origem);
     $this->ano = date("Y");
     $diretoria = DaoUnidade::getUnidade(Controlador::getInstance()->usuario->ID_UNIDADE, 'sigla');
     $this->procedencia = $tipo_origem;
     $this->ultimo_tramite = "Área de Trabalho - {$diretoria}";
     $this->dt_cadastro = date("Y-m-d");
     $this->area_trabalho = $diretoria;
     $this->id_unidade = Controlador::getInstance()->usuario->ID_UNIDADE;
     if (!$this->iisset($this->processo)) {
         throw new Exception('Informações importantes não estão presentes no ato do cadastro deste processo!');
     }
     /* Obs: informacoes opcionais devem vir depois da validacao das mesmas */
     $this->dt_prazo = $dt_prazo ? Util::formatDate($dt_prazo) : NULL;
     return true;
 }
コード例 #13
0
ファイル: Volume.php プロジェクト: roquebrasilia/sgdoc-codigo
 /**
  * @return Output
  */
 public function listar()
 {
     $stmt = Controlador::getInstance()->getConnection()->connection->prepare('SELECT V.ID AS id, V.NU_VOLUME AS volume, V.FL_FINAL AS final, V.FL_INICIAL AS inicial, V.DT_ABERTURA AS abertura, V.DT_ENCERRAMENTO AS encerramento FROM TB_PROCESSOS_VOLUME AS V
          WHERE ID_PROCESSO_CADASTRO = ?
          AND ST_ATIVO = 1
          AND DT_ENCERRAMENTO IS NOT NULL');
     $stmt->bindParam(1, $this->getIdProcesso());
     $stmt->execute();
     $resul = $stmt->fetchAll(PDO::FETCH_ASSOC);
     $out['success'] = 'false';
     foreach ($resul as $value) {
         $value['QUANT'] = $value['FINAL'] - $value['INICIAL'] + 1;
         $value['ABERTURA'] = Util::formatDate($value['ABERTURA']);
         $value['ENCERRAMENTO'] = Util::formatDate($value['ENCERRAMENTO']);
         $out['data'][] = array_change_key_case($value, CASE_LOWER);
     }
     if (!empty($out)) {
         $out['success'] = 'true';
     }
     $this->print = $out;
     return new Output($out);
 }
コード例 #14
0
if ($_REQUEST) {
    try {
        $out = array();
        switch ($_REQUEST['acao']) {
            case 'close':
                // Destroi a sessão de pesquisa quando o documento é inserido após uma pesquisa
                Session::destroy('digitalPesquisarDemandasPR');
                break;
            case 'carregar':
                Session::set('digitalPesquisarDemandasPR', $_REQUEST['digital']);
                $documento = DaoDocumento::getDocumento($_REQUEST['digital']);
                /* Converter datas */
                $documento['dt_entrada'] = Util::formatDate($documento['dt_entrada']);
                $documento['dt_documento'] = Util::formatDate($documento['dt_documento']);
                $documento['dt_cadastro'] = Util::formatDate($documento['dt_cadastro']);
                $documento['dt_prazo'] = Util::formatDate($documento['dt_prazo']);
                $documento['fg_prazo'] = $documento['fg_prazo'] > 0 ? true : false;
                $documento['assunto'] = DaoAssuntoDocumento::getAssunto($documento['id_assunto'], 'assunto');
                $documento = new Output($documento);
                if (!empty($documento)) {
                    $out = array('success' => 'true', 'documento' => $documento->toArray());
                } else {
                    $out = array('success' => 'false');
                }
                break;
            case 'alterar':
                $documento = new Documento($_REQUEST);
                $out = DaoDocumentoDemanda::alterarDocumento($documento)->toArray();
                if (is_array($documento)) {
                    $out['documento'] = $documento;
                }
コード例 #15
0
$pdf->Cell(10, 5, "DIGITAL ", 1, 0, 'C');
$pdf->Cell(15, 5, "DATA", 1, 0, 'C');
$pdf->Cell(30, 5, "TIPO", 1, 0, 'C');
$pdf->Cell(30, 5, "NUMERO", 1, 0, 'C');
$pdf->Cell(100, 5, "ORIGEM", 1, 1, 'C');
foreach (Tramite::getDigitaisGuiaRecibo() as $key => $digital) {
    try {
        $stmt = Controlador::getInstance()->getConnection()->connection->prepare("SELECT TIPO,NUMERO,ORIGEM,ASSUNTO,DT_DOCUMENTO FROM TB_DOCUMENTOS_CADASTRO WHERE DIGITAL = ? LIMIT 1");
        $stmt->bindParam(1, $digital, PDO::PARAM_INT);
        $stmt->execute();
        $out = $stmt->fetch(PDO::FETCH_ASSOC);
        if (!empty($out)) {
            $pdf->SetFont("Arial", "", 6);
            $pdf->Cell(5, 5, ++$cont, 1, 'C');
            $pdf->Cell(10, 5, $digital, 1, 0, 'C');
            $pdf->Cell(15, 5, Util::formatDate($out['DT_DOCUMENTO']), 1, 0, 'C');
            $pdf->Cell(30, 5, $out['TIPO'], 1, 0, 'C');
            $pdf->Cell(30, 5, $out['NUMERO'], 1, 0, 'C');
            $pdf->SetFont("Arial", "", 5);
            $pdf->Cell(100, 5, $out['ORIGEM'], 1, 1, 'C');
        }
    } catch (PDOException $e) {
        throw new Exception($e);
    }
}
$pdf->Ln(10);
$pdf->Cell(5, 5, "", 0, 0, 'C');
$pdf->SetFont("Arial", "B", 6);
$pdf->Cell(180, 5, "COMPROVANTE DE RECEBIMENTO", 0, 0, 'C');
$pdf->Cell(5, 5, "", 0, 1, 'L');
$pdf->ln(5);
コード例 #16
0
ファイル: Util.class.php プロジェクト: nemiah/fheME
 public static function CLDateParserL($date, $l = "load")
 {
     if ($l == "load") {
         return Util::formatDate($_SESSION["S"]->getUserLanguage(), $date, true);
     }
     return "mode {$l} not supported";
 }
コード例 #17
0
 /**
  * @return void
  * @param string $numero_processo
  */
 public function generateFolhaDespachoProcesso($numero_processo)
 {
     define("FPDF_FONTPATH", "bibliotecas/fpdf/font/");
     include "bibliotecas/fpdf/fpdf.php";
     $stmt = Controlador::getInstance()->getConnection()->connection->prepare("SELECT PC.NUMERO_PROCESSO, PC.DT_AUTUACAO AS AUTUACAO, TB_PROCESSOS_INTERESSADOS.INTERESSADO,\n                                    TB_PROCESSOS_INTERESSADOS.CNPJ_CPF as CNPJ_CPF, PA.ASSUNTO\n                                FROM TB_PROCESSOS_CADASTRO PC INNER JOIN TB_PROCESSOS_ASSUNTO PA ON PA.ID = PC.ASSUNTO\n                                    INNER JOIN TB_PROCESSOS_INTERESSADOS ON TB_PROCESSOS_INTERESSADOS.ID = PC.INTERESSADO\n                                WHERE PC.NUMERO_PROCESSO = ? LIMIT 1");
     $stmt->bindParam(1, $numero_processo, PDO::PARAM_STR);
     $stmt->execute();
     $processo = $stmt->fetch(PDO::FETCH_ASSOC);
     if (empty($processo)) {
         print 'Processo não encontrado!';
         return;
     }
     $pdf = new FPDF();
     $pdf->Open();
     $pdf->AddPage();
     $pdf->SetFont("Arial", '', 10);
     $pdf->Image("imagens/" . __LOGO_JPG__, 95, 8, 20, 20);
     $pdf->Ln(2);
     $pdf->Cell(185, 8, "Folha de Despachos", 0, 0, 'R');
     $pdf->Ln(20);
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(180, 5, utf8_decode(__CABECALHO_ORGAO__), 0, 0, 'C');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->Cell(180, 5, '', 0, 0, 'R');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(180, 5, utf8_decode("Informações do Processo"), 0, 0, 'C');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(35, 5, utf8_decode("Número do Processo:"), 0, 0, 'L');
     $pdf->SetFont("Arial", '', 9);
     $pdf->Cell(90, 5, $numero_processo, 0, 0, 'L');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(30, 5, utf8_decode("Data da Autuação:"), 0, 0, 'L');
     $pdf->SetFont("Arial", '', 9);
     $pdf->Cell(25, 5, Util::formatDate($processo['AUTUACAO']), 0, 0, 'L');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(20, 5, "Interessado:", 0, 0, 'L');
     $pdf->SetFont("Arial", '', 9);
     $pdf->Cell(160, 5, utf8_decode($processo['INTERESSADO']), 0, 0, 'L');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->Cell(15, 5, "Assunto:", 0, 0, 'L');
     $pdf->SetFont("Arial", '', 9);
     $pdf->Cell(165, 5, utf8_decode($processo['ASSUNTO']), 0, 0, 'L');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->SetFont("Arial", "B", 9);
     $pdf->Cell(180, 5, "Despachos", 0, 0, 'C');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->Cell(5, 5, '', 0, 0, 'C');
     $pdf->Cell(180, 5, '', 0, 0, 'C');
     $pdf->Cell(5, 5, '', 0, 1, 'L');
     $pdf->SetFont("Arial", '', 7);
     $pdf->Cell(5, 64, "1", 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(5, 64, "2", 1, 1, 'C');
     $pdf->SetFont("Arial", '', 7);
     $pdf->Cell(5, 64, "3", 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(5, 64, "4", 1, 1, 'C');
     $pdf->SetFont("Arial", '', 7);
     $pdf->Cell(5, 64, "5", 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(90, 64, '', 1, 0, 'C');
     $pdf->Cell(5, 64, "6", 1, 1, 'C');
     $pdf->Output("bibliotecas/fpdf", "i");
 }
コード例 #18
0
    /**
     * Concatena os textos da resposta de um prazo filho com o prazo pai,
     * incluíndo objetivos/metas e ações PPA/LOA, e arquivos anexos 
     * @param string $idPrazoPai
     * @param string $idPrazoFilho
     * @throws Exception
     * @return Output
     */
    public static function concatenarResposta($idPrazoPai = false, $idPrazoFilho = false)
    {
        try {
            if (!$idPrazoPai) {
                throw new Exception('Informe o prazo PAI.');
            }
            if (!$idPrazoFilho) {
                throw new Exception('Informe o prazo FILHO.');
            }
            $prazoPai = self::getPrazoResposta($idPrazoPai);
            if (!$prazoPai) {
                throw new Exception('Prazo PAI não localizado.');
            }
            $prazoFilho = self::getPrazoResposta($idPrazoFilho);
            if (!$prazoFilho) {
                throw new Exception('Prazo FILHO não localizado.');
            }
            $respostaPrazo = new Prazo();
            $respostaPrazo->prazo->sq_prazo = $idPrazoPai;
            $respostaPrazo->prazo->nu_proc_dig_res = null;
            $respostaPrazo->prazo->tx_resposta = '';
            if (trim($prazoPai['tx_resposta']) != '') {
                $respostaPrazo->prazo->tx_resposta = trim($prazoPai['tx_resposta']) . "\n\n";
            }
            $respostaPrazo->prazo->tx_resposta .= trim($prazoFilho['tx_resposta']);
            $respostaPrazo->prazo->ha_vinculo = $prazoPai['ha_vinculo'] == false ? $prazoFilho['ha_vinculo'] : $prazoPai['ha_vinculo'];
            if ($prazoPai['legislacao_situacao'] == 0) {
                $respostaPrazo->prazo->legislacao_situacao = $prazoFilho['legislacao_situacao'];
                $respostaPrazo->prazo->legislacao_descricao = $prazoFilho['legislacao_descricao'];
            } else {
                if ($prazoFilho['legislacao_situacao'] > 0) {
                    $respostaPrazo->prazo->legislacao_descricao = self::getSituacaoLegislacao($prazoPai['legislacao_situacao']) . ":\n" . $prazoPai['legislacao_descricao'];
                    $respostaPrazo->prazo->legislacao_situacao = $prazoFilho['legislacao_situacao'];
                    $respostaPrazo->prazo->legislacao_descricao .= "\n\n" . self::getSituacaoLegislacao($prazoFilho['legislacao_situacao']) . ":\n" . $prazoFilho['legislacao_descricao'];
                } else {
                    $respostaPrazo->prazo->legislacao_situacao = $prazoPai['legislacao_situacao'];
                    $respostaPrazo->prazo->legislacao_descricao = $prazoPai['legislacao_descricao'];
                }
            }
            Controlador::getInstance()->getConnection()->connection->beginTransaction();
            self::salvarResposta($respostaPrazo);
            //OBJETIVOS E METAS
            $sql = 'insert into snas.tb_prazo_vinculo_ppa (id_prazo, codigo_orgao, codigo_programa, codigo_objetivo, codigo_meta, exercicio)
					select :prazoPai, f.codigo_orgao, f.codigo_programa, f.codigo_objetivo, f.codigo_meta, f.exercicio
					from snas.tb_prazo_vinculo_ppa f
					  left join snas.tb_prazo_vinculo_ppa p on (
					    p.id_prazo = :prazoPai and
    				    p.st_ativo = 1 and
					    p.codigo_orgao=f.codigo_orgao and
					    p.codigo_programa=f.codigo_programa and
					    p.codigo_objetivo=f.codigo_objetivo and
					    p.codigo_meta=f.codigo_meta and
					    p.exercicio=f.exercicio
					  )
					where f.id_prazo = :prazoFilho and f.st_ativo = 1 and p.id is null;';
            $stmt = Controlador::getInstance()->getConnection()->connection->prepare($sql);
            $stmt->bindParam('prazoPai', $idPrazoPai, PDO::PARAM_INT);
            $stmt->bindParam('prazoFilho', $idPrazoFilho, PDO::PARAM_INT);
            $stmt->execute();
            //AÇÕES
            $sql = 'insert into snas.tb_prazo_vinculo_ppa_acoes (id_prazo, codigo_orgao, codigo_programa, codigo_acao, exercicio)
					select :prazoPai, f.codigo_orgao, f.codigo_programa, f.codigo_acao, f.exercicio
					  from snas.tb_prazo_vinculo_ppa_acoes f
					    left join snas.tb_prazo_vinculo_ppa_acoes p on (
					      p.id_prazo = :prazoPai and
					      p.st_ativo = 1 and
					      p.codigo_orgao=f.codigo_orgao and
					      p.codigo_programa=f.codigo_programa and
					      p.codigo_acao=f.codigo_acao and
					      p.exercicio=f.exercicio
					    )
					where f.id_prazo = :prazoFilho and f.st_ativo = 1 and p.id is null;';
            $stmt = Controlador::getInstance()->getConnection()->connection->prepare($sql);
            $stmt->bindParam('prazoPai', $idPrazoPai, PDO::PARAM_INT);
            $stmt->bindParam('prazoFilho', $idPrazoFilho, PDO::PARAM_INT);
            $stmt->execute();
            //ANEXOS
            $anexos = self::listarArquivosAnexos($idPrazoFilho);
            $raiz = '/' . (string) Util::gerarRaiz($prazoPai['digital_pai'], __CAM_UPLOAD__) . '/' . $prazoPai['digital_pai'] . '/pdf/';
            $dirDest = __CAM_UPLOAD__ . $raiz;
            if (!is_dir($dirDest)) {
                @mkdir($dirDest, 0777, true);
            }
            $sql = 'INSERT INTO snas.tb_prazo_anexos (id_prazo, nome_arquivo_sistema, nome_original, dt_upload, id_pessoa)
    				VALUES (:prazoPai, :arquivo, :nome, :data, :usuario);';
            $stmt = Controlador::getInstance()->getConnection()->connection->prepare($sql);
            for ($i = 0; $i < count($anexos); $i++) {
                $arqOrigem = __CAM_UPLOAD__ . trim($anexos[$i]['NOME_ARQUIVO_SISTEMA']);
                $arqDestino = $dirDest . substr(trim($anexos[$i]['NOME_ARQUIVO_SISTEMA']), -36);
                $nomeSistema = $raiz . substr(trim($anexos[$i]['NOME_ARQUIVO_SISTEMA']), -36);
                $stmt->bindParam('prazoPai', $idPrazoPai, PDO::PARAM_INT);
                $stmt->bindParam('arquivo', $nomeSistema, PDO::PARAM_STR);
                $stmt->bindParam('nome', $anexos[$i]['NOME_ORIGINAL'], PDO::PARAM_STR);
                $stmt->bindParam('data', Util::formatDate($anexos[$i]['DT_UPLOAD']), PDO::PARAM_STR);
                $stmt->bindParam('usuario', $anexos[$i]['ID_PESSOA'], PDO::PARAM_INT);
                $stmt->execute();
                if (!file_exists($arqDestino)) {
                    if (file_exists($arqOrigem)) {
                        if (!copy($arqOrigem, $arqDestino)) {
                            throw new Exception("Erro ao copiar o arquivo anexo: {$anexos[$i]['NOME_ORIGINAL']}");
                        }
                    } else {
                        throw new Exception("Não foi possível localizar o arquivo anexo: {$anexos[$i]['NOME_ORIGINAL']}");
                    }
                }
            }
            Controlador::getInstance()->getConnection()->connection->commit();
            return new Output(array('success' => 'true', 'message' => 'Resposta concatenada com sucesso!'));
        } catch (PDOException $e) {
            Controlador::getInstance()->getConnection()->connection->rollBack();
            return new Output(array('success' => 'false', 'error' => $e->getMessage()));
        }
    }
コード例 #19
0
 unset($documento->documento->numero_peca);
 $processo = DaoProcesso::getProcesso($numero_processo);
 if (!Processo::validarProcessoAreaDeTrabalho($numero_processo)) {
     $out = new Output(array('success' => 'false', 'error' => 'Processo não se encontra na área de trabalho do ARQUIVO'));
     print json_encode($out->toArray());
     exit;
 }
 $processo['nm_interessado'] = Processo::getInteressado($processo['interessado'], 'interessado');
 $processo['nm_assunto'] = Processo::getAssunto($processo['assunto'], 'assunto');
 if ($processo['procedencia'] == 'I') {
     $processo['nm_origem'] = DaoUnidade::getUnidade($processo['origem'], 'nome');
 } else {
     $tmp = Processo::getOrigemExterna($processo['origem'], 'origem');
     $processo['nm_origem'] = $tmp['origem'];
 }
 $processo['dt_autuacao'] = Util::formatDate($processo['dt_autuacao']);
 $documento->data_documento = $processo['dt_autuacao'];
 $documento->data_entrada = $processo['dt_autuacao'];
 $documento->origem = $processo['nm_origem'];
 $documento->tipo = "DIGITALIZACAO DE PROCESSO";
 $documento->assunto = 2;
 // Abertura de Processo
 $documento->interessado = $processo['nm_interessado'];
 $documento->id_unid_area_trabalho = $processo['id_unid_area_trabalho'];
 $documento->assunto_complementar = $processo['assunto_complementar'];
 $documento->procedencia = $processo['procedencia'];
 $unique = DaoDocumento::uniqueDocumento($documento)->toArray();
 if ($unique['success'] == 'false') {
     $unique['error'] .= "\nFavor alterar o tipo de vinculação para adicionar um novo anexo ou volume,\n ou altere o número do volume/anexo.";
     print json_encode($unique);
     exit;
コード例 #20
0
 //para comprovar sua existência, e então buscar demais dados
 $doc = DaoDocumentoDemanda::getDocumento((int) $idDocumento);
 if ($doc === false) {
     throw new Exception("Documento{$digDocumento} não localizado para exportação.");
 }
 /* Será um arquivo para cada documento
  * nome do arquivo = TipoDocumento#######.txt, onde ####### = digital
  */
 $nomeArq = StringUtil::getCamelCase($doc['tipo']) . $doc['digital'] . '.txt';
 $fp = fopen($pastaTmp . $nomeArq, 'w');
 //Impressão da capa
 fwrite($fp, "Caderno de Respostas\n\n" . $doc['interessado'] . "\n\n" . date("Y") . "\n\n");
 //Converter datas
 $doc['dt_entrada'] = Util::formatDate($doc['dt_entrada']);
 $doc['dt_documento'] = Util::formatDate($doc['dt_documento']);
 $doc['dt_prazo'] = Util::formatDate($doc['dt_prazo']);
 $doc['id_assunto'] = DaoAssuntoDocumento::getAssunto($doc['id_assunto'], 'assunto');
 $doc['procedencia'] = $doc['procedencia'] == 'I' ? 'Interna' : 'Externa';
 $buscarPrazos = false;
 $buscarPPA = false;
 $buscarExecOrc = false;
 foreach ($arrOpcSel as $opt) {
     if (substr($opt, 0, 3) == 'doc') {
         $arrTmp = getOpcao($arrOpcoes, 'id', $opt);
         fwrite($fp, $arrTmp[0]['label'] . ': ' . $doc[$arrTmp[0]['campo']] . "\n");
     } elseif (substr($opt, 0, 3) == 'prz') {
         if ($opt == 'prz-ppa') {
             $buscarPPA = true;
         } elseif ($opt == 'prz-exec_orc') {
             $buscarExecOrc = true;
         } else {
コード例 #21
0
ファイル: mTodoGUI.class.php プロジェクト: nemiah/fheME
 function deleteFromCalendar($todoID, $makeException = false)
 {
     if (!$makeException) {
         $T = new Todo($todoID);
         $T->deleteMe();
     } else {
         $T = new Todo($todoID);
         $T->changeA("TodoIsDeleted", "1");
         $T->changeA("TodoExceptionForID", $todoID);
         $T->changeA("TodoFromDay", Util::parseDate("de_DE", Util::formatDate("de_DE", $makeException)));
         $T->changeA("TodoTillDay", Util::parseDate("de_DE", Util::formatDate("de_DE", $makeException)));
         $T->changeA("TodoExceptionStarttime", $makeException);
         $T->changeA("TodoRepeat", "");
         $T->newMe();
         $TO = new Todo($todoID);
         $TO->saveMe();
     }
 }