-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcertidaonome003.php
More file actions
executable file
·233 lines (213 loc) · 7.85 KB
/
certidaonome003.php
File metadata and controls
executable file
·233 lines (213 loc) · 7.85 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
<?
/*
* E-cidade Software Publico para Gestao Municipal
* Copyright (C) 2013 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
*/
session_start();
include("libs/db_stdlib.php");
include("libs/db_sql.php");
include("classes/db_cgm_classe.php");
include("classes/db_issbase_classe.php");
parse_str(base64_decode($HTTP_SERVER_VARS["QUERY_STRING"]));
if(isset($outro)){
setcookie("cookie_codigo_cgm");
header("location:certidaonome003.php");
}
$clcgm = new cl_cgm;
$clissbase = new cl_issbase;
db_mensagem("contribuinte_cab","contribuinte_rod");
$db_verificaip = db_verifica_ip();
if($db_verificaip == "0"){
$onsubmit = "onsubmit=\"return js_verificaCGCCPF((this.cgc.value==''?'':this.cgc),this.cpf);\"";
}else{
$onsubmit = "";
}
?>
<html>
<head>
<title><?=$w01_titulo?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" src="scripts/db_script.js"></script>
<style type="text/css">
<?db_estilosite();?>
</style>
<link href="config/estilos.css" rel="stylesheet" type="text/css">
</head>
<script>
function js_valida(){
var cnpj = document.getElementById('cgc').value;
var cpf = document.getElementById('cpf').value;
var iTamCnpj = js_tamanho(cnpj);
var iTamCpf = js_tamanho(cpf);
if(cnpj == "" && cpf == ""){
alert('Preencha um dos campo CNPJ/CPF!');
return false;
} else {
if(cnpj != "" && iTamCnpj != 14){
alert('CNPJ Inconsistente!');
var retorno = false;
} else if(cpf != "" && iTamCpf != 11){
alert('CPF Inconsistente!');
var retorno = false;
}
if(retorno === false){
return false;
}
}
}
function js_carregando(bool){
var bolean = bool;
if (bolean === true) {
document.getElementById('int_perc1').style.visibility='hidden';
document.getElementById('int_perc2').style.visibility='hidden';
} else {
document.getElementById('int_perc1').style.visibility='visible';
document.getElementById('int_perc2').style.visibility='visible';
}
}
function js_tamanho(Campo){
var vr = Campo;
vr = vr.replace(".", "");
vr = vr.replace(".", "");
vr = vr.replace("-", "");
vr = vr.replace("/", "");
var iTamCampo = vr.length
return iTamCampo;
}
</script>
<body leftmargin="0" text="<?=$w01_cortexto?>" topmargin="0" marginwidth="0" marginheight="0"
bgcolor="<?=$w01_corbody?>" onLoad="js_carregando(true);" <? mens_OnHelp() ?>>
<div id='int_perc1' align="left" style="position:absolute;top:30%;left:35%; float:left; width:200;
background-color:#ECEDF2; padding:5px; margin:0px; border:1px #C2C7CB solid;
margin-left:10px; font-size:80%; visibility:hidden">
<div style="border:1px #ffffff solid; margin:8px 3px 3px 3px;">
<div id='int_perc2' style="width:100%; background-color:#eaeaea;" align="center">
<img src="imagens/processando.gif" align="center"> Processando...
</div>
</div>
</div>
<center>
<br><br><br>
<?=$DB_mens1?>
<br><br>
<?
//verifica se está logado
if (@$id_usuario != "") {
@$usuario = $id_usuario;
@$result = $clcgm->sql_record($clcgm->sql_query("","cgm.z01_cgccpf, cgm.z01_nome, cgm.z01_numcgm","","cgm.z01_numcgm = $usuario"));
@$linhas = $clcgm->numrows;
if(@$linhas!=0){
db_fieldsmemory($result,0);
//11 14
if(strlen($z01_cgccpf)>11){
$cgc = $z01_cgccpf;
$cpf = "";
}else{
$cgc = "";
$cpf = $z01_cgccpf;
}
$sql2=$clissbase->sql_query("","issbase.q02_inscr,z01_nome,z01_cgccpf","","q02_numcgm = $usuario and q02_dtbaix is null");
$result2 = pg_query($sql2);
$linhas2 = pg_num_rows($result2);
if($linhas2>0){
db_fieldsmemory($result2,0);
}
?>
<table width="60%" border="1" bordercolor="#cccccc" cellpadding="5" cellspacing="0" class="texto">
<tr>
<td width="100%" nowrap height="28" bgcolor="<?=$w01_corfundomenu?>">
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="texto">
<tr><td>
<img src="imagens/icone.gif" border="0">
</td><td>
CNPJ/CPF: <span class="bold3"><?=$z01_cgccpf?></span><br>
Nº Contribuinte / CGM: <span class="bold3"><?=$z01_numcgm?></span><br>
</td></tr>
</table>
</td>
</tr>
<tr height="100">
<td align="center">
<a href="opcoescertidao.php?inscricao=<?=@$q02_inscr?>&codigo_cgm=<?=$z01_numcgm?>&cpf=<?=$cpf?>&cgc=<?=$cgc?>&opcao=n&id_usuario=<?=$id_usuario?>">Acessar Meus Dados</a><br><br>
<a href="certidaonome003.php?outro">Acessar Outro Contribuinte</a>
</td>
</tr>
</table>
<?
}
} else {
?>
<form name="form1" method="post" action="opcoescertidao.php" <?=$onsubmit?>>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="texto">
<?
if (@$w13_permconscgm == "t") {
?>
<tr>
<td width="50%" height="30" align="right">Nº Contribuinte / CGM: </td>
<td width="50%" height="30">
<input name="codigo_cgm" type="text" class="digitacgccpf" id="codigo_cgm" size="10" maxlength="10"></td>
</tr>
<?
}
?>
<tr>
<td width="50%" height="30" align="right">CNPJ: </td>
<td width="50%" height="30"><input name="cgc" type="text" class="digitacgccpf" id="cgc"
onChange='js_teclas(event);'
onKeyPress="FormataCNPJ(this,event); return js_teclas(event);" size="18" maxlength="18"></td>
</tr>
<tr>
<td width="50%" height="30" align="right">CPF: </td>
<td width="50%" height="30"><input name="cpf" type="text" class="digitacgccpf" id="cpf"
onChange='js_teclas(event);'
onKeyPress="FormataCPF(this,event); return js_teclas(event);" size="14" maxlength="14"></td>
</tr>
<tr>
<td width="50%" height="30"> </td>
<td width="50%" height="30">
<input type="hidden" name="opcao" value="n">
<input class="botao" type="submit" name="pesquisa" value="Pesquisa" class="botaoconfirma" onClick="return js_valida();">
</td>
</tr>
</table>
</form>
<?}?>
<?
if(isset($funcao)){
echo "<script>alert('Código identificador dever ser preenchido')</script>";
}
db_logs("","",0,"Digita Codigo do Contribuinte.");
if(isset($erroscripts)){
echo "<script>
alert('".$erroscripts."');
location='certidaonome003.php?outro';
</script>";
}
?>
</center>
<script>
js_carregando(false);
</script>
</body>
</html>