<%@ LANGUAGE = VBScript.Encode %>
<!--#include virtual="/include/pub_var.inc"-->
<!--#include virtual="/include/data.inc"-->
<%#@~^TQEAAA==@#@&WU,+MDWMPMn/!:nP	+aO@#@&/D.nmYt&UWW,',In;;nkY ?.\D#CMkl8s/cJh):Cm&1wrJ*@#@&dYMnCY4qUWKP',EtDYw=&&J,[,In;;nkY ?.\D#CMkl8s/cJU3".3"{gbHAJ*~[,Sn0D`dOMnlD4q	0WB(U/DD"+-`dOMnCY4(x6WSEJJ#b@#@&/nY,CS/Us/1t'k+M-+MR^DlOnK4L^YvJlSdU:km4RChdUs/nJ*@#@&skUra'lAd	:dm4 T+Osk	kwv#@#@&:m6rw{lAd	:/14RT+YsCaka`*@#@&/O~mhdxsdm4'UGDtkUL@#@&Dm0AAA==^#~@%>
<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 key_in()
{
//数字和小数点外的限制
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) 
|| (window.event.keyCode == 13) || (window.event.keyCode == 46)
))
{
window.event.keyCode = 0 ;
}
}

function key_up(obj)
{
var str=obj.value;
var tmp_str=new Array();
tmp_str=str.split(".");
for (var i=0;i<tmp_str.length;i++)
{
if ((parseInt(tmp_str[i])>255)||(i>3))
{
obj.value="";
break;
}
}
}

function lostfocus(obj)
{
	var str=obj.value;
	var tmp_str=new Array();
	tmp_str=str.split(".");
	if (tmp_str.length !==4 )
	{
		alert("IP格式错(不全)！");
	}
	else
	{
		for(var i=0;i<tmp_str.length;i++)
		{
			if (tmp_str[i]=="")
			{
				alert("IP格式错！(不足)");
				obj.value="";
				break;
			}
		}
		if (tmp_str[0]=="0")
		{
		alert("IP头位不能为0！");
		obj.value="";
		}
	}

}

function search_ip()
{
var str1=window.startip.value;
var str2=window.endip.value;
if((str1=="")||(str2==""))
{
alert("请输入IP范围！");
window.startip.focus();
return false;
}
var tmp_str1=new Array();
tmp_str1=str1.split(".");
var tmp_str2=new Array();
tmp_str2=str2.split(".");

	for (var i=0;i<tmp_str1.length-1;i++)
	{
		if (tmp_str1[i]>tmp_str2[i])
		{
			alert("开始IP不能大于结束IP！");
			return false;
			break;
		}
	}
	if (tmp_str1[3] >tmp_str2[3])
	{
		alert("开始IP不能大于结束IP！");
		return false;
	}
	else
	{
		window.ipviewFrame.location="ip_view.asp?startip="+str1+"&endip="+str2
	
	}

}

