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

📄 config.asp

📁 一套完整的在线购物系统
💻 ASP
字号:
<%
Option Explicit
Response.buffer=true
dim web_name,web_url,copyright,cart_count,cart_sum
'-----------------------------------------------网站初始信息-----------------------------------
sub web_nav()
dim rs
set rs=conn.execute("select * from web_info")
web_name=rs("web_name")
web_url=rs("web_url")
copyright=rs("copyright")
rs.close
set rs=nothing
set rs=conn.execute("select count(*) as ccount from mycart where username='"&session("username")&"' and iscpl<>'ok'")
cart_count=rs("ccount")
rs.close
set rs=nothing
set rs=conn.execute("select sum(gsum) as sumgsum from mycart where username='"&session("username")&"' and iscpl<>'ok'")
cart_sum=rs("sumgsum")
rs.close
set rs=nothing
end sub

'------------------------------------网站头部信息--------------------------------------
sub web_head()
%>
<html>
<head>
<title><%=web_name%> - <%=tit%></title>
<meta name="Description"  content="易梵网络">
<meta name="keywords" content="易梵网络,易梵,网络,网站制作,网站设计">
<meta name="author" content="易梵网络">
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link rel=stylesheet href='css/tx.css' type=text/css>
</head>

<body topmargin=0 leftmargin=0>
<table border=0 width=798 cellspacing=0 cellpadding=0 align=center>
 <tr><td width=1 bgcolor=#a5a5a5></td>
     <td width=780>
	   <table border=0 width=780 cellspacing=0 cellpadding=0>
       <tr><td width=180 align=center><img src='pic/logo.gif' width=170></td>
           <td>
               <table border=0 width=600 cellspacing=0 cellpadding=0 align=center>
               <tr><td height=40 align=right colspan=6>
                     <A HREF="my_cart.asp"><IMG SRC="pic/top_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></A>
                     <A HREF="help.asp"><IMG SRC="pic/top_help.gif" WIDTH="76" HEIGHT="20" BORDER="0"></A>
                     <A HREF="logout.asp"><IMG SRC="pic/top_logout.gif" WIDTH="76" HEIGHT="20" BORDER="0"></A>
                      &nbsp;&nbsp;</td></tr>
              <tr><td height=40 width=100><A HREF="index.asp"><IMG SRC="pic/menu_1.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
                  <td height=40 width=100><A HREF="help.asp"><IMG SRC="pic/menu_2.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
				  <td height=40 width=100><A HREF="new_onsale.asp"><IMG SRC="pic/menu_3.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
				  <td height=40 width=100><A HREF="cheap_goods.asp"><IMG SRC="pic/menu_4.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
				  <td height=40 width=100><A HREF="user.asp"><IMG SRC="pic/menu_5.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
				  <td height=40 width=100><A HREF="mailto:webmaster@evangen.com"><IMG SRC="pic/menu_6.gif" WIDTH="100" HEIGHT="35" BORDER="0"></A></td>
             </tr>
             </table>
          </td>       
      </tr>
      <tr><td height=8 background='pic/top_bg.gif' width=780 colspan=2></td></tr>
      </table>
 </td>
<td width=17 background='pic/right_bg.gif'></td></tr>
</table>
<%
end sub

'---------------------------------------------商城公告----------------------------------------
sub web_annou()
dim rs
set rs=conn.execute("select top 8 * from announce order by intime desc")
do while not rs.eof
response.write"<img src='pic/dot.gif' width=7 height=10>&nbsp;<a href='#' onclick=javascript:window.open('announce.asp?id="&rs("id")&"',null,'width=550,height=400');>"&left(rs("title"),11)&"&nbsp;&nbsp;"
response.write month(rs("intime"))&"-"&day(rs("intime"))&"</a><br>"
rs.movenext
loop
rs.close
set rs=nothing
end sub


'------------------------------------------------产品搜索---------------------------------------
sub search()
%>
  <form action="research.asp" method=post>
  <tr><td height=10></td></tr>
  <tr><td height=30>&nbsp;&nbsp;按分类:&nbsp;&nbsp;<SELECT NAME="gclass">

  <option value="">全部分类</option>
   <% dim rs
    set rs=conn.execute("select * from goods_sort order by sortorder")
	do while not rs.eof
    response.write"<option value="&rs("sid")&">"&rs("sortname")&"</option>"
	rs.movenext
	loop
   %>
  </SELECT></td></tr>
  <tr><td height=30>&nbsp;&nbsp;关键词:<INPUT TYPE="text" NAME="gkey" size=14></td></tr>
  <tr><td align=center height=40><INPUT TYPE="submit"></td></tr>
  </form>
<%
end sub

'------------------------------------------------推荐产品---------------------------------------
sub goods_com()
dim rs
set rs=conn.execute("select top 3 * from goods order by addtime desc")
do while not rs.eof
%>
<table border=0 width=390 cellspacing=0 cellpadding=0 align=center>
<tr><td width=120 height=120 background='pic/gpbg.gif' align=center>
<A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
<img src=<%=rs("goodspic")%> width=90 height=90 border=0></a></td>
<td width=270 valign=top><p style="margin-top:5;margin-bottom:3;margin-left:10;line-height:150%">
商品名称:<%=rs("goodsname")%><br>
<FONT COLOR="red">商品价格:<%=rs("price")%>&nbsp;元</FONT><br>
商品简介:<br>
<%=rs("goodsintro")%>
</p></td>
</tr> 
</table>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>

