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

📄 2.asp

📁 一个非常好的旅游网站程序.
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="../conn.asp" -->
<%
shop_name=request("shop_name")
Classification_0="推荐商品"
set rs=server.createobject("adodb.recordset")
sqltext="select  * from Product  Where p_shop='"& shop_name &"' and Classification='"& Classification_0 &"' order by Product_No desc"
rs.open sqltext,conn,1,1

dim MaxPerPage
MaxPerPage=12

'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
 Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
   checkpage=instr(1,text,mid(request("page"),i,1))
   if checkpage=0 then
      exit for 
   end if
next

If checkpage<>0 then
      If NOT IsEmpty(request("page")) Then
        CurrentPage=Cint(request("page"))
        If CurrentPage < 1 Then CurrentPage = 1
        If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
      Else
        CurrentPage= 1
      End If
      If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
   CurrentPage=1
End if

%>

<HTML>
<HEAD>
<TITLE>003</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<style>
a            { text-decoration: none; color: #E7DCBA }
a:hover      { text-decoration: underline; color: #FFFFFF }
.font1 {font-size: 25pt; filter: dropshadow(color=#7E6A2C,offx=3,offy=3, positive=80); color: #E7DCBA; font-family: "宋体"}
TD {font-size: 12pt; filter: dropshadow(color=#7E6A2C,offx=1,offy=1, positive=80); color: #E7DCBA; font-family: "宋体"}

</style>
<SCRIPT language=JavaScript>
<!--
function openbag(url,name){
		window.open(url,name,"height=200,width=600,left=190,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no")}
-->
</SCRIPT>
<NOSCRIPT><IFRAME SRC="*.html"></IFRAME></NOSCRIPT> 

<script language="javascript">
function click() {
if (event.button==2) {
alert('您好!欢迎您光临汕头商城!')
}
}
document.onmousedown=click
</script>
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</HEAD>
<BODY BGCOLOR=#FFFFFF leftmargin="0" topmargin="0" background="images/bg.gif" onLoad="MM_preloadImages('images/default_down_08.gif','images/default_down_10.gif','images/default_down_11.gif','images/default_down_12.gif','images/default_down_13.gif','images/default_down_14.gif','images/default_down_15.gif')">
<TABLE WIDTH=777 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center" bgcolor="#a58639">
  <TR> 
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=144 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=52 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=20 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=72 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=61 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=12 HEIGHT=1></TD>
    <TD> <IMG SRC="images/Spacer.gif" WIDTH=56 HEIGHT=1></TD>
  </TR>
  <TR> 
    <TD COLSPAN=12> <IMG SRC="images/default_01.gif" WIDTH=777 HEIGHT=3></TD>
  </TR>
  <TR> 
    <TD COLSPAN=2 ROWSPAN=2> <IMG SRC="images/default_02.gif" WIDTH=196 HEIGHT=63></TD>
    <TD  class="font1" COLSPAN=7 height="43"> 
      <div align="center"><b><%=shop_name%></b></div>
    </TD>
    <TD  class="font1" height="43">&nbsp;</TD>
    <TD COLSPAN=2 ROWSPAN=2> <IMG SRC="images/default_04.gif" WIDTH=68 HEIGHT=63></TD>
  </TR>
  <TR> 
    <TD COLSPAN=8> <IMG SRC="images/default_05.gif" WIDTH=513 HEIGHT=20></TD>
  </TR>
  <TR> 
    <TD COLSPAN=12> <IMG SRC="images/default_06.gif" WIDTH=777 HEIGHT=23></TD>
  </TR>
  <TR> 
    <TD ROWSPAN=2> <IMG SRC="images/default_07.gif" WIDTH=144 HEIGHT=49></TD>
    <TD COLSPAN=2> <a href="default.asp?shop_name=<%=shop_name%>" onMouseOver="MM_swapImage('d08','','images/default_down_08.gif',1)" onMouseOut="MM_swapImgRestore()"><IMG SRC="images/default_08.gif" WIDTH=72 HEIGHT=23 border="0" name="d08"></a></TD>
    <TD> <IMG SRC="images/default_down_09.gif" WIDTH=72 HEIGHT=23 name="d09" border="0"></TD>
    <TD> <a href="3.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d10','','images/default_down_10.gif',1)"><IMG SRC="images/default_10.gif" WIDTH=72 HEIGHT=23 name="d10" border="0"></a></TD>
    <TD> <a href="4.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d11','','images/default_down_11.gif',1)"><IMG SRC="images/default_11.gif" WIDTH=72 HEIGHT=23 name="d11" border="0"></a></TD>
    <TD> <a href="7.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d14','','images/default_down_14.gif',1)"><IMG SRC="images/default_14.gif" WIDTH=72 HEIGHT=23 name="d14" border="0"></a></TD>
    <TD> <a href="5.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d12','','images/default_down_12.gif',1)"><IMG SRC="images/default_12.gif" WIDTH=72 HEIGHT=23 name="d12" border="0"></a></TD>
    <TD> <a href="6.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d13','','images/default_down_13.gif',1)"><IMG SRC="images/default_13.gif" WIDTH=72 HEIGHT=23 name="d13" border="0"></a></TD>
    <TD COLSPAN=2> <a href="8.asp?shop_name=<%=shop_name%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('d15','','images/default_down_15.gif',1)"><IMG SRC="images/default_15.gif" WIDTH=73 HEIGHT=23 name="d15" border="0"></a></TD>
    <TD ROWSPAN=2> <IMG SRC="images/default_16.gif" WIDTH=56 HEIGHT=49></TD>
  </TR>
  <TR> 
    <TD COLSPAN=10> <IMG SRC="images/default_17.gif" WIDTH=577 HEIGHT=26></TD>
  </TR>
</TABLE>

<table width="777" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="500" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="35">&nbsp;</td>
          <td width="465">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top"> 
       
      <table width="680" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#7E6A2C" bordercolordark="#E7DCBA">
        <tr>
          <td height="307" valign="top"> <br>
            <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" style="line-height: 150%">
              <tr> 
                <%                                                      
'/////////////////////////////////////////////////////////假如没有商品时//////////////////                                                      
If rs.eof and rs.bof then                                                       
   response.write "<td><p align='center'><font color='#ff0000'>还没任何商品资料</font></p></td>"                                                      
                                                       
End if %>
                <%row_count=1                                                      
    '/////////////////////////////////////显示帖子的子程序////// ///////////////////////////////////                                                     
Sub list()%>
                <%i=0                                                      
   Do While Not rs.EOF%>
                <td height="56" align="center"  valign="top"><a href="../../ProductDetail.asp?Product_id=<%=rs("Product_id")%>"><img name="small" border="0" src="../../manage/pic_play.asp?pic_id=<%=rs("pic_id")%>" width="83" height="94"  ><br>
                  <%=rs("Product_Name")%><br>
                  </a>销售商:<%=rs("p_shop")%><br>
                  会员价:<%=rs("P_NewPrice")%>元<br>
                  <a href="javascript:openbag('../../check.asp?cpbm=<%=rs("Product_Id")%>&amp;shopname=<%=rs("p_shop")%>')"><img style="CURSOR: hand" height="22" src="../../images/che1.gif" width="56" align="absMiddle" border="0"></a> 
                </td>
                <%if row_count mod 4 =0 then%>
              </tr>
              <tr> 
                <td height="20"></td>
              </tr>
              <tr> 
                <%end if%>
                <%                                                     
                        i=i+1                                                     
  					    if i >= MaxPerpage then exit do                                                     
				    	rs.MoveNext                                                     
					    row_count=row_count+1                                                     
						Loop                                                     
					end Sub                                                     
					  %>
                <% 
'显示翻页子程序
call list                                                     
   If Rs.recordcount > MaxPerPage then               
    Response.write "<br>"                                                  
   call showpages                                                     
 end if%>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
</table>
<table width="777" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td bgcolor="#FF6600" height="3"></td>
  </tr>
  <tr>
    <td>
      <div align="center"><br>
      </div>
    </td>
  </tr>
</table>
<br>
<%
'显示翻页的子程序
sub showpages()%>
<table border="0" cellPadding="0" cellSpacing="0" width="590" align="center" >
  <form method=Post action='2.asp?shop_name=<%=shop_name%>'> 
  <tr>
      <td> 
        <table border="0" cellPadding="0" cellSpacing="3" width="590" align="center">
          <tr> 
            <td class=main1 height="30"> 
              <p align="center"> 
                <%    
   If currentpage > 1 Then
      response.write "<a href='2.asp?&page="+cstr(1)+"&shop_name="+Cstr(shop_name)+"'>首页</a><font color='#FF0000'><b> — </b></font>"  
      Response.write "<a href='2.asp?page="+Cstr(currentpage-1)+"&shop_name="+Cstr(shop_name)+"'>前页</a><font color='#FF0000'><b> — </b></font>"
   Else
      Response.write "首页<font color='#FF0000'><b>—</b></font>"
      Response.write "前页<font color='#FF0000'><b>—</b></font>"      
   End if
   
   If currentpage < Rs.PageCount Then
      Response.write "<a href='2.asp?page="+Cstr(currentPage+1)+"&shop_name="+Cstr(shop_name)+"'>后页</a><font color='#FF0000'><b>—</b></font>"
      Response.write "<a href='2.asp?page="+Cstr(Rs.PageCount)+"&shop_name="+Cstr(shop_name)+"'>尾页</a>&nbsp;&nbsp;"
   Else
      Response.write "后页—"
      Response.write "尾页&nbsp;&nbsp;"       
   End if
   Response.write "页次:" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font>&nbsp;"
   Response.write "<font color=#FF0000>" & Cstr(MaxPerPage) & "</font>" & "种产品/页&nbsp" & "共" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>种产品</font>&nbsp;&nbsp;"

response.write "</td><td align='right' >"
response.write "<font  class=main1>转到:<input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
   response.write "<input class=buttonface type='submit'  value='Go'  name='cndok' style='background-color: #E6E4C4'></span>&nbsp;&nbsp;"   
%>
            </td>
        </tr>
      </table>
      </td>
  </tr>
  </form>
</table>
<%end sub%>

</BODY>
</HTML>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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