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

📄 upsclass.asp

📁 体育商城
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="admin,class,product"
MM_authFailedURL="adminloginerr.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM bclass"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conn_STRING
Recordset2.Source = "SELECT * FROM sclass"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
Recordset2_numRows = 0
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
'JomoWeb c2001 nstrpt1
function JomoPrefix(rs, fldName)
dim str, strlen, whereloc, orderloc
str = rs.source
strlen = Len(str)
whereloc=InStr(str," WHERE ")
orderloc=InStr(str," ORDER BY ")
if orderloc = 0 and whereloc = 0 then 
  JomoPrefix = str & " WHERE " & fldName & " = "
else
  if whereloc = 0 then
  	JomoPrefix=Left(str,orderloc) & " WHERE " & fldName & " = "
  else
  	if orderloc = 0 then orderloc = strlen
  	JomoPrefix=Left(str,whereloc+6) &" ( " &  Mid(str, whereloc+7, orderloc - whereloc -6 ) & " )  AND " & fldName & " = "
  end if
end if
end function

function JomoPostfix(rs)
dim str, orderloc
str=rs.source
orderloc = InStr(str," ORDER BY ")
if orderloc = 0 then
  JomoPostfix = ""
else
JomoPostfix = " " & right(str, Len(str) - orderloc)
end if
end function
 %>
<% 
'JomoWeb c2001 nstrpt2
dim Recordset1_prefix, Recordset1_postfix
Recordset1_prefix = JomoPrefix(Recordset1, "bclassid")
Recordset1_postfix=JomoPostfix(Recordset1)
 %>
<% 
'JomoWeb c2001 nstrpt2
dim Recordset2_prefix, Recordset2_postfix
Recordset2_prefix = JomoPrefix(Recordset2, "bclassid")
Recordset2_postfix=JomoPostfix(Recordset2)
 %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0">
<!--#include file="manage.asp" -->
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" class="bk">
  <tr> 
    <td height="157"> 
      <div align="center"><a href="addsclass.asp"><br>
        新增子类</a> <br>
      </div>
      <table width="66%" border="1" cellspacing="2" cellpadding="0" align="center" bordercolor="#FFFFFF" class="dfont">
        <tr> 
          <td height="2" bordercolor="#000000" background="images/bg22.gif"> 
            <div align="center"><b><font color="#000000" size="2">商品子类管理</font></b></div>
          </td>
        </tr>
        <tr> 
          <td height="17" bordercolor="#000000"> 
            <div align="center"> 
              <%
'JomoWeb c2001 nstrpt3
if "Recordset1" <> "Recordset1" then
  Recordset1.close()
  if Recordset1.state = 1 then Recordset1_Fld = Recordset1("bclassid")
Recordset1.source = Recordset1_prefix & Recordset1_Fld & Recordset1_postfix
  Recordset1.open()
end if
while NOT Recordset1.EOF
 %>
              <table width="98%" border="1" cellspacing="2" cellpadding="0" bordercolor="#FFFFFF" class="dfont">
                <tr bordercolor="#000000" bgcolor="#999999"> 
                  <td bgcolor="#99CC66"> <font color="#FFCC00"><b><font color="#000000"><%=(Recordset1.Fields.Item("bclassname").Value)%></font></b></font></td>
                </tr>
                <%
'JomoWeb c2001 nstrpt3
if "Recordset2" <> "Recordset1" then
  Recordset2.close()
  if Recordset1.state = 1 then Recordset1_Fld = Recordset1("bclassid")
Recordset2.source = Recordset2_prefix & Recordset1_Fld & Recordset2_postfix
  Recordset2.open()
end if
while NOT Recordset2.EOF
 %>
                <tr bordercolor="#000000"> 
                  <td height="9"> <%=(Recordset2.Fields.Item("sclassname").Value)%>   <a href="upsclassname.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "sclassid=" & Recordset2.Fields.Item("sclassid").Value %>">更新</a> 
                    <a href="delsclass.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "sclassid=" & Recordset2.Fields.Item("sclassid").Value %>">删除</a> 
                  </td>
                </tr>
                <%
'JomoWeb c2001 nstrpt4
Recordset2.moveNext()
wend
 %>
              </table>
              <%
'JomoWeb c2001 nstrpt4
Recordset1.moveNext()
wend
 %>
            </div>
          </td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
</table>
<br>
<!--#include file="bottom.asp" --></body>
</html>
<%
Recordset1.Close()
%>
<%
Recordset2.Close()
%>

⌨️ 快捷键说明

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