function save_ip()
{
	var new_jq;
	var host=window.host.value;
	var ip=window.ip.value;
	var mac=window.mac.value;
	
	var group=window.group.value;
	var role=window.role.value;
	var group_default=window.group_default.value;

	if ((host=="")||(ip=="")||(mac==""))
	{
		alert("请选择机器！");
		return false;
	}
	else if (role=="")
	{
		alert("请选择角色！");
		return false;
	}
	else
	{
    var oXMLDoc = new ActiveXObject('MSXML');
	var sURL;
	sURL="<%=#@~^CwAAAA==dDDKmY4qx6WcgQAAA==^#~@%>save_ip.asp?host="+host+"&ip="+ip+"&mac="+mac+"&group="+group+"&role="+role+"&group_default="+group_default;
	oXMLDoc.url = sURL;
	
	var oRoot=oXMLDoc.root;
	var result;
	if(oRoot.children != null)
    {
        for(var i=0;i<oRoot.children.length;++i)
        {
           result= oRoot.children.item(i).text;
       	}
		if (result=="0")
		{
		alert("保存失败！");
		}
		else if(result=="2")
		{
		alert("该机器已存在！");
		}
		else
		{
		alert("保存成功");
		window.host.value="";
		window.ip.value="";
		window.mac.value="";
		window.group_default.value="";
		window.parent.treeFrame.location="jq_treeview.asp";
		}
	}
}
}
</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 height="20" class="cssOrderBodyHeader">&nbsp;<b>机器搜索</b></td>
  </tr>
  <tr> 
    <td height="25" bgcolor="buttonface">&nbsp;开绐IP： 
      <input type="text" name="startip" onkeypress="key_in()" onkeyup="key_up(this)" onblur="lostfocus(this)" value="<%=#@~^BQAAAA==hbxraHQIAAA==^#~@%>">
      结束IP： 
      <input type="text" name="endip" onkeypress="key_in()" onkeyup="key_up(this)" onblur="lostfocus(this)" value="<%=#@~^BQAAAA==hm6raHwIAAA==^#~@%>">
      <input type="button" name="search" value="搜索" onclick="javascript:search_ip()">
    </td>
  </tr>
  <tr> 
    <td><iframe ID="ipviewFrame" name="ipviewFrame" src="ip_view.asp" style="background-color:transparent" scrolling="yes" frameborder="1" width="100%" height="100%"></iframe> 
    </td>
  </tr>
  <tr> 
    <td height="30" bgcolor="buttonface">
	  &nbsp;
	  编号：
	  <input type="text" readonly class="cssButtonArea" name="count" size="3">
	 机器组：
	  <select name="group" style="width:150">
	  <option value="default">默认工作组</option>
	  <%#@~^aQAAAA==v机器组@#@&~,d,P/$V{E/VnmDPM~6DWs~Y(VoMG;wr@#@&d~PdnDP./{^W	x nX+m;O`d;^b@#@&7,P9WPStbs+,xGY,Dd W0@#@&d,PzRsAAA==^#~@%>
	  <option value="<%=#@~^DQAAAA==.k`ETDKEwbNrbdAQAAA==^#~@%>" <%#@~^KQAAAA==r6P^kYM`Dk`rLDKE2k9Jbb{m/D.`TDW!2rN*PDtnxgw4AAA==^#~@%>selected<%#@~^BgAAAA==n	N~b0JgIAAA==^#~@%>><%=#@~^DwAAAA==.k`ETDKEw	lsnJ*SAUAAA==^#~@%></option>
	  <%#@~^SAAAAA==@#@&d~,DkR:K\U+XY@#@&iP~sKWw@#@&d,PDk ^VK/@#@&d~~k+OPMd'	WO4bxo@#@&iP~0RAAAA==^#~@%>	
      </select>
      角色： 
      <select name="role" style="width:150">
	
	  <%#@~^ZQAAAA==v角色@#@&7,Pk;V{JknVmOPCPW.K:PD8VMWVE@#@&iP,/nY~.k'^W	UR6n^!Y+cd$Vb@#@&7,P[KPStk^+,UWDP./c+GW@#@&d,~EhsAAA==^#~@%>
	  <option value="<%=#@~^DAAAAA==.k`EMW^+k9J*+QMAAA==^#~@%>" <%#@~^JwAAAA==r6P^kYM`Dk`r.W^+rNr#bx1/YMcDKV+b[bPDtxjQ0AAA==^#~@%>selected<%#@~^BgAAAA==n	N~b0JgIAAA==^#~@%>><%=#@~^DgAAAA==.k`EMW^+xm:E#zQQAAA==^#~@%></option>
	  <%#@~^XwAAAA==@#@&d~,DkR:K\U+XY@#@&iP~sKWw@#@&d,PDk ^VK/@#@&d~~k+OPMd'	WO4bxo@#@&iP~/O,mG	x{xWDtbUo@#@&7P,fxcAAA==^#~@%>
      </select>
      <input type="button" name="save_ip" value="保存" onclick="save_ip()">
      <input type="hidden" name="host">
      <input type="hidden" name="ip">
      <input type="hidden" name="mac">
	  <input type="hidden" name="group_default">
    </td>
  </tr>
</table>
</body>
</html>
