// -*- coding: utf-8 -*- function spaProCriaAjax() { var xmlhttp; try { xmlhttp = new XMLHttpRequest(); } catch (ie1) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (ie2) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { xmlhttp = false; } } } return xmlhttp; } function spaProTrataAjax(oObj) { lRet = true; if (oAjax.readyState == 4) { if (oAjax.status == 200) { // Estou usando json oJson = eval("(" + oAjax.responseText + ")"); if (oAjax.responseText.indexOf("status") != -1) { lRet = spaProGeraResult(oObj,oJson); } } } return lRet; } function spaProVerifLogin() { nStatus = 0; oUsuario = document.getElementById("spa-pro-usuario"); oSenha = document.getElementById("spa-pro-senha"); if (oUsuario.value.length == 0 || oSenha.value.length == 0) { nStatus = 1; } if (nStatus == 0) { oAjax = spaProCriaAjax(); if (oAjax) { // **cURL = "principal.php?" + "us=" + oUsuario.value + "&" + "se=" + oSenha.value; cURL = "spa_query.php?tp=8&us=" + oUsuario.value + "&se=" + oSenha.value + "&sr=" + gcSpaSrInqPro; oAjax.open('GET',cURL,false); oAjax.send(null); oResultado = document.getElementById("spa-pro-resultado"); nStatus = spaProTrataAjax(oResultado) ? 0 : 2; } } switch (nStatus) { case 0: gcSpaProUsu = oUsuario.value; gcSpaProSen = oSenha.value; document.getElementById("spa-pro-login").style.display = "none"; document.getElementById("spa-pro-resultado").style.display = "block"; break; case 1: window.alert("Voc\u00EA deve informar o usu\u00E1rio e a senha."); oUsuario.select(); oUsuario.focus(); break; case 2: window.alert("Usu\u00E1rio e/ou senha inv\u00E1lidos."); oUsuario.select(); oUsuario.focus(); break; } } function spaProGeraResult(oObj,oJson) { lRet = true; if (oJson.status == 0) { cConteudo = '
' + '' + 'Extrato' + '' + ' | ' + '' + '' + 'Informe de rendimentos | ' + '
Atualizado em | ' + 'Saldo disponível |
' +
'' + oJson.extratos[i].datu + ' | ' +
'' +
'' + cFontesaldo + oJson.extratos[i].saldo + ' |
Histórico de Extratos Pagos |
Pago em | ' + 'Valor Pago |
' +
oJson.extratos_pagos[i].data_pagt + ' | ' +
'' +
oJson.extratos_pagos[i].saldo + ' |
Ano | Saldo disponível | '; for (i = 0; i < oJson.informes.length; i++) { cChave = oJson.pro[0].cod + "," + oJson.informes[i].ano; cInforme += '
' +
oJson.informes[i].ano + ' |