<%@ LANGUAGE = VBScript.Encode %>
<!--#include virtual="/include/pub_var.inc"-->
<!--#include virtual="/include/data.inc"-->
<%#@~^5gAAAA==@#@&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#@#@&@#@&mEMAAA==^#~@%>
<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_ctrl()
{
    var ctrlid=window.ctrlid.value;
	var ctrlname=window.ctrlname.value;
	var description=window.description.value;

	if (trim(ctrlname)=="")
	{
		alert("规则名不能空！");
		window.ctrlname.focus();
		return false;
	}	
	
	else
	{
    var oXMLDoc = new ActiveXObject('MSXML');
	var sURL;
	sURL="<%=#@~^CwAAAA==dDDKmY4qx6WcgQAAA==^#~@%>save_ctrl.asp?ctrlid="+ctrlid+"&ctrlname="+ctrlname+"&description="+description;
    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.ctrlviewFrame.location="ctrl_view.asp?ctrlid=<%=#@~^BgAAAA==^DDsbNggIAAA==^#~@%>";
		window.parent.treeFrame.location="gz_treeview.asp";
		window.ctrlid.value="";
		window.ctrlname.value="";
		window.description.value="";
		window.count.value="";		
	
}
function del_ctrl()
{
    var ctrlid=window.ctrlid.value;

 	if (ctrlid=="")
	{
		alert("请选择要删除的记录！");
		return false;
	}
	else
	{
    var oXMLDoc = new ActiveXObject('MSXML');
	var sURL;
	sURL="<%=#@~^CwAAAA==dDDKmY4qx6WcgQAAA==^#~@%>del_ctrl.asp?ctrlid="+ctrlid;
    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.ctrlviewFrame.location="ctrl_view.asp?ctrlid=<%=#@~^BgAAAA==^DDsbNggIAAA==^#~@%>";
		window.parent.treeFrame.location="gz_treeview.asp";
		window.ctrlid.value="";
		window.ctrlname.value="";
		window.description.value="";
		window.count.value="";	
	
}
</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" bgcolor="buttonface">
	<!--<img src="/images/ZD.gif">-->&nbsp;<b>规则组管理</b>
    </td>
  </tr>
  <tr> 
    <td valign="top"> <iframe ID="ctrlviewFrame" name="ctrlviewFrame" src="ctrl_view.asp?ctrlid=<%=#@~^BgAAAA==^DDsbNggIAAA==^#~@%>" style="background-color:transparent" scrolling="yes" frameborder="1" width="100%" height="100%"></iframe> 
    </td>
  </tr>
  <tr> 
    <td height="30" bgcolor="buttonface" valign="middle" width="31%">&nbsp;
	编号:<input type="text" readonly class="cssButtonArea" name="count" size="3">
      <input type="hidden" readonly class="cssButtonArea" name="ctrlid" size="3">
      规则名称:
	  <input type="text" name="ctrlname" size="10">
      规则描述:
      <input type="text" name="description" size="20">
      <input type="submit" name="save_ctrl" value="保存" onClick="save_ctrl()">
      <input type="button" name="del_ctrl" value="删除" onClick="del_ctrl()">
    </td>
  </tr>
</table>
</body>
</html>

