<%@ LANGUAGE = VBScript.Encode %>
<!--#include virtual="/include/pub_var.inc"-->
<!--#include virtual="/include/data.inc"-->
<%#@~^4gAAAA==@#@&z&确定`Id进行(Hd后台保存@#@&.W^+rN{Y.rs`D5E/YvE.W^+bNE#b@#@&/ODhCY4qUWKP'~];;+kOc?nM\D.mDbC4^+d`rn)P_{qgorr#@#@&dODhlDt(xWG,'~J4OYa)&&rP[~];;+kOc?nM\D.mDbC4^+d`r?3]j2I|Hbt2J*~'Pd+6Yc/O.hlOt&U0K~(UkYD]n7`dYMKmY4&x6W~rzrb#@#@&gUMAAA==^#~@%>
<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 save_role()
{
    var roleid="<%=#@~^BgAAAA==.KVnbNfwIAAA==^#~@%>";
	var rolectrlid=window.rolectrlid.value;
	var weekdate=window.weekdate.value;
	var starttime=window.starttime.value;
	var endtime=window.endtime.value;
	var ctrlid=window.ctrlid.value;

	if (weekdate=="")
	{
		alert("星期不能为空！");
		window.starttime.focus();
		return false;
	}
	
	else if (trim(starttime)=="")
	{
		alert("开始时间不能为空！");
		window.starttime.focus();
		return false;
	}
	else if (trim(endtime)=="")
	{
		alert("结束时间不能为空！");
		window.endtime.focus();
		return false;
	}
	else if (parseFloat(endtime)<parseFloat(starttime))
	{
		alert("结束时间不能小于开始时间！");
		window.endtime.focus();
		return false;
	}
	if (trim(ctrlid)=="")
	{
		alert("控制规则不能为空！");
		window.starttime.focus();
		return false;
	}
	
	else
	{
	var tmp_starttime=new Array();
	tmp_starttime=starttime.split(":");

	starttime=parseFloat(tmp_starttime[0])*60+parseFloat(tmp_starttime[1]);
	var tmp_endtime=new Array();
	tmp_endtime=endtime.split(":");
	endtime=parseFloat(tmp_endtime[0])*60+parseFloat(tmp_endtime[1]);
	if (endtime<starttime)
	{
	alert("结束时间不能小于开绐时间！");
	return false;
	}
    var oXMLDoc = new ActiveXObject('MSXML');
	var sURL;
	sURL="<%=#@~^CwAAAA==dDDKmY4qx6WcgQAAA==^#~@%>save_role.asp?roleid="+roleid+"&weekdate="+weekdate+"&starttime="+starttime+"&endtime="+endtime+"&ctrlid="+ctrlid+"&rolectrlid="+rolectrlid;

    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
		{
		alert("保存成功");


		}
	}

	}
		window.roleviewFrame.location="role_view.asp?roleid=<%=#@~^BgAAAA==.KVnbNfwIAAA==^#~@%>";
		window.parent.treeFrame.location="js_treeview.asp";
		window.weekdate.value="";
		window.rolectrlid.value="";
		window.roleindex.value="";
		window.starttime.value="00:00:00";
		window.endtime.value="00:00:00";
		window.ctrlid.value="";
		window.starttime.focus();
}
function del_role()
{
    var roleid="<%=#@~^BgAAAA==.KVnbNfwIAAA==^#~@%>";
	var weekdate=window.weekdate.value;
	var starttime=window.starttime.value;

 	if ((weekdate=="")||(starttime==""))
	{
		alert("请选择要删除的记录！");
		return false;
	}
	else
	{
	var tmp_starttime=new Array();
	tmp_starttime=starttime.split(":");
	starttime=parseFloat(tmp_starttime[0])*60+parseFloat(tmp_starttime[1]);
    var oXMLDoc = new ActiveXObject('MSXML');
	var sURL;
	sURL="<%=#@~^CwAAAA==dDDKmY4qx6WcgQAAA==^#~@%>del_role.asp?roleid="+roleid+"&starttime="+starttime+"&weekdate="+weekdate;
	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
		{
		alert("删除成功");
		
		}
	}

	}
		window.roleviewFrame.location="role_view.asp?roleid=<%=#@~^BgAAAA==.KVnbNfwIAAA==^#~@%>";
		window.parent.treeFrame.location="js_treeview.asp";
		window.weekdate.value="";
		window.rolectrlid.value="";
		window.roleindex.value="";
		window.starttime.value="00:00:00";
		window.endtime.value="00:00:00";
		window.ctrlid.value="";	
}
function key_in()
{
//数字和:外的限制
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) 
|| (window.event.keyCode == 13) || (window.event.keyCode ==58)
))
{
window.event.keyCode = 0 ;
}
}
function on_blur(obj)
{
	var str=obj.value;
	var tmp_str=new Array();
	tmp_str=str.split(":");
	
	if (tmp_str.length !==3)
	{
		alert("时间位数不全");
		this.value="";
		this.focus();
		return false;
	}
	if (tmp_str[0]>23)
	{
		alert("时不能大于23");
		this.value="";
		return false;
	}
	if (tmp_str[1]>59)
	{
		alert("分不能大于59！");
		this.value="";
		return false;
	}
	if (tmp_str[2]>59)
	{
		alert("秒不能大于59！");
		this.value="";
		return false;
	}
	
	

}
</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%">
<%#@~^AgEAAA==@#@&d~,/$V'r/s+1Y~e,0.GsPY(sDKV+,A4+M+,DGVnr9'E[MGVk[@#@&dP~dY~Dkq{/nM\DR1DCYW8LmOcrbf}9AcD+1G.Nk+DJb@#@&7,P./8 Wa+U~k;VS^KxU~8S2@#@&iP,k0,xKOPM/qRWW~Dt+	@#@&iPP,~~DKV1C:nxM/q`r.W^+UCs+Jb@#@&d~PU9Pr6@#@&dP,DkqR1VG/@#@&7,P/OPM/F{UGY4k	o@#@&7~,@#@&ukYAAA==^#~@%>
  <tr> 
    <td  height="20" bgcolor="buttonface"> &nbsp;<b><%=#@~^CAAAAA==.KVngls+MwMAAA==^#~@%></b> 
    </td>
  <tr> 
    <td valign="top"> <iframe ID="roleviewFrame" name="roleviewFrame" src="role_view.asp?roleid=<%=#@~^BgAAAA==.KVnbNfwIAAA==^#~@%>" style="background-color:transparent" scrolling="yes" frameborder="1" width="100%" height="100%"></iframe> 
    </td>
  </tr>
  
  <tr> 
    <td height="30" bgcolor="buttonface" valign="middle"> 
      
      编号:<input type="text" name="roleindex" readonly  class="cssButtonArea"  size=3>
	  星期:<select name="weekdate" style="width:70">
        <option value="2">星期一</option>
        <option value="3">星期二</option>
        <option value="4">星期三</option>
        <option value="5">星期四</option>
        <option value="6">星期五</option>
        <option value="7">星期六</option>
        <option value="1">星期天</option>
      </select>
      开始时间:<input type="text" name="starttime" size="7" onkeypress="key_in()" onblur="on_blur(this)" value="00:00:00">
      结束时间:<input type="text" name="endtime" size="7" onkeypress="key_in()" onblur="on_blur(this)" value="00:00:00">
      控制规则:<select name="ctrlid" style="width:70">
	  <%#@~^YgAAAA==@#@&d~,/$V'r/s+1Y~e,0.GsPY(smDDVr@#@&d,Pk+OP.d{mGx	 +X+^;D+`d5^#@#@&i~,NG,h4kVP	GY,DdRWW@#@&dP,7hoAAA==^#~@%>
	  <option value="<%=#@~^DAAAAA==.k`E1YMVk9J*/AMAAA==^#~@%>"><%=#@~^DgAAAA==.k`E1YMVxm:E#0AQAAA==^#~@%></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="submit" name="Submit" value="保存" onclick="javascript:save_role()">
      <input type="submit" name="delrole" value="删除" onclick="javascript:del_role()">
	  <input type="hidden" name="rolectrlid">
      </td>
  </tr>
</table>
</body>
</html>

