| Server IP : 20.75.53.88 / Your IP : 216.73.217.72 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/apitce/dev/form/json/ |
Upload File : |
<?php
/**
* Created by PhpStorm.
* User: Wladimir
* Date: 15/02/2017
* Time: 13:13
*/
ini_set("memory_limit", "128M");
$codigo_municipio = isset($_POST['codigo_municipio']) ? $_POST['codigo_municipio'] : '0';
$exercicio_orcamento = isset($_POST['exercicio_orcamento']) ? $_POST['exercicio_orcamento'] : '0';
#$codigo_orgao = isset($_POST['codigo_orgao']) ? $_POST['codigo_orgao'] : '';
$json_url = "api.tcm.ce.gov.br/sim/1_0/notas_empenhos.json?codigo_municipio=$codigo_municipio&codigo_orgao=&data_referencia_empenho=$exercicio_orcamento";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $json_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = json_decode(curl_exec($ch));
$rows = $output->rsp->_content;
$ok = $output->rsp->stat;
if ($ok == '[ ok ]') {
$dao = new notas_empenhosDAO();
$notas_empenhosBE = new notas_empenhosBE();
foreach ($rows as $value) {
$notas_empenhosBE->setCodigo_municipio($value->codigo_municipio);
$notas_empenhosBE->setExercicio_orcamento($value->exercicio_orcamento);
$notas_empenhosBE->setCodigo_orgao($value->codigo_orgao);
$notas_empenhosBE->setCodigo_unidade($value->codigo_unidade);
$notas_empenhosBE->setData_emissao_empenho($value->data_emissao_empenho);
$notas_empenhosBE->setNumero_empenho($value->numero_empenho);
$notas_empenhosBE->setData_referencia_empenho($value->data_referencia_empenho);
$notas_empenhosBE->setCodigo_funcao($value->codigo_funcao);
$notas_empenhosBE->setCodigo_subfuncao($value->codigo_subfuncao);
$notas_empenhosBE->setCodigo_programa($value->codigo_programa);
$notas_empenhosBE->setCodigo_projeto_atividade($value->codigo_projeto_atividade);
$notas_empenhosBE->setNumero_projeto_atividade($value->numero_projeto_atividade);
$notas_empenhosBE->setNumero_subprojeto_atividade($value->numero_subprojeto_atividade);
$notas_empenhosBE->setCodigo_elemento_despesa($value->codigo_elemento_despesa);
$notas_empenhosBE->setModalidade_empenho($value->modalidade_empenho);
$notas_empenhosBE->setDescricao_empenho($value->descricao_empenho);
$notas_empenhosBE->setValor_anterior_saldo_dotacao($value->valor_anterior_saldo_dotacao);
$notas_empenhosBE->setValor_empenhado($value->valor_empenhado);
$notas_empenhosBE->setValor_atual_saldo_dotacao($value->valor_atual_saldo_dotacao);
$notas_empenhosBE->setTipo_processo_licitatorio($value->tipo_processo_licitatorio);
$notas_empenhosBE->setNumero_documento_negociante($value->numero_documento_negociante);
$notas_empenhosBE->setEstado_empenho($value->estado_empenho);
$notas_empenhosBE->setNumero_nota_anulacao($value->numero_nota_anulacao);
$notas_empenhosBE->setData_emissao_empenho_substituto($value->data_emissao_empenho_substituto);
$notas_empenhosBE->setNumero_empenho_substituto($value->numero_empenho_substituto);
$notas_empenhosBE->setCd_cpf_gestor($value->cd_cpf_gestor);
$notas_empenhosBE->setCpf_gestor_contrato($value->cpf_gestor_contrato);
$notas_empenhosBE->setData_contrato($value->data_contrato);
$notas_empenhosBE->setNumero_contrato($value->numero_contrato);
$notas_empenhosBE->setData_realizacao_licitacao($value->data_realizacao_licitacao);
$notas_empenhosBE->setNumero_licitacao($value->numero_licitacao);
$notas_empenhosBE->setCodigo_tipo_negociante($value->codigo_tipo_negociante);
$notas_empenhosBE->setNome_negociante($value->nome_negociante);
$notas_empenhosBE->setEndereco_negociante($value->endereco_negociante);
$notas_empenhosBE->setFone_negociante($value->fone_negociante);
$notas_empenhosBE->setCep_negociante($value->cep_negociante);
$notas_empenhosBE->setNome_municipio_negociante($value->nome_municipio_negociante);
$notas_empenhosBE->setCodigo_uf($value->codigo_uf);
$notas_empenhosBE->setTipo_fonte($value->tipo_fonte);
$notas_empenhosBE->setCodigo_fonte($value->codigo_fonte);
$dao->incluir($notas_empenhosBE);
echo $notas_empenhosBE->getNumero_empenho() . "<br>";
}
curl_close($ch);
?>
<script language="JavaScript">
history.go(-1);
</script>
<?php
} else {
echo "DADOS NÃO ENCONTRADO";
}