-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcertidao_negativa.php
More file actions
executable file
·488 lines (478 loc) · 22.4 KB
/
certidao_negativa.php
File metadata and controls
executable file
·488 lines (478 loc) · 22.4 KB
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?
/*
* E-cidade Software Publico para Gestao Municipal
* Copyright (C) 2009 DBselller Servicos de Informatica
* www.dbseller.com.br
* e-cidade@dbseller.com.br
*
* Este programa e software livre; voce pode redistribui-lo e/ou
* modifica-lo sob os termos da Licenca Publica Geral GNU, conforme
* publicada pela Free Software Foundation; tanto a versao 2 da
* Licenca como (a seu criterio) qualquer versao mais nova.
*
* Este programa e distribuido na expectativa de ser util, mas SEM
* QUALQUER GARANTIA; sem mesmo a garantia implicita de
* COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM
* PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais
* detalhes.
*
* Voce deve ter recebido uma copia da Licenca Publica Geral GNU
* junto com este programa; se nao, escreva para a Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*
* Copia da licenca no diretorio licenca/licenca_en.txt
* licenca/licenca_pt.txt
*/
include("libs/db_conecta.php");
include("classes/db_db_certidaoweb_classe.php");
db_mensagem("certidaonegativa","");
$meses = array("","JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO");
$data = getdate();
$mes1 = $data['mon'];
if((strlen($mes1)) == 1)
$mes = $meses[$mes1];
$mes1 = $data['mon'];
if((strlen($mes1)) == 1)
$mes1 = "0".$mes1;
$dia = $data['mday'];
if((strlen($dia)) == 1)
$dia = "0".$dia;
$ano = $data['year'];
$hora = $data['hours'];
if((strlen($hora)) == 1)
$hora = "0".$hora;
$min = $data['minutes'];
if((strlen($min)) == 1)
$min = "0".$min;
$sec = $data['seconds'];
if((strlen($sec)) == 1)
$sec = "0".$sec;
$mes2 = $mes1 + "3";
if($mes2 !=12){
if($mes2%2 == 0 && $dia > 30 ){
$dia = ($dia - 1);
}elseif(($mes2 == 2) && ($dia > 28)){
$dia = 28;
}
}
if($mes1==10){
$ano = $ano + 1;
$mes2 = 01;
}
if($mes1==11){
$ano = $ano + 1;
$mes2 = 02;
}
if($mes1==12){
$ano = $ano + 1;
$mes2 = 03;
}
if ($tipo == 0){
if($tipodados == "nome"){
$tipo = "1";
}elseif($tipodados == "matric"){
$tipo = "2";
}elseif($tipodados == "inscr"){
$tipo = "3";
}
}elseif ($tipo == 1){
if($tipodados == "nome"){
$tipo = "4";
}elseif($tipodados == "matric"){
$tipo = "5";
}elseif($tipodados == "inscr"){
$tipo = "6";
}
}elseif ($tipo == 2){
if($tipodados == "nome"){
$tipo = "7";
}elseif($tipodados == "matric"){
$tipo = "8";
}elseif($tipodados == "inscr"){
$tipo = "9";
}
}
$sequencia = pg_exec("select nextval('db_certidaoweb_codcert_seq')");
$seq2 = pg_result($sequencia,0,0);
$tamanho = strlen($seq2);
$seq = "";
for($i=0; $i<(7-$tamanho); $i++){
$seq .= "0";
}
$seq .= $seq2;
$sql = pg_exec("select cgc from db_config limit 1");
for ($i=0;$i<(pg_numfields($sql));$i++){
db_fieldsmemory($sql,0);
}
$nros = $seq.$cgc.$ano.$mes1.$dia.$hora.$min.$sec.$ano;
$t1 = strrev($nros);
//////////////////////////////////////////////////////////////////////
$HTTP_SERVER_VARS['SCRIPT_FILENAME'];
$root = substr($HTTP_SERVER_VARS['SCRIPT_FILENAME'],0,strrpos($HTTP_SERVER_VARS['SCRIPT_FILENAME'],"/"));
$cod = ereg_replace(" ","",$seq);
$arquivo = ($root."/"."certidoes/certidao".$cod.".php");
$fd = fopen($arquivo,"w");
$ffputs = ( '<html>'."\n");
$ffputs .= ( '<head>'."\n");
$ffputs .= ( '<title>Documento sem título</title>'."\n");
$ffputs .= ( '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'."\n");
$ffputs .= ( '</head>'."\n");
$ffputs .= ( '<STYLE>'."\n");
$ffputs .= ( ' .link color: white;'."\n");
$ffputs .= ( ' { text-decoration: none; }'."\n");
$ffputs .= ( 'a:hover { color: black;'."\n");
$ffputs .= ( ' text-decoration: none;'."\n");
$ffputs .= ( '}'."\n");
$ffputs .= ( ' .texto'."\n");
$ffputs .= ( '{'."\n");
$ffputs .= ( ' font-family: courier new;'."\n");
$ffputs .= ( ' font-size: 13px;'."\n");
$ffputs .= ( ' color: #000000;'."\n");
$ffputs .= ( ' text-decoration: none;'."\n");
$ffputs .= ( '}'."\n");
$ffputs .= ( ' </STYLE>'."\n");
$ffputs .= ( '<body>'."\n");
$ffputs .= ( '<table width="650" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#CCCCCC">'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <table width="100%" border="0" cellspacing="0" cellpadding="0">'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="9%">'."\n");
$ffputs .= ( ' <div align="center"><img src="imagens/'.$logo.'" width="54" height="70"></div>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td width="88%">'."\n");
$ffputs .= ( ' <div align="center"><font size="6" face="Arial, Helvetica, sans-serif"><b><font size="5" face="Verdana, Arial, Helvetica, sans-serif">'.$nomeinst.'</font><font face="Verdana, Arial, Helvetica, sans-serif"><br>'."\n");
$ffputs .= ( ' </font></b><font face="Verdana, Arial, Helvetica, sans-serif"><font size="4">Secretaria'."\n");
$ffputs .= ( ' Municipal de Finanças</font></font></font></div>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' </table>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td> <p><font face="Courier New, Courier, mono"><strong>Nº:'."\n");
$ffputs .= ( ' '.$seq.''."\n");
$ffputs .= ( ' </strong></font></p>'."\n");
$ffputs .= ( ' <table width="100%" border="1" cellspacing="5" cellpadding="5">'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td height="647"><font face="Verdana" size="2" color="#000000">'."\n");
$ffputs .= ( ' <font size="5"><p align="center"><b>CERTIDÃO NEGATIVA</b></p></font><br><b>IDENTIFICAÇÃO DO CONTRIBUINTE:</b><font face="courier new" size="2"><table width="500" border="1" cellspacing="1" cellpadding="1" class="texto">'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( '<td width="200" align="right" nowrap>'."\n");
$ffputs .= ( ' NÚMERO DE CADASTRO:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_numcgm.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' NOME:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_nome.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' ENDEREÇO:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_ender.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' CIDADE:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_munic.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' ESTADO:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_uf.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' CEP:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_cep.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' CNPJ/CPF:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.$z01_cgccpf.'</b>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">'."\n");
$ffputs .= ( ' IE/RG:'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td>'."\n");
$ffputs .= ( ' <b>'.@$z01_ident.'</b> </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
if (isset($matric)){
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td width="200" align="right">SETOR/QUADRA/LOTE:</td>'."\n");
$ffputs .= ( ' <td><b>'.$j34_setor."/".$j34_quadra."/".$j34_lote.'</b></td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' <tr> '."\n");
$ffputs .= ( ' <td width="200" align="right">MATRÍCULA:</td>'."\n");
$ffputs .= ( ' <td><b>'.$matric.'</b></td>'."\n");
$ffputs .= ( ' </tr>'."\n");
}elseif(isset($inscr)){
$ffputs .= ( ' <tr> '."\n");
$ffputs .= ( ' <td width="200" align="right">INSCRIÇÃO:</td>'."\n");
$ffputs .= ( ' <td><b>'.$inscr.'</b></td>'."\n");
$ffputs .= ( ' </tr>'."\n");
}
$ffputs .= ( ' </table>'."\n");
$ffputs .= ( ''."\n");
$ffputs .= ( ' </font><br><p align="left">'."\n");
$ffputs .= ( ' '.$DB_mens1.''."\n");
$ffputs .= ( '<br>'."\n");
$ffputs .= ( ' <b>OBS.: A Fazenda Municipal se reserva o direito de lançar débitos'."\n");
$ffputs .= ( ' independentemente da data desta certidão.'."\n");
$ffputs .= ( '<br>'."\n");
$ffputs .= ( ' Validade: 90 dias da data de sua emissão.'."\n");
$ffputs .= ( ' </p> <p align="right">'.$munic.', '.$dia.' DE '.$mes.' DE '.$ano.'</p>'."\n");
$ffputs .= ( ' <table width="100%" border="0" cellspacing="5" cellpadding="5">'."\n");
$ffputs .= ( ' <tr valign="top">'."\n");
$ffputs .= ( ' <td width="50%">'."\n");
$ffputs .= ( ' <div align="left"><font face="verdana" size="2"><b>ASPECTOS'."\n");
$ffputs .= ( ' TÉCNICOS DE VALIDADE:</b><br>'."\n");
$ffputs .= ( ' </font><font face="arial" size="2"> Emissão às '."\n");
$ffputs .= ( ' <b>'.$hora.":".$min.":".$sec.'</b> em <b>'.$dia."/".$mes1."/".$ano.'</b> '."\n");
$ffputs .= ( ' .<br>'."\n");
$ffputs .= ( ' Código de autenticidade da Certidão: <br>'."\n");
$ffputs .= ( ' <br>'."\n");
$ffputs .= ( ' <font face="courier">'.@$t1.'</font><br>'."\n");
$ffputs .= ( ' <img src="boleto/int25.php?text='.@$t1.'">'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' <td width="43%">'."\n");
$ffputs .= ( ' <div align="center"><font size="2" face="Verdana"><i> </i><br>'."\n");
$ffputs .= ( ' <br>'."\n");
$ffputs .= ( ' <br>'."\n");
$ffputs .= ( ' </font></div>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' '."\n");
$ffputs .= ( ' </table>'."\n");
$ffputs .= ( ' <table>'."\n");
$ffputs .= ( ' <tr>'."\n");
$ffputs .= ( ' <td height="77">'."\n");
$ffputs .= ( ' <font face="arial" size="1">Tanto a veracidade da informação quanto a manutenção'."\n");
$ffputs .= ( ' da condição de não devedor poderá ser verificada '."\n");
$ffputs .= ( ' na seguinte página na Internet: <b>'.$url.'</b><br>'."\n");
$ffputs .= ( ' <b>Atenção:</b> Qualquer rasura ou emenda INVALIDARÁ '."\n");
$ffputs .= ( ' este documento. </font>'."\n");
$ffputs .= ( ' <br><center>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' </table>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( ' </table>'."\n");
$ffputs .= ( ' </td>'."\n");
$ffputs .= ( ' </tr>'."\n");
$ffputs .= ( '</table>'."\n");
$ffputs .= ( '</body>'."\n");
$ffputs .= ( '</html>'."\n");
fputs($fd,$ffputs);
fclose($fd);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
$clcertidao = new cl_db_certidaoweb;
$clcertidao->codcert = $t1;
$clcertidao->tipocer = $tipo;
$clcertidao->cerdtemite = $ano."-".$mes1."-".$dia;
$clcertidao->cerhora = $hora.":".$min.":".$sec;
$clcertidao->cerdtvenc = $ano."-".$mes2."-".$dia;
$clcertidao->cerip=$ip;
$clcertidao->ceracesso=$t1;
$clcertidao->cercertidao="1";
$clcertidao->cernomecontr=$z01_nome;
$clcertidao->cerhtml=$ffputs;
$clcertidao->cerweb=1;
$clcertidao->incluir();
////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style>
A:hover {color:gray; cursor:hand};
</style>
<script>
js_verificapagina("certidaonome.php,certidaoinscr.php,certidaomatric.php");
function imprimir() {
document.getElementById('botao').style.visibility = 'hidden';
//document.focus();
window.print();
}
</script>
<body>
<table width="650" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="9%">
<div align="center"><img src="imagens/<?=$logo?>" width="54" height="70"></div>
</td>
<td width="88%">
<div align="center"><font size="6" face="Arial, Helvetica, sans-serif"><b><font size="5" face="Verdana, Arial, Helvetica, sans-serif"><?=$nomeinst?></font><font face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></b><font face="Verdana, Arial, Helvetica, sans-serif"><font size="4">Secretaria
Municipal de Finanças</font></font></font></div>
</td>
</tr>
</table>
</td>
<div align="center" id="botao"><a onClick="imprimir()">Clique aqui para imprimir a Certidão</a></div>
</tr>
<tr>
<td> <p><font face="Courier New, Courier, mono"><strong>Nº:
<?=$seq?>
</strong></font></p>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td height="647"> <font size='5'>
<p align='center'><b>CERTIDÃO NEGATIVA</b></p>
</font><b>IDENTIFICAÇÃO DO CONTRIBUINTE:</b><br>
<font face='courier new' size='2'>
<table width="500" border="0" cellspacing="1" cellpadding="1" class="texto">
<tr>
<td width="200" align="right">
NÚMERO DE CADASTRO:
</td>
<td>
<b><?=$z01_numcgm?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
NOME:
</td>
<td>
<b><?=$z01_nome?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
ENDEREÇO:
</td>
<td>
<b><?=$z01_ender?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
CIDADE:
</td>
<td>
<b><?=$z01_munic?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
ESTADO:
</td>
<td>
<b><?=$z01_uf?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
CEP:
</td>
<td>
<b><?=$z01_cep?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
CNPJ/CPF:
</td>
<td>
<b><?=$z01_cgccpf?></b>
</td>
</tr>
<tr>
<td width="200" align="right">
IE/RG:
</td>
<td>
<b><?=@$z01_ident?></b> </td>
</tr>
<?
if (isset($matric)){
echo "<tr>
<td align=\"right\">SETOR/QUADRA/LOTE:</td>
<td><b>".$j34_setor."/".$j34_quadra."/".$j34_lote."</b></td>
</tr>
<tr>
<td align=\"right\">MATRÍCULA:</td>
<td><b>".$matric."</b></td>
</tr>";
}elseif(isset($inscr)){
echo "<tr>
<td align=\"right\">INSCRIÇÃO:</td>
<td><b>".$inscr."</b></td>
</tr>";
}
?>
</table>
</font> <p align='left'><font size="1" face="Arial, Helvetica, sans-serif">
<?
echo $DB_mens1;
?>
<br><b>
<font size="1" face="Arial, Helvetica, sans-serif">
OBS.: A Fazenda Municipal se reserva o direito de lançar débitos
independentemente da data desta certidão. Validade: 90 dias da data
de sua emissão.</font> </p>
<p align='right'><?=$munic.","?><? echo " ".$dia." DE ".$mes." DE ".$ano; ?></p>
<table width='100%' border='0' cellspacing='5' cellpadding='5'>
<tr valign='top'>
<td width='50%'>
<font face="Arial, Helvetica, sans-serif" size="-7"><b>ASPECTOS
TÉCNICOS DE VALIDADE:</b><br>Emissão às <b><? echo $hora.":".$min.":".$sec; ?></b>
em <b><? echo $dia."/".$mes1."/".$ano; ?></b>.<br>
Código de autenticidade da Certidão: <br>
<br></font>
<font face='courier' size="-4"><?=$t1?></font><br>
<img src="boleto/int25.php?text=<?=$t1?>">
</td>
</tr>
</table>
<table>
<tr>
<td height="77">
<font face='arial' size='1'>Tanto a veracidade da informação quanto a manutenção
da condição de não devedor poderá ser verificada
na seguinte página na Internet: <b><?=$url?></b><br>
<b>Atenção:</b> Qualquer rasura ou emenda INVALIDARÁ
este documento. </font><br>
<br><center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>