📄 windcn2.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/cardshop.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_cardshop_STRING
MM_editTable = "operate"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "checkcard.asp"
MM_fieldsStr = "valid|value"
MM_columnsStr = "valid|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("cardnumber") <> "") Then
Recordset1__MMColParam = Request.Form("cardnumber")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_cardshop_STRING
Recordset1.Source = "SELECT * FROM operate WHERE cardnumber = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../font.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="760" border="1">
<tr bgcolor="#CCCCCC">
<td width="116"> </td>
<td width="628"> </td>
</tr>
<tr>
<td height="348" valign="top" bgcolor="#CCCCCC">
<!--#include file="menu.asp" -->
</td>
<td valign="top"><p>. 卡数据查询系统 </p>
<p> </p>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">卡号:</td>
<td><%=(Recordset1.Fields.Item("cardnumber").Value)%></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">金额:</td>
<td><%=(Recordset1.Fields.Item("cost").Value)%></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">提交时间:</td>
<td><%=(Recordset1.Fields.Item("datetime").Value)%></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">游戏名称:</td>
<td><%=(Recordset1.Fields.Item("gamename").Value)%></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">详细信息:</td>
<td><%=(Recordset1.Fields.Item("detail").Value)%></td>
</tr>
<tr>
<td height="21" align="right" valign="top" nowrap>有效性:</td>
<td valign="baseline"><%=(Recordset1.Fields.Item("finish").Value)%></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">金额:</td>
<td>
<%
cost1=left(Recordset1.Fields.Item("cardnumber").Value,3)
cost1=right(cost1,1)
select case cost1
case "a"
cost=5
case "b"
cost=10
case "c"
cost=15
case "d"
cost=20
case "e"
cost=25
case "f"
cost=30
case "g"
cost=35
case "h"
cost=40
case "i"
cost=45
case "j"
cost=50
case "k"
cost=55
case "l"
cost=60
case "m"
cost=65
case "n"
cost=70
case "o"
cost=75
case "p"
cost=80
case "q"
cost=85
case "r"
cost=90
case "s"
cost=95
case "t"
cost=100
case "u"
cost=12
case "v"
cost=14
case "w"
cost=16
case "x"
cost=18
case "y"
cost=32
case "z"
cost=48
end select
Response.Write(cost & "元")
%>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">
</form>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
<% If Recordset1.EOF And Recordset1.BOF Then %>
<p>没有这张卡</p>
<% End If ' end Recordset1.EOF And Recordset1.BOF %> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -