var xmlHttp; var a00306aid=""; function createXHR(){ if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } if (!xmlHttp){ alert("你使用的瀏覽器不支援XMLHTTP"); return false; } } function indexc(rr){ //var rr="";alert(chknums()); /* if(document.form1.code_num){ alert(document.form1.code_num); } if(rr == undefined){ alert(rr); } alert(document.getElementById("patrolaccount").value); alert(document.getElementById("patrolpwd").value); */ if(document.form1.code_num && rr == undefined && document.getElementById("patrolaccount").value != "" && document.getElementById("patrolpwd").value != ""){ chknums(); }else if(document.getElementById("patrolpwd").value != ""){ rr=1; } if(rr == 1){ createXHR(); var str="checkaccount=1"+"&patrolaccount="+document.getElementById("patrolaccount").value+"&patrolpwd="+document.getElementById("patrolpwd").value;//alert(str); var url='select.php?ids=9xFWhZUqTLOy3+IVPOjbMg=='; xmlHttp.open("POST",url,true); xmlHttp.onreadystatechange=indexa2; xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttp.send(str); } } function indexa2(){ if (xmlHttp.readyState==4){ if (xmlHttp.status == 200) { //alert(xmlHttp.responseText); //document.getElementById("a00108a08["+a00306aid+"]").innerHTML=xmlHttp.responseText; if(xmlHttp.responseText != "1" && xmlHttp.responseText != "2" && xmlHttp.responseText != "3" && xmlHttp.responseText != "4"){ document.form3.aaa.value=""; document.form3.aaa.value=xmlHttp.responseText; document.form3.submit(); }else if(xmlHttp.responseText == "1"){ alert('帳號停權 !!'); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); }else if(xmlHttp.responseText == "2"){ alert('密碼錯誤 !!'); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); }else if(xmlHttp.responseText == "3"){ alert('帳號不存在 !!'); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); }else if(xmlHttp.responseText == "4"){ alert('CERT ERROR !!'); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); }else if(xmlHttp.responseText == "5"){ alert('CERT ERROR !!'); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); } } } } function indexb(a){ createXHR(); var str="aaa="+a; var url='select.php?ids=vyquvO7ma+wmckmr/S0HRw=='; xmlHttp.open("POST",url,true); xmlHttp.onreadystatechange=indexb2; xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttp.send(str); } function indexb2(){ if (xmlHttp.readyState==4){ if (xmlHttp.status == 200) { //alert(xmlHttp.responseText); document.getElementById("mainpage").innerHTML=xmlHttp.responseText; } } } /* $(function(){ $("#getcode_num").click(function(){ $(this).attr("src", "selectv.php?id=uX4gDMroCsPRwxPOa8f6aQ==");//刷新圖像 }); }); */ function pich(){ document.getElementById("getcode_num").src = "selectv.php?id=uX4gDMroCsPRwxPOa8f6aQ=="; } function chknums(){ createXHR(); var str="act=num&code="+document.form1.code_num.value; var url='selectv.php?id=UMh/LPWdfW2HTcHlnqd5Nw=='; xmlHttp.open("POST",url,true); xmlHttp.onreadystatechange=chknums2; xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttp.send(str); } function chknums2(){ if (xmlHttp.readyState==4){ if (xmlHttp.status == 200) { //alert(xmlHttp.responseText); if(xmlHttp.responseText == "error0"){ indexc("1"); }else{ alert("圖形驗證錯誤"); document.form3.aaa.value=""; document.getElementById("patrolaccount").value=""; document.getElementById("patrolpwd").value=""; document.getElementById("code_num").value=""; pich(); } } } }