-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsia_gerarsiacelrf.php
executable file
·298 lines (246 loc) · 9.77 KB
/
sia_gerarsiacelrf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?php
/**
*
* @author I
* @revision $Author: dbrobson $
* @version $Revision: 1.10 $
*/
require("libs/db_stdlib.php");
require("libs/db_utils.php");
require("libs/db_conecta.php");
include("libs/db_sessoes.php");
include("libs/db_usuariosonline.php");
include("dbforms/db_funcoes.php");
?>
<html>
<head>
<title>DBSeller Informática Ltda - Página Inicial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Expires" CONTENT="0">
<script language="JavaScript" type="text/javascript"
src="scripts/scripts.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/strings.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/prototype.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/widgets/dbmessageBoard.widget.js"></script>
<link href="estilos.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#cccccc" style="margin-top: 25px;">
<center>
<form name="form1" method="post" action="">
<div style="display: table">
<fieldset>
<legend>
<b>Gerar SIACE-LRF</b>
</legend>
<table style='empty-cells: show; border-collapse: collapse;'>
<tr>
<td colspan="4">
<fieldset>
<table>
<tr>
<td>Mês Referência: </td>
<td>
<select id="MesReferencia" class="MesReferencia" >
<option value="01">Janeiro</option>
<option value="02">Fevereiro</option>
<option value="03">Março</option>
<option value="04">Abril</option>
<option value="05">Maio</option>
<option value="06">Junho</option>
<option value="07">Julho</option>
<option value="08">Agosto</option>
<option value="09">Setembro</option>
<option value="10">Outubro</option>
<option value="11">Novembro</option>
<option value="12">Dezembro</option>
</select>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td colspan="2" align="center">Seleciono o arquivo</td>
<td>Arquivos Gerados</td>
</tr>
<tr>
<td style="border: 2px groove white; padding-right: 10px;" valign="top">
<br><br>
<input type="checkbox" value="siacelrfdespesaconsolidadas" id="siacelrfdespesaconsolidadas" />
<label for="siacelrfdespesaconsolidadas">Despesas Correntes consolidadas</label><br>
<input type="checkbox" value="siacelrfdespesacapitalconsolidadas" id="siacelrfdespesacapitalconsolidadas" />
<label for="siacelrfdespesaconsolidadas">Despesas de Capital consolidadas</label><br>
<input type="checkbox" value="siacelrfdespesasfuncaosubfuncao" id="siacelrfdespesasfuncaosubfuncao" />
<label for="siacelrfdespesasfuncaosubfuncao">Despesas por Função e Subfunção</label><br>
<input type="checkbox" value="siacelrfreceitascorrentes" id="siacelrfreceitascorrentes" />
<label for="siacelrfreceitascorrentes">Receitas Correntes</label><br>
<input type="checkbox" value="siacelrfreceitascapital" id="siacelrfreceitascapital" />
<label for="siacelrfreceitascapital">Receitas de Capital</label><br>
<input type="checkbox" value="siacelrfdeducaoreceita" id="siacelrfdeducaoreceita" />
<label for="siacelrfdeducaoreceita">Dedução Receitas</label><br>
</td>
<td style="border: 2px groove white;" valign="top">
</td>
<td style="border: 2px groove white;" valign="top">
<div id='retorno'
style="width: 200px; height: 250px; overflow: scroll;">
</div>
</td>
</tr>
</table>
</fieldset>
<div style="text-align: center;">
<input type="button" id="btnMarcarTodos" value="Marcar Todos" onclick="js_marcaTodos();" />
<input type="button" id="btnLimparTodos" value="Limpar Todos" onclick="js_limpa();"/>
<input type="button" id="btnProcessar" value="Processar"
onclick="js_processar();" />
</div>
</div>
</form>
</center>
</body>
</html>
<? db_menu(db_getsession("DB_id_usuario"), db_getsession("DB_modulo"),db_getsession("DB_anousu"),db_getsession("DB_instit")); ?>
<script type="text/javascript">
function js_processar() {
var aArquivosSelecionados = new Array();
var aArquivos = $$("input[type='checkbox']");
var iMesReferencia = $("MesReferencia");
/*
* iterando sobre o array de arquivos com uma função anônima para pegar os arquivos selecionados pelo usuário
*/
aArquivos.each(function (oElemento, iIndice) {
if (oElemento.checked) {
aArquivosSelecionados.push(oElemento.value);
}
});
if (aArquivosSelecionados.length == 0) {
alert("Nenhum arquivo foi selecionado para ser gerado");
return false;
}
js_divCarregando('Aguarde, processando arquivos','msgBox');
var oParam = new Object();
// oParam.exec = "processarSiaceLRF";
oParam.arquivos = aArquivosSelecionados;
oParam.mesReferencia = iMesReferencia.value;
var oAjax = new Ajax.Request("sia_gerarsiacelrfarquivos.php",
{
method:'post',
parameters:'json='+Object.toJSON(oParam),
onComplete:js_retornoProcessamento
}
);
}
function js_retornoProcessamento(oAjax) {
js_removeObj('msgBox');
$('debug').innerHTML = oAjax.responseText;
var oRetorno = eval("("+oAjax.responseText+")");
if (oRetorno.status == 1) {
alert("Processo concluído com sucesso!");
var sRetorno = "<b>Arquivos Gerados:</b><br>";
for (var i = 0; i < oRetorno.itens.length; i++) {
with (oRetorno.itens[i]) {
sRetorno += "<a target='_blank' href='db_download.php?arquivo="+nome+".txt'>"+nome+"</a><br>";
}
}
$('retorno').innerHTML = sRetorno;
} else {
$('retorno').innerHTML = '';
alert("Ouve um erro no processamento!" + oRetorno.message.urlDecode());
//alert(oRetorno.message.urlDecode());
return false;
}
}
function js_pesquisao125_cronogramaperspectiva(mostra) {
if (mostra==true){
/*
*passa o nome dos campos do banco para pesquisar pela função js_mostracronogramaperspectiva1
*a variavel funcao_js é uma variável global
*db_lovrot recebe parâmetros separados por |
*/
js_OpenJanelaIframe('CurrentWindow.corpo',
'db_iframe_cronogramaperspectiva',
'func_cronogramaperspectiva.php?funcao_js='+
'parent.js_mostracronogramaperspectiva1|o124_sequencial|o124_descricao|o124_ano',
'Perspectivas do Cronograma',true);
}else{
if ($F('o124_sequencial') != ''){
js_OpenJanelaIframe('CurrentWindow.corpo',
'db_iframe_cronogramaperspectiva',
'func_cronogramaperspectiva.php?pesquisa_chave='+
$F('o124_sequencial')+
'&funcao_js=parent.js_mostracronogramaperspectiva',
'Perspectivas do Cronograma',
false);
}else{
$('o124_sequencial').value = '';
}
}
}
//para retornar sem mostrar a tela de pesquisa. ao digitar o codigo retorna direto para o campo
function js_mostracronogramaperspectiva(chave,erro, ano) {
$('o124_descricao').value = chave;
if(erro==true) {
$('o124_sequencial').focus();
$('o124_sequencial').value = '';
}
}
//preenche os campos do frame onde foi chamada com os valores do banco
function js_mostracronogramaperspectiva1(chave1,chave2,chave3) {
$('o124_sequencial').value = chave1;
$('o124_descricao').value = chave2;
db_iframe_cronogramaperspectiva.hide();
}
function js_pesquisa_ppa(mostra) {
if(mostra==true){
js_OpenJanelaIframe('CurrentWindow.corpo',
'db_iframe_ppa',
'func_ppaversaosigap.php?funcao_js='+
'parent.js_mostrappa1|o119_sequencial|o01_descricao',
'Perspectivas do Cronograma',true);
}else{
if( $F('o119_sequencial') != ''){
js_OpenJanelaIframe('CurrentWindow.corpo',
'db_iframe_ppa',
'func_ppaversaosigap.php?pesquisa_chave='+
$F('o119_sequencial')+
'&funcao_js=parent.js_mostrappa',
'Perspectivas do Cronograma',
false);
}else{
document.form1.o124_descricao.value = '';
document.form1.ano.value = ''
}
}
}
function js_mostrappa(chave,erro, ano) {
$('o119_descricao').value = chave;
if(erro==true) {
$('o119_sequencial').focus();
$('o119_sequencial').value = '';
}
}
function js_mostrappa1(chave1,chave2,chave3) {
$('o119_sequencial').value = chave1;
$('o119_descricao').value = chave2;
db_iframe_ppa.hide();
}
function js_marcaTodos() {
var aCheckboxes = $$('input[type=checkbox]');
aCheckboxes.each(function(oCheckbox) {
oCheckbox.checked = true;
});
}
function js_limpa() {
var aCheckboxes = $$('input[type=checkbox]');
aCheckboxes.each(function (oCheckbox) {
oCheckbox.checked = false;
});
}
</script>
<div id='debug'>
</div>