<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<HTML>
<HEAD>
<TITLE>添加角色</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>

</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p0000")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim act,adminname,PassWord,UserType
act=request.QueryString("act")

if(act="add") then	
	rolename=trim(request.Form("rolename"))
	privilege=request.Form("privilege")
	'添加到库
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 * from role where rolename='"&rolename&"' order by id desc "
	rs.open sql,conn,3,3
	if not rs.eof then
		response.Write("<script>alert(""该角色已存在!"");history.back();</script>")
		response.End()
	else		
		rs.addnew
		rs("rolename")=rolename
		rs("privilege")=privilege
		rs("moditime")=now	
		rs.update	
		response.Write("添加角色成功~!")
		response.Write("<br><a href=role_add.asp>返回</a>")
	end if
	rs.close
	set rs=nothing
else
%>
<FORM method="POST" name="form1" action="role_add.asp?act=add" style="margin:0 0 0 0;">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="24" colspan="2"><div align="center" class="style1">添加角色</div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD width="14%"><div align="center">角色名称：</div></TD>
  <TD width="86%"><input name="rolename" type="text" id="rolename" size="30"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="center">角色权限：</div></TD>
  <TD><div align="left">
    <p>
     <input name="privilege" type="checkbox" id="privilege" value="p01">
   类别管理   </p>
    <p>
    <input name="privilege" type="checkbox" id="privilege2" value="p02">
 新闻管理</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege3" value="p03">
 模板管理</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege4" value="p04">
 标签管理</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege5" value="p05">
 发布站点</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege6" value="p06">
 管理员管理</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege7" value="p07">
 评论管理</p>
    <p>
    <input name="privilege" type="checkbox" id="privilege8" value="p08">
 友情链接</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege72" value="p09">
 信息采集</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege73" value="p10">
 数据库管理</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege74" value="p11">
系统配置管理</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege75" value="p12">
日志管理</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege9" value="p13">
      投票管理 </p>
    <p>
      <input name="privilege" type="checkbox" id="privilege10" value="p14"> 
      广告管理</p>
    <p>
      <input name="privilege" type="checkbox" id="privilege11" value="p15">
      任务计划 </p>
    <p>
      <input name="privilege" type="checkbox" id="privilege12" value="p16">
资源管理</p>
<p>
      <input name="privilege" type="checkbox" id="privilege21" value="p21">
分类信息管理</p>
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
end if
%>
</BODY>
</HTML>
<%
call connclose()
%>