<%@ LANGUAGE = VBScript.Encode %>
<!--#include virtual="/include/pub_var.inc"-->
<html>
<head>
<title><%=#@~^BQAAAA==ObYsIgIAAA==^#~@%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%=#@~^DAAAAA==dDDmbx1VE9+8zQQAAA==^#~@%>
<%=#@~^DAAAAA==dDDmbx1VE9+yzgQAAA==^#~@%>
<script language="javascript">
function checkNaN(val){    ///检验是否为数字
var len=val.length;
var val1="";
var checkNaN="false";
for (var i=0;i<len;i++){
   val1=val.substring(i,i+1);
   if (isNaN(val1)&&(val1!==".")&&(val1!=="-")&&(val1!==",")){
      checkNaN="true";
	  break;
   }
}
if (checkNaN=="true")
   return true;
else
   return false;
}

function checkArray(val1){    ///检验IP正确性
var tmp_str=new Array();
tmp_str=val1.split(".");
var checkarray="false";
if (tmp_str.length!==4)   
   checkarray="true";
else { 
   for (var i=0;i<tmp_str.length;i++){
      if(tmp_str[i]==""){
	     checkarray="true";
	     break;
      }
	  else if (isNaN(tmp_str[i])){
         checkarray="true";
	     break;
      }
	 else if(parseInt(tmp_str[i])>255) {
	     checkarray="true";
		 break;
	 }
   }
}
if (checkarray=="true")
   return true;
else
   return false;
}

function compareIP(val1,val2){   //比较两IP的大小
var compareIP="false";
if ((val1=="")||(val2=="")){
  compareIP="true"
}
else{
   var tmp_str1=new Array();
   tmp_str1=val1.split(".");
   var tmp_str2=new Array();
   tmp_str2=val2.split(".");
   for (var i=0;i<4;i++){
     if (parseInt(tmp_str2[i])<parseInt(tmp_str1[i])){
	   compareIP="true"
	   break;
	 }
   }
}
if (compareIP=="true")
   return true;
else
   return false;
}

function checkIPSect(val){    ///检验IP段,如:192.168.0.1-192.168.20
var tmp_str=new Array();
tmp_str=val.split("-");
var checkIP="false";
if (tmp_str.length!==2)
   checkIP="true";
else if(compareIP(tmp_str[0],tmp_str[1]))
   checkIP="true";
else{ 
   for (var i=0;i<tmp_str.length;i++){
      if(tmp_str[i]==""){
	     checkIP="true";
	     break;
      }
	  else if(tmp_str[i].indexOf(".")==-1){
	     checkIP="true";
		 break;
	  }
	  else if(checkArray(tmp_str[i])){
	     checkIP="true";
		 break;
      }
   }
}
if (checkIP=="true")
   return true;
else
   return false;
}

function checkstr(str){  ///检验IP输入正确性
var checkstr="false";
if (checkNaN(str)){
   checkstr="true";
}
else if ((str.indexOf(",")==-1)&&(str.indexOf("-")==-1)){ //输入串中没有","和"-"   
   if(str.indexOf(".")==-1)
      checkstr="true"
   else if(checkArray(str))
      checkstr="true";
}
else if(str.indexOf(",")==-1){     //输入串中只有"-"
   if (checkIPSect(str))
      checkstr="true";
}
else if(str.indexOf("-")==-1){   ///输入串中只有","
   var tmp_str=new Array();
   tmp_str=str.split(",");
   for(var i=0;i<parseInt(tmp_str.length);i++){
      if (tmp_str[i].indexOf(".")==-1){
	     checkstr="true";
		 break;	  
	  }
	  else if(checkArray(tmp_str[i])){
	     checkstr="true";
	     break;
	  }
   }
}
else{   ///输入串有有"-"和","
   var tmp_sub=new Array();
   tmp_sub=str.split(",");
   for (var i=0;i<tmp_sub.length;i++){
	  if (tmp_sub[i]==""){
	     checkstr="true";
		 break;
	  }
	  else if(tmp_sub[i].indexOf("-")!==-1){
		 if(tmp_sub[i].indexOf(".")==-1){
		    checkstr="true";
			break;
		 }
		 else if (checkIPSect(tmp_sub[i])){
		    checkstr="true";
			break;
		 }
	  }
	  else if(checkArray(tmp_sub[i])){
	     checkstr="true"
		 break;
	  }
   } 
}
   

if (checkstr=="true")
  return true;
else
  return false;
}

function search(){
var StartDate=window.treeFrame.bb();
var EndDate=frames.treeFrame.aa();
var logtype=window.treeFrame.logFrame.logtype();  //日志类型
var gist=window.treeFrame.form1.TheTo.value;         //统计依据
//StartDate.toString();
//EndDate.toString();
//if (StartDate>EndDate){
//   alert('日期输入非法!请重新输入!');
//   return false;
//}
//else
if (window.treeFrame.form1.btnadv.value=="高级历史统计>>"){
  var macGroup=window.treeFrame.pcFrame.pc();
  window.listFrame.location="/gl/gl_8/log_stat.asp?IsHis=no&Startdate="+StartDate+"&EndDate="+EndDate+"&macGroup="+macGroup+"&logtype="+logtype+"&gist="+gist;
}
else{
  var IPsel=window.treeFrame.form1.IPsel.value;
  var macName=window.treeFrame.pcFrame.pc();
  if (checkstr(IPsel)&&(IPsel!=="")){
     alert("IP输入非法!请重新输入!");
     window.treeFrame.form1.IPsel.focus();
	 return false;
   }
  else{
    window.listFrame.location="/gl/gl_8/log_stat.asp?isHis=sure&Startdate="+StartDate+"&EndDate="+EndDate+"&IPsel="+IPsel+"&macName="+macName+"&logtype="+logtype+"&gist="+gist;
  }
}
}
</script>
</head>
<body bgcolor=<%=#@~^CwAAAA==d!4Abx1WVKDtwQAAA==^#~@%> text="#000000" leftmargin=<%=#@~^BQAAAA==s0OsGAIAAA==^#~@%> topmargin=<%=#@~^BAAAAA==OKwhwAEAAA==^#~@%> marginwidth=<%=#@~^BgAAAA==hSk[DtjQIAAA==^#~@%> marginheight=<%=#@~^BwAAAA==h4+rTtD5gIAAA==^#~@%> scroll="no">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" >
  <tr> 
    <td width="25%" valign="top"> <iframe ID="treeFrame" name="treeFrame" src="/gl/gl_8/js_treeview.asp" height="100%"  width="100%"  scrolling="auto" frameborder="1" ></iframe> 
    </td>
    <td rowspan="2" bgcolor="#CCCCCC" width="75%"> <iframe ID="listFrame" name="listFrame" src="/gl/gl_8/log_stat.asp" height="100%"  width="100%"  scrolling="no" frameborder="1" ></iframe> 
    </td>
  </tr>
  <tr align="center"> 
    <td width="25%" valign="middle" height=25 bgcolor="buttonface"> 
      <input type="submit" name="role" value=" 统 计 " onclick="search()">
    </td>
  </tr>
</table>
</body>
</html>