<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<script type="text/javascript" src="../JS/Jquery.min.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.notification.js.php"></script>
<link type="text/css" rel="stylesheet" href="../CSS/Notification.css" />
<style>
 td { padding:2px 5px 2px 5px;}
 table {margin-bottom:4px;}
 #jquery-notification-message {width:100%;}
</style>
<LINK href="../CSS/Base.css" rel=stylesheet>
<script language="javascript"> 
function checkall(form) 
{
	if( form.all.checked)
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = true;
		}
	}
	else
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = false;
		}
    }
}
function Check_Form_Validator()
{
	if ( !isIP(document.Check_Form.startIP_new.value) )
	{
		document.Check_Form.startIP_new.focus();
		$.notification('请输入合法的开始IP地址!');
		return false;
	}
	if ( !isIP(document.Check_Form.endIP_new.value) )
    {
		document.Check_Form.endIP_new.focus();
		$.notification('请输入合法的结束IP地址!');
		return false;
	}
}
function isIP(strIP) 
{ 
	if (isNull(strIP)) return false;
	var re= /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g //匹配IP地址的正则表达式
	if( re.test(strIP) )
	{
		if( RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256) return true;
	}
	return false; 
} 
function isNull(str)
{
	if ( str == "" ) return true;
	var regu = "^[ ]+$";
	var re = new RegExp(regu);
	return re.test(str);
}
</script> 
<META content="MSHTML 6.00.3790.0" name=GENERATOR></HEAD>
<BODY oncontextmenu="return false">
  <form name="Check_Form" method="post" action="" onsubmit="return Check_Form_Validator(this)">
  <table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
     <div class=position>位置：&nbsp; 我的问卷 &raquo; {surveyTitle}</div>
     <tr><td bgcolor="#e9e9e9"><b>设置可访问问卷的IP地址段</b></td></tr>
     <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;仅允许设定的IP地址段访问问卷：
		  <SELECT name=isAllowIP onChange="checkLoginSelectIP();">
		   <OPTION value="0">否</OPTION>
		   <OPTION value="1" {isAllowIP}>是</OPTION>
	</td></tr>
    <script LANGUAGE="JAVASCRIPT">		
			function checkLoginSelectIP()
			{ 
				if (document.Check_Form.isAllowIP.value == "0")
				{
					SettingIP_ID.style.display  =  'none';
				} 
				else
				{
					SettingIP_ID.style.display  =  '';
				}	
			}
		</script>
	</table>
	<div id="SettingIP_ID" style="display:{isAllowIP_Add}">
	<table style="LINE-HEIGHT: 150%;border-collapse:collapse;" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=1>
		<tr><td bgcolor="#f5f5f5" colspan=3>&nbsp;<b>IP地址段设置</b>&nbsp;&nbsp;[ <span class=red>{recNum}</span> 记录 ]</td></tr>
        <tr> 
             <td width=10% align=center noWrap><input name="all" type="checkbox" id="all" value="all" onclick="checkall(this.form)" style="background:#FFFFFF"><b>删除</b>&nbsp;</td>
             <td width=40% noWrap><strong>&nbsp;IP地址段开始</strong></td>
		     <td><strong>&nbsp;IP地址段结束</strong></td>
        </tr>

         <!-- BEGIN LOGINIP -->
         <tr> 
              <td align=center><input name="ID[]" type="checkbox" id="ID[]" value="{ID}"></td>
              <td>&nbsp;<input name="startIP[{ID}]" type="text" id="startIP[{ID}]" value="{startIP}" size=30></td>
			  <td width=*>&nbsp;<input name="endIP[{ID}]" type="text" id="endIP[{ID}]" value="{endIP}" size=30></td>
          </tr>
          <!-- END LOGINIP -->

		  <tr> 
             <td width=10% noWrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>新增</b></td>
             <td width=40% noWrap>&nbsp;<input name="startIP_new" id="startIP_new" type="text" size=30></td>
		     <td>&nbsp;<input name="endIP_new" type="text" size=30></td>
          </tr>
		  </table></div><table width=100% style="border:0px;">
            <tr align="center"> 
              <td height="15"> 
			    <input type="hidden" name="surveyID" value="{surveyID}">
			    <input name="UpdateSubmit" type="submit" id="UpdateSubmit" class=inputsubmit value="确定">
                <input name="backTopic" type="button" class=inputsubmit value="关闭" onClick="javascript:parent.hidePopWin();">
			 </td>
     </tr>
    </form>
  </table>
  <table width="100%">
      <tr> 
        <td style="padding-left:0px">
		<img src="../Images/clerk.gif"><strong>：</strong>指定IP地址段后，不在系统允许地址段内的IP地址将不能访问该问卷；<br>
		<IMG SRC="../Images/notes.gif">：注意“IP地址段开始”前的选择框，选中后点击“数据提交”表明删除该条记录；<br>
		<IMG SRC="../Images/notes.gif">：数据的修改和新增只需要在对应的输入框直接修改或输入，完毕后点击“数据提交”即可。</td>
      </tr>
  </table>
</body></html>