⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_points.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
字号:
<%
Option Explicit
Response.buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="../Inc/Const.asp"-->
<!--#Include File="User_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="User_Style.css" type="text/css" rel="stylesheet">
<script language="javascript" src="../Js/Common.js"></script>
<title><%=PointItemName%>管理</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="13%" background="Images/navbg.gif"><img src="Images/navtitle.gif" width="113" height="37"></td>
    <td width="87%" background="Images/navbg.gif">| <a href="User_Points.asp" class="nav"><%=PointItemName%>管理</a> | <a href="User_Points.asp?Action=Log" class="nav"><%=PointItemName%>兑换记录</a> |</td>
  </tr>
</table>
<div class="dw">
<%
Dim CurrentPage, URLParameters
CurrentPage = EL_Common.ELRequest("page", 2)
URLParameters = request.ServerVariables("QUERY_STRING")
If CurrentPage<1 Then 
   CurrentPage = 1
Else
   URLParameters = EL_Common.ReplaceText(URLParameters, "&*page=[0-9]*", "")
End If

Select Case Action
   Case "": Call ManagePoint()
   Case "Exchange": Call ExchangePoints()
   Case "Log": Call ExchangeLog()
End Select
Call ApplicationTerminate()

Sub ExchangePoints()
  On Error Resume Next
  Dim PointCmd
  Dim ExchangeNum, ExchangeProportion
  ExchangeProportion = EL_Common.GetFieldValue("ExchangeProportion", "EL_Config", "1=1")
  ExchangeNum = EL_Common.ELRequest("ExchangeNum", 2)
  
  Call EL_Common.InitCommand(PointCmd, "EL_SP_PointExchange")
  With PointCmd
     .Parameters.Append .CreateParameter("RETURN", 2, 4)
	 .Parameters.Append .CreateParameter("@UserID", 3, 1, 4, EL_User.UserID)
	 .Parameters.Append .CreateParameter("@ExchangeNum", 3, 1, 4, ExchangeNum)
	 .Parameters.Append .CreateParameter("@RemoteIp", 200, 1, 15, RemoteIp)
	 .Execute()
  End With
  If PointCmd(0) = 40 Then
     EL_Common.ShowErrorMsg("您输入的"& ExpItemName &"不正确,至少需要"& ExchangeProportion & ExpItemUnit)
	 Set PointCmd = Nothing
	 Exit Sub
  ElseIf PointCmd(0) = 41 Then
     EL_Common.ShowErrorMsg("您没有足够的"& ExpItemName )
	 Set PointCmd = Nothing
	 Exit Sub
  End If
  Set PointCmd = Nothing
  EL_Common.ShowSuccessMsg("兑换成功")
  EL_Common.ShowScriptError()
End Sub

Sub ExchangeLog()
On Error Resume Next
Dim LogCmd, rsLog, RowCount, i, StrCondition
Dim PageSizes, PageCounts, TotalRowCount
PageSizes = 20
StrCondition = "UserID="& EL_User.UserID &" AND UserName='"& EL_User.UserName &"'"

Call EL_Common.InitCommand(LogCmd, "EL_SP_SplitPage")
With LogCmd
  .Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
  .Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_Exchange")
  .Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "ChangeID")
  .Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "ChangeID DESC")
  .Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
  .Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
  .Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, "*")
  .Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
  .Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
  .Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
  .Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
  Set rsLog = .Execute()
End With
rsLog.Close()
RowCount = LogCmd(0)
TotalRowCount = LogCmd(9)
PageCounts = LogCmd(10)


