Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) Safe-mode: OFF (not secure) /var/www/html/includes/ drwxr-xr-x |
Viewing file: Select action/file-type: //MÁSCARA DE VALORES function txtBoxFormat(objeto, sMask, evtKeyPress) { var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla; if(document.all) { // Internet Explorer nTecla = evtKeyPress.keyCode; } else if(document.layers) { // Nestcape nTecla = evtKeyPress.which; } else { nTecla = evtKeyPress.which; if (nTecla == 8) { return true; } } sValue = objeto.value; // Limpa todos os caracteres de formatação que // já estiverem no campo. sValue = sValue.toString().replace( "-", "" ); sValue = sValue.toString().replace( "-", "" ); sValue = sValue.toString().replace( ".", "" ); sValue = sValue.toString().replace( ".", "" ); sValue = sValue.toString().replace( "/", "" ); sValue = sValue.toString().replace( "/", "" ); sValue = sValue.toString().replace( ":", "" ); sValue = sValue.toString().replace( ":", "" ); sValue = sValue.toString().replace( "(", "" ); sValue = sValue.toString().replace( "(", "" ); sValue = sValue.toString().replace( ")", "" ); sValue = sValue.toString().replace( ")", "" ); sValue = sValue.toString().replace( " ", "" ); sValue = sValue.toString().replace( " ", "" ); fldLen = sValue.length; mskLen = sMask.length; i = 0; nCount = 0; sCod = ""; mskLen = fldLen; while (i <= mskLen) { bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":")) bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " ")) if (bolMask) { sCod += sMask.charAt(i); mskLen++; } else { sCod += sValue.charAt(nCount); nCount++; } i++; } objeto.value = sCod; if (nTecla != 8) { // backspace if (sMask.charAt(i-1) == "9") { // apenas números... return ((nTecla > 47) && (nTecla < 58)); } else { // qualquer caracter... return true; } } else { return true; } } //<![CDATA[ addEvent = function(o, e, f, s){ var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d; r[r.length] = [f, s || o], o[e] = function(e){ try{ (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;}); e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;}); e.target || (e.target = e.srcElement || null); e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0; }catch(f){} for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false)); return e = null, !!d; } }; //função para validar o CPF function validaCPF(cpf){ alert(cpf); cpf = cpf.replace("-",""); cpf = cpf.replace(".",""); cpf = cpf.replace(".","") var numeros, digitos, soma, i, resultado, digitos_iguais; digitos_iguais = 1; if (cpf.length < 11) return false; for (i = 0; i < cpf.length - 1; i++) if (cpf.charAt(i) != cpf.charAt(i + 1)) { digitos_iguais = 0; break; } if (!digitos_iguais) { numeros = cpf.substring(0,9); digitos = cpf.substring(9); soma = 0; for (i = 10; i > 1; i--) soma += numeros.charAt(10 - i) * i; resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; if (resultado != digitos.charAt(0)) return false; numeros = cpf.substring(0,10); soma = 0; for (i = 11; i > 1; i--) soma += numeros.charAt(11 - i) * i; resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; if (resultado != digitos.charAt(1)) return false; return true; } else return false; } function Verifica_CGC(field) { //alert(field); cnpj = $('#'+field).val(); var cpf='', cgc='', digito='', digitoc='', temp='', k=0; i=0, j=0, soma=0, mt=0, dg=''; //campo = field.value; campo = cnpj; //tam = campo.length; tam = cnpj.length; //alert(tam); var textos = "" for (j=0;j<=tam;j++) { if(campo.substring(j,j+1) != " ") { textos = textos + campo.substring(j,j+1) } } field.value = textos; //if (field.value == ' ' || field.value == ' ' || field.value == '') if (campo == ' ' || campo == ' ' || campo == '') { return false; }else{ cpf = campo; } if (cpf == "00.000.000/0000-00" || cpf == "00000000000000") { alert('O CNPJ informado não é válido! Formato: 99.999.999/9999-99'); //field.value = ""; field.focus(); return (false); } if (cpf.length == 19) { cpf = cpf.substring(1, cpf.length) } for (i = 0;i < cpf.length; i++) { k = i + 1; if (isNaN(cpf.substring(i,k))== false) { temp = temp + cpf.substring(i,k); } } if (((cpf.length > 13) && (cpf.length < 19)) && (isNaN(cpf.substring(3,4))==false)) { cgc = temp.substring(0,12); digito = temp.substring(12,14); mult = '543298765432'; for (j = 1; j <= 2; j++) { soma = 0; for (i = 0; i <= 11; i++) { k = i + 1; soma += parseInt((cgc.substring(i,k)) * (mult.substring(i,k))); } if (j == 2) { soma = soma + (2 * digitoc); } digitoc = ((soma * 10) % 11); if (digitoc == 10) { digitoc = 0; } dg +=digitoc; mult = '654329876543'; } if (dg != digito) { alert('O CNPJ informado não é válido!'); //field.value = ''; $('#'+field).val(''); //field.focus(); $('#'+field).focus(); //return false; }else{ field.value=temp.substring(0,2)+'.'+temp.substring(2,5)+'.'+temp.substring(5,8)+'/'+temp.substring(8,12)+'-'+temp.substring(12,14); return true; } }else{ alert('O CNPJ informado não é válido!'); //field.value = ''; $('#'+field).val(''); //field.focus(); $('#'+field).focus(); return false; } } //função que remove espaços em branco no começo e fim da string function trim(str){ return str.replace(/^\s+|\s+$/g,""); } function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } } function ola() { alert('ola'); } |
:: Command execute :: | |
--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.003 ]-- |