<SCRIPT>
marqueesHeight=120;
stopscroll=false;
with(icefable1){
	  style.width=0;
	  style.height=marqueesHeight;
	  style.overflowX="visible";
	  style.overflowY="hidden";
	  noWrap=true;
	  onmouseover=new Function("stopscroll=true");
	  onmouseout=new Function("stopscroll=false");
  }
  preTop=0; currentTop=120; stoptime=0;
  icefable1.innerHTML+=icefable1.innerHTML;
  

function init_srolltext(){
  icefable1.scrollTop=0;
  setInterval("scrollUp()",10);
}
init_srolltext();

function scrollUp(){
  if(stopscroll==true) return;
  currentTop+=1;
  if(currentTop==121)
  {
  	stoptime+=1;
  	currentTop-=1;
  	if(stoptime==300) 
  	{
  		currentTop=0;
  		stoptime=0;  		
  	}
  }
  else {  	
	  preTop=icefable1.scrollTop;
	  icefable1.scrollTop+=1;
	  if(preTop==icefable1.scrollTop){
	    icefable1.scrollTop=120;
	    icefable1.scrollTop+=1;
	    
	  }
  }

}
</SCRIPT>
<%
end sub

'----------------------------------------------新品上架----------------------------------------
sub new_goods()
dim rs,i,i_l,rs1
set rs=server.createobject("adodb.recordset")
rs.open "select top 4 * from goods order by addtime desc",conn,1,1
if rs.recordcount=1 or rs.recordcount=2 then
   i_l=1
else
   i_l=2
end if
%>
 <table border=0 width=590 cellspacing=0 cellpadding=0 align=center>
 <% for i=1 to i_l %>
 <tr>
   <td width=295>
     <% if rs.eof then
          response.write"&nbsp;"
	    else
     %>
           <table border=0 width=290 cellspacing=0 cellpadding=0 align=center>
	        <tr><td width=120 height=120><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
			<img src=<%=rs("goodspic")%> width=90 height=90 border=0></a></td>
			<td><p style="margin-top:3;margin-bottom:3;line-height:170%">
             商品名称:<%=rs("goodsname")%><br>
            <FONT COLOR="red">商品价格:<%=rs("price")%> 元</FONT><br>
			商品类别:<%
			set rs1=conn.execute("select sortname from goods_sort where sid="&rs("sid"))
			response.write rs1("sortname")
			rs1.close
			set rs1=nothing
			%><br><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
            <IMG SRC="pic/index_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></a>
            </p></td></tr>
	       </table>
     <% end if 
        if not rs.eof then
		 rs.movenext
		end if
     %>
   </td>
   <td width=295>
     <% if rs.eof then
          response.write"&nbsp;"
	    else
     %>
           <table border=0 width=290 cellspacing=0 cellpadding=0 align=center>
	        <tr><td width=120 height=120><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
			<img src=<%=rs("goodspic")%> width=90 height=90 border=0></a></td>
			<td><p style="margin-top:3;margin-bottom:3;line-height:170%">
             商品名称:<%=rs("goodsname")%><br>
            <FONT COLOR="red">商品价格:<%=rs("price")%> 元</FONT><br>
			商品类别:<%
			set rs1=conn.execute("select sortname from goods_sort where sid="&rs("sid"))
			response.write rs1("sortname")
			rs1.close
			set rs1=nothing
			%><br><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
            <IMG SRC="pic/index_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></a>
            </p></td></tr>
	       </table>
     <% end if 
        if not rs.eof then
		 rs.movenext
		end if
     %>
   </td>
 </tr>

 <% next %>
</table>
<%
end sub

'----------------------------------------------特价商品----------------------------------------
sub cheap_goods()
dim rs,i,i_l,rs1
set rs=server.createobject("adodb.recordset")
rs.open "select top 4 * from goods where ischeap=1 order by addtime desc",conn,1,1
if rs.recordcount=1 or rs.recordcount=2 then
   i_l=1
else
   i_l=2