%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td width="8%" align="center" class="top_Item"><strong>ID</strong></td>
    <td width="12%" align="center" class="top_Item"><strong>用户ID</strong></td>
    <td width="13%" align="center" class="top_Item"><strong>用户名</strong></td>
    <td width="14%" align="center" class="top_Item"><strong>兑换数量</strong></td>
    <td width="13%" align="center" class="top_Item"><strong><%=PointItemName%></strong></td>
    <td width="12%" align="center" class="top_Item"><strong>兑换比例</strong></td>
    <td width="13%" align="center" class="top_Item"><strong>兑换时间</strong></td>
    <td width="15%" align="center" class="top_Item"><strong>IP地址</strong></td>
  </tr>
  <%
  If RowCount = 0 Then
     Response.Write "<tr><td class='td_50' colspan=8 align='center'></td></tr>"
  Else
     rsLog.Open()
	 For i = 1 To RowCount
  %>
  <tr class="td_22" onMouseOut="this.className='td_22'" onMouseOver="this.className='MouseOver_22'">
    <td align="center"><%=rsLog("ChangeID")%></td>
    <td align="center"><%=rsLog("UserID")%></td>
    <td align="center"><%=EL_Common.ServerHTMLEncode(rsLog("UserName"))%></td>
    <td align="center"><%=rsLog("ExchangeNum")%></td>
    <td align="center"><%=rsLog("Points")%></td>
    <td align="center"><%=rsLog("ExchangeProportion")%>:1</td>
    <td align="center"><%=rsLog("UpdateTime")%></td>
    <td align="center"><%=rsLog("RemoteIp")%></td>
  </tr>
  <%
        rsLog.MoveNext
	 Next
	 rsLog.Close()
  End If
  %>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td align="right"><%=EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
  </tr>
</table>
<%
Set rsLog = Nothing
Set LogCmd = Nothing
EL_Common.ShowScriptError()
End Sub

Sub ManagePoint()
On Error Resume Next
Dim ExchangeProportion
ExchangeProportion = EL_Common.GetFieldValue("ExchangeProportion", "EL_Config", "1=1")
%>
<script language="javascript">
function Check(frm){
  if(frm.ExchangeNum.value.trim()==""){
     alert("请输入<%=ExpItemName%>");
	 frm.ExchangeNum.focus();
	 return false;
  }
  SubmitOnce(frm);
}
</script>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td height="300" align="center"><table width="480" border="0" cellpadding="0" cellspacing="1" class="Border">
      <tr>
        <td colspan="2" class="top_26"><%=EL_User.UserName%> 的<%=PointItemName%>情况</td>
      </tr>
      <tr>
        <td width="116" align="right" class="td_ItemName"><strong><%=PointItemName%>:</strong></td>
        <td width="329" class="td_22" style="height:50px; padding:10px;"><span style="color:red; font-size:18px; font-weight:bold;"><%=EL_User.Points%></span> <%=PointItemUnit%></td>
      </tr>
      <tr>
        <td align="right" class="td_ItemName"><strong>论坛<%=ExpItemName%>:</strong></td>
        <td class="td_22" style="height:50px; padding:10px;"><span style="color:red; font-size:18px; font-weight:bold;"><%=EL_User.Exps%></span> <%=ExpItemUnit%></td>
      </tr>
      <tr>
        <td colspan="2" align="center" class="td_22" style="height:30px; font-size:14px;">兑换比例:<%=ExchangeProportion%><%=ExpItemUnit & ExpItemName%>兑换1<%=PointItemUnit & PointItemName%></td>
      </tr>
      <tr>
        <td align="right" class="td_ItemName"><strong>我要兑换:</strong><br>
          填写<%=ExpItemName%>&nbsp;&nbsp;</td>
        <td class="td_22" style="height:50px; padding:10px;">
		<form name="myform" action="User_Points.asp" method="post" onSubmit="return Check(this)">
            <input name="ExchangeNum" type="text" id="ExchangeNum" size="15">
            <%=ExpItemUnit%>
            <input type="submit" name="Submit" value="立即兑换">
            <input name="Action" type="hidden" id="Action" value="Exchange">
        </form></td>
      </tr>
      <tr>
        <td colspan="2" class="td_item_22" style="height:50px;"><span class="blueText">兑换说明:当输入的<%=ExpItemName%>不是兑换比例的倍数时,系统会退还其余数的<%=ExpItemName%>,如:输入的是<%=ExchangeProportion+200%>,系统将使用<%=ExchangeProportion%>进行兑换,并退还其多余的200<%=ExpItemUnit%>。<br>
         会员消费与积分说明:每消费 <strong><%=ConsumeProportion%></strong> 元可获1分积分的奖励,会员积分可用于<a href="<%=InstallDir%>Shop/" target="_blank" style="color:red; text-decoration:underline;">商品兑换</a></span></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
<%
EL_Common.ShowScriptError()
End Sub

%>
</div>
</body>
</html>

⌨️ 快捷键说明

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