Пример #1
0
 $dig = DaoDocumento::numDigitalDisponivelSic()->toArray();
 if (!$dig['success']) {
     // Digital foi pêga enquanto o form era preenchido
     // retornar erro
     print json_encode($dig);
     exit;
 }
 $documento = new Documento($_POST);
 $documento->nome = $nome;
 if ($cpf) {
     $documento->cpf = $cpf;
 }
 if ($email) {
     $documento->email = $email;
 }
 $out = DaoDocumento::validarNumSolicitacaoSic($documento->numero)->toArray();
 if ($out['success'] != 'true') {
     // Numero de solicitacao já cadastrado
     print json_encode($out);
     exit;
 }
 $oDestino = DaoUnidade::getUnidade(null);
 $documento->digital = $dig['digital'];
 $documento->tipo = "INFORMACAO SIC";
 $documento->origem = "CGU";
 $documento->destino = $oDestino['nome'] . ' - ' . $oDestino['sigla'];
 $documento->tecnico_responsavel = "RESPONSÁVEL SIC";
 $documento->assunto_complementar = $ocr;
 $documento->interessado = $interessado;
 $documento->assinatura = NULL;
 $documento->cargo = NULL;