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

📄 delproduct.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
%>
<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
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 = ""
%>
<%
' *** Delete Record: declare variables

if (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then

  MM_editConnection = MM_conn_STRING
  MM_editTable = "product"
  MM_editColumn = "productid"
  MM_recordId = "'" + Request.Form("MM_recordId") + "'"
  MM_editRedirectUrl = "delproductok.asp"

  ' 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
%>
<%
' *** Delete Record: construct a sql delete statement and execute it

If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then

  ' create the sql delete statement
  MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId

  If (Not MM_abortEdit) Then
    ' execute the delete
    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 product__MMColParam
product__MMColParam = "1"
if (Request.QueryString("productid") <> "") then product__MMColParam = Request.QueryString("productid")
%>
<%
set product = Server.CreateObject("ADODB.Recordset")
product.ActiveConnection = MM_conn_STRING
product.Source = "SELECT * FROM product WHERE productid = '" + Replace(product__MMColParam, "'", "''") + "'"
product.CursorType = 0
product.CursorLocation = 2
product.LockType = 3
product.Open()
product_numRows = 0
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>					
function DoDateTime(str, nNamedFormat, nLCID)				
	dim strRet								
	dim nOldLCID								
										
	strRet = str								
	If (nLCID > -1) Then							
		oldLCID = Session.LCID						
	End If									
										
	On Error Resume Next							
										
	If (nLCID > -1) Then							
		Session.LCID = nLCID						
	End If									
										
	If ((nLCID < 0) Or (Session.LCID = nLCID)) Then				
		strRet = FormatDateTime(str, nNamedFormat)			
	End If									
										
	If (nLCID > -1) Then							
		Session.LCID = oldLCID						
	End If									
										
	DoDateTime = strRet							
End Function									
</SCRIPT>
<html>
<head>
<title>商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
<script language="JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<!--#include file="manage.asp" -->
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" class="bk">
  <tr> 
    <td height="213"> 
      <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
        <br>
        <table width="476" border="0" cellspacing="2" cellpadding="0" align="center" class="dfont">
          <tr> 
            <td height="125" rowspan="10" width="137"> 
              <div align="center"><font color="#000000" size="2"><img src="images/product/<%=(product.Fields.Item("images").Value)%>"></font></div>
            </td>
            <td height="15" width="333"> 
              <p><font color="#000000" size="2">商品名称:<b><%=(product.Fields.Item("productname").Value)%></b></font></p>
            </td>
          </tr>
          <tr> 
            <td height="2" width="333"><font color="#000000" size="2">商品序号:<%=(product.Fields.Item("productid").Value)%></font></td>
          </tr>
          <tr> 
            <td height="13" width="333"><font color="#000000" size="2">生产厂商:<%=(product.Fields.Item("changshang").Value)%></font></td>
          </tr>
          <tr> 
            <td height="5" width="333"><font color="#000000" size="2">出厂日期:<%= DoDateTime((product.Fields.Item("cdate").Value), 1, -1) %></font></td>
          </tr>
          <tr> 
            <td height="3" width="333"><font color="#000000" size="2">现有数量:<%=(product.Fields.Item("Stock").Value)%></font></td>
          </tr>
          <tr> 
            <td height="10" width="333"><font color="#000000" size="2"> 
              <% If (product.Fields.Item("dazhe").Value) <> (-1) Then 'script %>
              原价:<font color="#FF0000"><%=(product.Fields.Item("yprice").Value)%></font>元 
              <% End If ' end If (product.Fields.Item("dazhe").Value) <> (-1) script %>
              <% If (product.Fields.Item("dazhe").Value) = (-1) Then 'script %>
              原价:<span class="hot"><%=(product.Fields.Item("yprice").Value)%></span>元 特价:<font color="#FF0000"><%=(product.Fields.Item("xprice").Value)%></font>元 
              <% End If ' end If (product.Fields.Item("dazhe").Value) = (-1) script %>
              </font></td>
          </tr>
          <tr> 
            <td height="2" width="333"><font color="#000000" size="2">重量:<%=(product.Fields.Item("weight").Value)%></font></td>
          </tr>
          <tr> 
            <td height="0" width="333"><font size="2">销售数量:<%=(product.Fields.Item("sell").Value)%></font></td>
          </tr>
          <tr> 
            <td height="0" width="333"><font size="2">查看次数:<%=(product.Fields.Item("hit").Value)%></font></td>
          </tr>
          <tr> 
            <td height="0" width="333"><font size="2">上架时间:<%=(product.Fields.Item("jrdate").Value)%></font></td>
          </tr>
          <tr> 
            <td height="17" colspan="2"><font color="#000000" size="2"><%=(product.Fields.Item("productjs").Value)%></font></td>
          </tr>
        </table>
        <p align="center"> 
          <input type="submit" name="Submit" value="删除">
           <a href="managesp.asp"> 返回</a></p>
        <input type="hidden" name="MM_delete" value="true">
        <input type="hidden" name="MM_recordId" value="<%= product.Fields.Item("productid").Value %>">
      </form>
    </td>
  </tr>
</table>
<br><!--#include file="bottom.asp" -->
</body>
</html>
<%
product.Close()
%>

⌨️ 快捷键说明

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