end if
%>
 <table border=0 width=590 cellspacing=0 cellpadding=0 align=center>
 <% for i=1 to i_l %>
 <tr>
   <td width=295>
     <% if rs.eof then
          response.write"&nbsp;"
	    else
     %>
           <table border=0 width=290 cellspacing=0 cellpadding=0 align=center>
	        <tr><td width=120 height=120><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
			<img src=<%=rs("goodspic")%> width=90 height=90 border=0></A></td>
			<td><p style="margin-top:3;margin-bottom:3;line-height:170%">
             商品名称:<%=rs("goodsname")%><br>
            <FONT COLOR="red">商品价格:<%=rs("price")%> 元</FONT><br>
			商品类别:<%
			set rs1=conn.execute("select sortname from goods_sort where sid="&rs("sid"))
			response.write rs1("sortname")
			rs1.close
			set rs1=nothing
			%><br><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
            <IMG SRC="pic/index_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></a>
            </p></td></tr>
	       </table>
     <% end if 
        if not rs.eof then
		 rs.movenext
		end if
     %>
   </td>
   <td width=295>
     <% if rs.eof then
          response.write"&nbsp;"
	    else
     %>
           <table border=0 width=290 cellspacing=0 cellpadding=0 align=center>
	        <tr><td width=120 height=120><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
			<img src=<%=rs("goodspic")%> width=90 height=90 border=0></a></td>
			<td><p style="margin-top:3;margin-bottom:3;line-height:170%">
             商品名称:<%=rs("goodsname")%><br>
            <FONT COLOR="red">商品价格:<%=rs("price")%> 元</FONT><br>
			商品类别:<%
			set rs1=conn.execute("select sortname from goods_sort where sid="&rs("sid"))
			response.write rs1("sortname")
			rs1.close
			set rs1=nothing
			%><br><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
            <IMG SRC="pic/index_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></a>
            </p></td></tr>
	       </table>
     <% end if 
        if not rs.eof then
		 rs.movenext
		end if
     %>
   </td>
 </tr>

 <% next %>
</table>
<%
end sub

'-------------------------------------------------销售排行-------------------------------------
sub goods_ph()
dim rs,i
set rs=server.createobject("adodb.recordset")
rs.open "select top 6 * from goods order by salecount desc",conn,1,1

%>
<table border=0 width=600 cellspacing=0 cellpadding=0 align=center>
<tr>
<%
  for i=1 to 6
  if rs.eof then
    response.write"<td width=100>&nbsp;</td>"
  else
%>
  <td width=100 align=center><p style="margin-top:5;margin-bottom:8;line-height:120%">
   <A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
   <img src=<%=rs("goodspic")%> width=90 height=90 border=0></a><br>
   <%=rs("goodsname")%><br>
   <FONT COLOR="red">价格:<%=rs("price")%> 元</FONT><br><A HREF="my_cart.asp?id=<%=rs("id")%>&action=add">
   <IMG SRC="pic/index_cart.gif" WIDTH="76" HEIGHT="20" BORDER="0"></a>
   </p>
  </td>
<% 
   end if
   if not rs.eof then
     rs.movenext
   end if
   next
%>
</tr></table>
<%
end sub

'------------------------------------------------友情链接---------------------------------------
sub web_link()
 dim rs,rs1
 set rs=conn.execute("select * from link where ltype=1")
 do while not rs.eof
 %>
  
  <tr height=30><td width=169 align=center>
  <A HREF="<%=rs("url")%>" target=_blank title=<%=rs("webintro")%>><%=rs("webname")%></A>
  </td></tr>
<%
 rs.movenext
 loop
 rs.close
 set rs1=conn.execute("select * from link where ltype=2")
 do while not rs1.eof
 %>
  
  <tr height=50><td width=169 align=center>
  <A HREF="<%=rs1("url")%>" target=_blank>
  <img src='<%=rs1("imgurl")%>' width=100 height=40 border=0 alt=<%=rs1("webintro")%>></td></tr>
<%
 rs1.movenext
 loop
 rs1.close
end sub

'-----------------------------------------产品类别--------------------------------------------
sub gsort()
dim rs
set rs=conn.execute("select * from goods_sort")
do while not rs.eof
%>
<tr>
  <td onMouseOver="this.bgColor='#E3F4F0';" onMouseOut="this.bgColor='#ffffff';" height=24>
  &nbsp;<IMG SRC="pic/quan.gif" WIDTH="9" HEIGHT="9" BORDER="0">&nbsp;
  <A HREF="list.asp?sid=<%=rs("sid")%>"><%=rs("sortname")%></A>
  </td>
</tr>
<tr><td height=1 bgcolor="#cacaca"></td></tr>
<%
rs.movenext
loop
end sub


'-----------------------------------------字符串替换-------------------------------------------
function repl_str(str,strlen)
dim vstr
 if len(str)>strlen then
   vstr=left(str,strlen)&"..."
 else
   vstr=str
 end if
 repl_str=vstr
end function
'-----------------------------------------网站变量---------------------------------------------
function web_var(wvars,tt)
  dim wdim
  wdim=split(wvars,"|")
  web_var=wdim(tt-1)
end function



'------------------------------------------------网站尾部---------------------------------------
sub web_foot()
dim rs
set rs=conn.execute("select * from web_info")
%>
<table width="798" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width=1 bgcolor="#a5a5a5"></td>
<td width=780 style="border-top:1px #bab7b7 solid;border-bottom:1px #bab7b7 solid" align=center>
<%=rs("copyright")%>
<p style="margin-top:20;margin-bottom:10">
本网站由 <A HREF="http://www.evangen.com" target="_blank">易梵网络</A> 设计制作 技术支持QQ:419329710
</p>
</td>
<td width=17 background="pic/right_bg.gif"></td>
</tr></table>

</body></html>
<%
rs.close
set rs=nothing
end sub

%>

⌨️ 快捷键说明

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