📄 b2b_jfgl.asp
字号:
<!--#include file="conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
else
if request.cookies("Buy2Buy")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
end if
end if
'限制添加权限管理员
if session("rank")=2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('您的管理权限未达到此操作等级!');history.go(-1);</script>"
response.End
end if
%>
<title>订单管理</title>
<style type="text/css">
<!--
.style4 {color: #FF0000}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 { color: #000000;
font-weight: bold;
}
-->
</style>
<script language="javascript">
function chk()
{
if (document.myform.ChangeScore.value == '')
{
alert("变动分数为空!");
return false;
}
return true;
}
</script>
<%
action = trim(request("action"))
if action = "Change" then
op_obj = trim(request("op_obj"))
op_type = trim(request("op_type"))
SingleUserName = trim(request("SingleUserName"))
selectGroup = trim(request("selectGroup"))
ChangeMemo = trim(request("ChangeMemo"))
ChangeScore = trim(request("ChangeScore"))
if op_type = "add" then
UpdateCondition = "Score = Score + " & ChangeScore
else
UpdateCondition = "Score = Score - " & ChangeScore
end if
if op_obj = "SingleUser" then
'判断用户是否存在
sql= "select username,score from [user] where username = '" & SingleUserName &"'"
set tmpRs=conn.execute(sql)
if not (tmpRs.eof and tmpRs.bof) then
'若存在,则改变分数
sql = "update [user] set " & UpdateCondition & " where username = '" & SingleUserName &"'"
conn.execute(sql)
'写日志表
score = 0
if op_type = "add" then
op_type_tmp = "增加"
'score = tmpRs("score")+int(ChangeScore)
else
op_type_tmp = "减少"
'score = tmpRs("score")-int(ChangeScore)
end if
sql = "Insert into ChangeScore(username,op_adminname,op_type,op_changescore,changememo,score) values("
sql = sql & "'"&SingleUserName&"','"&session("admin")&"','"&op_type_tmp&"',"&ChangeScore&",'"&ChangeMemo&"',"&tmpRs("score")&")"
conn.execute(sql)
end if
tmpRs.close
set tmpRs=nothing
end if
if op_obj = "GroupUser" then
sql = "update [user] set " & UpdateCondition & " where grpid =" & selectGroup
conn.execute(sql)
sql = "select username,score from [user] where grpid =" & selectGroup
set tmpRs=conn.execute(sql)
if not (tmpRs.eof and tmpRs.bof) then
while not tmpRs.eof
score = 0
if op_type = "add" then
op_type_tmp = "增加"
'score = tmpRs("score") + int(ChangeScore)
else
op_type_tmp = "减少"
'score = tmpRs("score") - int(ChangeScore)
end if
sql = "Insert into ChangeScore(username,op_adminname,op_type,op_changescore,changememo,score) values("
sql = sql & "'"&tmpRs("username")&"','"&session("admin")&"','"&op_type_tmp&"',"&ChangeScore&",'"&ChangeMemo&"',"&tmpRs("score")&")"
conn.execute(sql)
tmpRs.movenext
wend
end if
tmpRs.close
set tmpRs=nothing
end if
if op_obj = "AllUser" then
sql = "update [user] set " & UpdateCondition
conn.execute(sql)
sql = "select username,score from [user] "
set tmpRs=conn.execute(sql)
if not (tmpRs.eof and tmpRs.bof) then
while not tmpRs.eof
score = 0
if op_type = "add" then
op_type_tmp = "增加"
'score = int(tmpRs("score")) + int(ChangeScore)
else
op_type_tmp = "减少"
'score = int(tmpRs("score")) - int(ChangeScore)
end if
sql = "Insert into ChangeScore(username,op_adminname,op_type,op_changescore,changememo,score) values("
sql = sql & "'"&tmpRs("username")&"','"&session("admin")&"','"&op_type_tmp&"',"&ChangeScore&",'"&ChangeMemo&"',"&tmpRs("score")&")"
conn.execute(sql)
tmpRs.movenext
wend
end if
tmpRs.close
set tmpRs=nothing
end if
response.write "<script>alert('操作成功!');window.location.href='b2b_jfgl.asp';</Script>"
response.end
end if
%>
<table width="99%" border="5" align="center" cellpadding="5" cellspacing="5" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr>
<td background="images/topbg.gif"><span class="STYLE1"><img src="images/pic5.gif" width="28" height="22" align="absmiddle" />您现在所在的位置是: <a href="adminhelp.asp">管理首页</a> -> <span class="style4">用户积分管理</span></span></td>
</tr>
<tr>
<td height="167" valign="top" bgcolor="#FFFFFF">
<table width="70%" border="2" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
<form action="b2b_jfgl.asp?action=Change" method="post" name="myform" onsubmit="return chk();"><tr bgcolor="#F7F7F7" align="center">
<td width="19%" height="25" background="images/topbg.gif"><strong>管理名称</strong></td>
<td width="81%" height="25" background="images/topbg.gif"><strong>基本管理参数</strong></td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#F7F7F7"><strong>操作对象</strong></td>
<td height="25" bgcolor="#FFFFFF">
<input type="radio" name="op_obj" value="SingleUser" />
指定用户
<input name="SingleUserName" type="text" class="input_sr" id="SingleUserName" size="30" />
<br /> <input type="radio" name="op_obj" value="GroupUser" />
用户等级
<select name="selectGroup" id="selectGroup">
<%
sql = "select * from b2b_userjb order by grpID"
set tmpRs=conn.execute(sql)
if not (tmpRs.eof and tmpRs.bof) then
while not tmpRs.eof
%>
<option value="<%=trim(tmpRs("grpid"))%>"><%=trim(tmpRs("GRPName"))%></option>
<%
tmpRs.movenext
wend
end if
tmpRs.close
set tmpRs=nothing
%>
</select>
<br />
<input name="op_obj" type="radio" value="AllUser" checked="checked" />
所有用户</td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#F7F7F7"><strong>操作类型</strong></td>
<td height="25" bgcolor="#FFFFFF"><input name="op_type" type="radio" value="add" checked="checked" />
增加积分
<input type="radio" name="op_type" value="sub" />
减少积分</td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#F7F7F7"><strong>变动原因</strong></td>
<td height="25" bgcolor="#FFFFFF"><textarea name="ChangeMemo" cols="50" rows="4" class="input_sr" id="ChangeMemo"></textarea></td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#F7F7F7"><strong>变动数量</strong></td>
<td height="25" bgcolor="#FFFFFF"><input name="ChangeScore" type="text" class="input_sr" id="ChangeScore" size="10" /></td>
</tr>
<tr>
<td height="25" colspan="2" align="center" bgcolor="#F7F7F7">
<input name="Submit" type="submit" class="input_bot" value="保存此次修改" onclick="javascript:return confirm('确定保存吗?');"/> </td>
</tr></form>
</table>
</td>
</tr></table>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -