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

📄 goodstj.asp

📁 本源代码为大学生购物网的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Inc/AdminChk.asp"-->
<!--#include file="Conn.asp"-->
   <SCRIPT LANGUAGE="JavaScript">
<!--
function GoPage() {
window.location.href="?page_no="+ page.value;
}
//-->
</SCRIPT>
<%
function font(str,goods_ID)
  select case str
  case "0"
    response.Write "<a href='?action=pass&goods_ID="& goods_ID &"'>[推荐]</a>"
  case "1"
    response.Write "<a href='?action=nopass&goods_ID="& goods_ID &"'>[取消]</a>"
  end select
end function

IF request.QueryString("action")<>Empty Then
  select case request.QueryString("action")
 
  case "pass"
  strsql="update [goods_info] set font='1' where goods_ID="&request.QueryString("goods_ID")
  conn.execute(strsql)
  response.Redirect "goodstj.asp"
  
  case "nopass"
  strsql="update [goods_info] set font='0' where goods_ID="&request.QueryString("goods_ID")
  conn.execute(strsql)
  response.Redirect "goodstj.asp"
  end select
End IF

dim strsql,rs
set rs=server.CreateObject("adodb.recordset")
strsql="select * from [goods_info] order by font desc,goods_ID desc"
rs.open strsql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品推荐</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>

<body><!--#include file="top.asp"-->
<div align="center">
<table width="100%" border="0" cellpadding="4" cellspacing="4" class="page">
  <tr bgcolor="#FFF7EE">
    <td width="60" bgcolor="#D9F2FF">商品序号</td>
    <td width="350" bgcolor="#D9F2FF">商品名</td>
  <td width="112" align="center" bgcolor="#D9F2FF">修改</td>
  
  </tr>
	  <%
	  IF Not Rs.Eof And Not Rs.Bof Then
	    Dim page_size
	    Dim page_no
	    Dim page_total
	    page_size=10
	    IF Request.QueryString("page_no")=Empty Then
	      page_no=1
	    Else
	      page_no=Cint(request.QueryString("page_no"))
	    End IF
		Session("page_no")=page_no
		Rs.pagesize=page_size
		page_total=Rs.pagecount
		Rs.absolutepage=page_no
		Dim I,J
		I=0
		J=page_size
		Do while Not Rs.Eof And J>0
		  I=I+1
		  J=J-1
	  %>
  <tr>
    <td><%=rs("goods_id")%></td>
    <td><a href="../goods_info.asp?goods_id=<%=rs("goods_id")%>" target="_blank"><%=rs("goods_name")%></a></td>
  <td><div align="center"><%=font(rs("font"),rs("goods_id"))%></div></td>
  </tr>
	  <%
	      Rs.MoveNext
		Loop      
	  End IF
	  %>
</table>

</div>

<table  width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="page" >
              <tr>
                <td bgcolor="#D9F2FF"><div align="center">[本页是<%=int(page_no)%>/<%=int(page_total)%>] [<a href="?page_no=1">第一页</a>]
              <%if int(page_no)>1 then%>
              [<a href="?page_no=<%=cstr(int(page_no-1))%>">前一页</a>]
              <%elseif int(page_no)<=1 then%>
              [<a href="?page_no=1">前一页</a>]
              <%end if%>
              <%if int(page_no)<int(page_total) then%>
              [<a href="?page_no=<%=cstr(int(page_no+1))%>">后一页</a>]
              <%elseif int(page_no)>=int(page_total) then%>
              [<a href="?page_no=<%=cstr(int(page_total))%>">后一页</a>]
              <%end if%>
              [<a href="?page_no=<%=page_total%>">最后一页</a>] 转到
              <input name="page" type="text" value="<%=page_no%>" size="5">页
			<input type="button" class=input name="Submit" value="转到" onclick="GoPage()"></div></td>
              </tr>
</table><!--#include file="copy.asp"-->
</body>
</html>

⌨️ 快捷键说明

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