grademodi.asp

来自「实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员」· ASP 代码 · 共 158 行

ASP
158
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<%
if session("globalecmaster")="" or session("masterflag")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login.asp';</SCRIPT>" 
response.end
end if

'权限限制^^^^^^^^^^^^^^^^^^^^
 dim ishavegant
 ishavegant=false
 in_str=split(session("masterflag"),",")
 for each ins in in_str
 if trim(ins)="11"     then 
 ishavegant=true
 end if
 next 
 if ishavegant=false then
 response.redirect "../err.asp"
 response.end
 end if
 %>
<% data_path="../../" 'ACC连接数据库路径,对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script language="javascript">
function ischeckg()
{
var strn=document.modiform.gradename.value;
 	if(strn.replace(/^\s+|\s+$/g,'')=="")
  {
   alert("请输入等级名称!");
   document.modiform.gradename.focus();
   return false;
  }	
}
</script>
   </head>
   
   <%
   moidbtn=Replace_Text(request("moidbtn"))
   gradename=Replace_Text(request("gradename"))
   isreg=Replace_Text(request("isreg"))
   isshenhe=Replace_Text(request("isshenhe"))
   regcontent=request("content")
   modiid=Replace_Text(request("modiid"))
   roleid=Replace_Text(request("roleid"))
   oldroleid=Replace_Text(request("oldroleid"))
   foldersize=Replace_Text(request("foldersize"))
   if isreg<>"" then 
   canreg=1
   else
   canreg=0
   end if
   if isshenhe<>"" then 
   shen=1 
   else
   shen=0
   end if
   if  moidbtn<>"" then 
    if gradename<>"" and modiid<>""  and roleid<>""  then 
     if not isnumeric(roleid) then 
   response.Write("<script >alert('请输入等级ID值为整型数字!');history.back(-1);</script>")
   response.End()
  end if  
     if not isnumeric(foldersize) then 
   response.Write("<script >alert('请输入空间大小为整型数字!');history.back(-1);</script>")
   response.End()
  end if
    set rsmm=server.CreateObject("adodb.recordset")
  sqlmm="select   * from yixiang_vipgrade where (gradename='"&gradename&"'  or roleid="&roleid&") and id<>"&modiid&""
  rsmm.open sqlmm,conn,1,3
  if not rsmm.eof then 
  resultmss="修改失败!<font color=blue>原因</font>:该等级名称或等级ID值已经存在!"
  else
     conn.execute "update yixiang_vipgrade  set gradename='"&gradename&"',allowreg="&canreg&",shenhe="&shen&",regcontent='"&regcontent&"',roleid="&roleid&",foldersize="&foldersize&"  where id="&modiid
  conn.execute "update wygkcn_corporation set gradeid="&roleid&" where gradeid="&oldroleid&""
    resultmss="修改成功!&nbsp;&nbsp;&nbsp;<a href='grademanage.asp'><font color=blue>返回等级列表</font></a>"
	end if
   end if
   end if
   %>
 <body>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr> 
<th width="100%" height=25 class="tableHeaderText">会员等级信息修改管理</th>
</tr>
<tr>
<td class="forumRowHighlight"> <B>注意: </B><BR> ①.<font color="red">等级ID</font>是会员直属某类等级的直接<font color=red>关联值</font>,关系整个系统的所有会员的一切信息,请不要随意更改,否则将造成严重后果! 
<br />②.等级ID值不能有重复,如有,后果自负! 
</td>
</tr>
<tr>
<td class="forumRowHighlight">★<a href="grademanage.asp">等级列表</a>
</td>
</tr>
</table>
<table border="1" cellpadding="0"  bordercolor="#ADE0FD"  cellspacing="0" width="98%" align="center">
<tr>
  <td>
  <%
gid=Replace_Text(request("gid"))
if gid="" then 
 response.Write("<script >alert('参数传递错误!');history.back(-1);</script>")
response.End()
 else
set rsm=server.CreateObject("adodb.recordset")
sqlm="select *  from yixiang_vipgrade where id="&gid
rsm.open sqlm,conn,1,3
if not rsm.eof then 
 %>
  <table width="98%" border="0" align="center" cellpadding="0"  cellspacing="0" bgcolor="#FFFFFF">
   <tr><td colspan="2"   align="center" height="25">&nbsp;&nbsp;<a href="gradeform.asp?fid=<%=rsm("id")%>">表单设置</a>&nbsp;&nbsp;<a href="graderole.asp?rid=<%=rsm("id")%>">权限设置</a>&nbsp;&nbsp;<font color="red"><%=resultmss%></font></td></tr>
<form name="modiform" method="post" action="" onsubmit="return ischeckg();">
 <tr align="center" bgcolor="#F3F3F3">
  <td height="30" align="right" >
  <font color="#0099CC">等级名称</font>:</td>
  <td align="left"><input type="hidden" name="modiid" value="<%=gid%>" /><input type="text" name="gradename" value="<%=rsm("gradename")%>" maxlength="20"  onblur="this.value=this.value.replace(/\s/g,'');"/>
  &nbsp;&nbsp;<font color="#0099CC">等级ID值</font>:<input type="text"  maxlength="5"  name="roleid" value="<%=rsm("roleid")%>" size="5"  onBlur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字!');this.value=0}" />
  <input type="hidden" name="oldroleid" value="<%=rsm("roleid")%>" maxlength="5" />
  <font  color="#D13F25">(提示:请不要随意的修改等级名称和等级ID值)</font></td> 
</tr>
<tr><td colspan="2" bgcolor="#E8E8E8"  height="2"></td></tr>
 <tr align="center" >
  <td height="30" align="right">是否允许注册:</td>
  <td align="left"><input type="checkbox" value="<%=rsm("allowreg")%>" <%if rsm("allowreg")=1 then response.Write("checked") end  if%> name="isreg"  />允许</td></tr>
<tr align="center">
  <td height="30" align="right">是否需要审核:</td>
  <td align="left"><input type="checkbox"  value="<%=rsm("shenhe")%>" <%if rsm("shenhe")=1 then response.Write("checked") end  if%>  name="isshenhe"  />需审核</td></tr>
  <tr align="center">
  <td height="30" align="right">分配空间大小:</td>
  <td align="left"><input type="text" name="foldersize" value="<%=rsm("foldersize")%>" onBlur="if(/[^0-9]/g.test(this.value)){alert('请输入整型数字!');this.value=500}"  maxlength="10"   size="6">KB</td></tr>
<tr align="center" bgcolor="#F5F5F5">
<td align="right"  height="25">注册协议内容:</td>
<td align="left"></td></tr>
<tr   ><td colspan="2" height="25"    align="center"><textarea name="content" style="display:none"><%=rsm("regcontent")%></textarea><iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename&savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="650" HEIGHT="450"></iframe></td>
</tr>
<tr bgcolor="#F6F6F6"><td colspan="2" height="25"  align="right"></td>
</tr>
<tr><td colspan="2"  height="45"  align="center"><input name="moidbtn" type="submit" value=" 修 改 " /></td></tr>
</form>
</table>
<%
end if
end if
%>
  </td>
</tr></table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?