basket.asp

来自「国内第一数字点卡销售程序。功能强大。 完整无错!数据文件经MD5加密!经严格测」· ASP 代码 · 共 313 行

ASP
313
字号
<!--#include file="top.asp"-->
<html>

<body topmargin="0">



<SCRIPT language="javascript">
<!--
function del_space(s)
{
	for(i=0;i<s.length;++i)
	{
	 if(s.charAt(i)!=" ")
		break;
	}

	for(j=s.length-1;j>=0;--j)
	{
	 if(s.charAt(j)!=" ")
		break;
	}

	return s.substring(i,++j);
}

function VerifySubmit()
{
	sub_to = del_space(document.all("sub_to").value);
     if (sub_to.length == 0)
     {
        alert("您忘了填写姓名!");
	return false;
     }
	 
	 sub_to = del_space(document.all("sub_to").value);
     if (sub_to.length < 2)
     {
        alert("用户名不能小于1个汉字!");
	return false;
     }

	sub_tel = del_space(document.all("sub_tel").value);
     if (sub_tel.length == 0)
     {
        alert("您忘了填电话了!");
	return false;
     }

	sub_mail = del_space(document.all("sub_mail").value);
     if (sub_mail.length == 0)
     {
        alert("您忘了填 Email!");
	return false;
     }
	 
	sub_mail = del_space(document.all("sub_mail").value);
     if (sub_mail.indexOf("@")==-1)
     {
        alert("Email 输入有误!");
	return false;
     }
	 
	return true;
}
//-->
</SCRIPT>
<center>
<td width="15" height="3">&nbsp;</td><!--#include file="lest.asp"--></td>
  <td width="15" height="30">&nbsp;</td>
<td width="660" valign="top" align="center">
<% 
    if isNumeric(trim(request("count"))) then
       count=int(trim(request("count")))
    else
       count=1
    end if
    
if trim(request("hw_id"))="" then
    response.write "没有此商品"
    response.end
end if %>
<%     hw_id = trim(request("hw_id"))
    if not isNumeric (hw_id) then
        response.write "参数必须为数字型!"
        response.end
    end if
    sql="select * from hw where hw_id="&int(hw_id)

 set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3

if session("user_name")<>"" then%>
<%vip=session("user_vip")
select case vip
    case "普通会员"
      h2=rs("hw_cash1")
    case "VIP会员"
      h2=rs("hw_cash2")
    case "经销商会员"
      h2=rs("hw_cash3")     
   end select
%> 
<%else%>
<%h2=rs("hw_cash1")%>
<%end if%>
<div align="center">
	<table border="0" width="700" cellspacing="0" cellpadding="0" height="100">
		<tr>
			<td height="91">
			<div align="center">
			<form method="POST" action="basket.asp?action=buy&amp;hw_id=<%=rs("hw_id")%>">
				<table border="1" width="100%" cellspacing="0" cellpadding="0" height="73" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
					<tr>
						<td height="25" bgcolor="#FFFFFF">
						<p align="center">
						<font color="#FFFFFF" style="font-size: 10.5pt"><b>

<BR>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center bgColor=#ffffff border=0>
<FORM name=form2 action=user_d.asp method=post>
<TBODY>
<TR>
<TD align=middle width="50%"><A href="picture/<%=rs("hw_pic")%>"><BR><img border="1" src="picture/<%=rs("hw_pic")%>" width="170" height="120"


&nbsp;</A><BR><BR><A href="http://gj153.anyp.cn/Editor/images/pic/200548119975014.jpg" target=_blank></A><BR></TD>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD height=25>商品名称:</font></b><%=rs("hw_name")%>
[
<%typp=rs("hw_cz")
select case typp
    case 0
      hh="在线取卡"
    case 1
      hh="充值商品"    
   end select
%> 
<font color="#008000"><%=hh%></font>
]</TD></TR>
<TR>
<TD height=25>库存状态:<font color="#FF6600"><% set rs1=server.createobject("adodb.recordset")
  sql1="select * from tingcardnum  where hw_id ="&rs("hw_id")&" and hw_ok=true"
  rs1.open sql1,conn,3,3
  if rs1.eof then
    kucun=0
  else
    kucun=rs1.recordcount
  end if
      rs1.close
      %><%if rs("hw_cz")="1" then%><b>可以充值<%elseif kucun>0 then%>库存充足<%else%>库存不足<%end if%></font></TD></TR>
<TR>
<TD height=25>市场价:¥<%=rs("hw_cash")%>元</TD></TR>
<TR>
<TD height=25>优惠价:¥<%=h2%>元</TD></TR>
<TR>
<TD height=25>立刻节省:<%=round(count*(rs("hw_cash")-h2),2)%></font>元</TD></TR>
<TR>
<TD height=25>选择数量:<input type="text" name="count" size="5" class="input" value="<%=count%>">&nbsp; <input type="submit" value="修改数量" name="B1"></TD></TR>
<TR>
<TD height=25></TD></TR></TBODY></TABLE></TD></TR></TBODY></FORM></TABLE><% set rs1=server.createobject("adodb.recordset")


								
  sql1="select * from tingcardnum  where hw_id ="&rs("hw_id")&" and hw_ok=true"
  rs1.open sql1,conn,3,3
  if rs1.eof then
    kucun=0
  else
    kucun=rs1.recordcount
  end if
      rs1.close  %></table>


			</div></form>
			</td>
		</tr>
		<tr>
			<td>
			
			<form method="POST" action="saveto.asp"  name="Form1" onSubmit="return VerifySubmit()">
			<div align="center">
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#C5C5C5" bordercolordark="#FFFFFF">
<tr>
<td width="93%" colspan="4" height="25" bgcolor="#FFFFFF">
<p align="center"><font color="#FFFFFF" style="font-size: 10.5pt"><b>
<TABLE cellSpacing=0 cellPadding=0 width=500 border=0>
<TBODY>
<TR>
<TD width=172>
<P><IMG height=35 src="tupian/xdd7.jpg" width=180 border=0></P></TD>
<TD width=400 background=tupian/xdd8.jpg>
<P>&nbsp;</P></TD></TR></TBODY></TABLE></b></font></td>
<input type="hidden" name="hw_id" size="23" class="input" value="<%=hw_id%>">
<input type="hidden" name="count" size="23" class="input" value="<%=count%>">
<input type="hidden" name="kucun" size="23" class="input" value="<%=kucun%>">    
</tr>
<%if session("user_name")<>"" then%>  
<% 
sql1="select * from [user] where user_name='"&session("user_name")&"'"  
 rs1.open sql1,conn,3,3 
  %>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15">姓名:</td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_to" size="15" class="input" value="<%=rs1("user_namec")%>"></td>
<td width="21%" height="15" align="right" style="padding:5px; ">电话:</td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_tel" size="17" class="input" value="<%=rs1("user_tel")%>"></td>
</tr>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15">
<font face="Arial">E-mail:</font></td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_mail" size="15" class="input" value="<%=rs1("user_mail")%>"></td>
<td width="21%" height="15" align="right" style="padding:5px; "><font face="Arial">Q  Q:</font></td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_qq" size="17" class="input" value="<%=rs1("user_qq")%>"></td>
</tr>
<%rs1.close%> 

<%else%>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15">&nbsp;姓名:</td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_to" size="15" class="input"></td>
<td width="21%" height="15" align="right" style="padding:5px; ">电话:</td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_tel" size="17" class="input"></td>
</tr>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15"><font face="Arial">E-mail:</font></td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_mail" size="15" class="input"></td>
<td width="21%" height="15" align="right" style="padding:5px; "><font face="Arial">Q  Q:</font></td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_qq" size="17" class="input"></td>
</tr>
<% end if %>
<%if rs("hw_cz")="1" then%>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15">游戏帐户名:</td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_gameid" size="15" class="input"></td>
<td width="21%" height="15" align="right" style="padding:5px; ">确认游戏帐户名:</td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_gameid1" size="17" class="input"></td>
</tr>
<tr>
<td width="18%" style="padding:5px; " align="right" height="15">服务器所在区:</td>
<td width="21%" height="15" style="padding:5px; ">&nbsp;<input type="text" name="sub_gameaddr" size="15" class="input"></td>
<td width="21%" height="15" align="right" style="padding:5px; ">备注:</td>
<td width="33%" height="15" style="padding:5px; ">
<input type="text" name="sub_other" size="23" class="input"><br>
<font color="#FF6600">请注明按点/月或其他充值方式</font></td>
</tr>
<%end if%>
</table>
</div>
<p align="center">
<INPUT class="cont" type="submit" value="确定购买" name="submit"> </p>
</form>

			</td>
		</tr>
		<tr>
			<td>
			
			
			
			<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#DFE3E0" bordercolordark="#FFFFFF">
				<tr>
					<td height="20" bgcolor="#EFEFEF">
					<img border="0" src="images/help4.gif" width="16" height="14"><font color="#FF6600"><b>商品介绍:</b></font></td>
				</tr>
				<tr>
					<td height="62"><%=rs("hw_content")%></td>
				</tr>
				<tr>
					<td height="18" bgcolor="#EFEFEF">
					<img border="0" src="images/help4.gif" width="16" height="14"><font color="#FF6600"><b>官方网址:</b></font></td>
				</tr>
				<tr>
					<td  height="37"><a href="<%=rs("hw_hostweb")%>" target=_blank><%=rs("hw_hostweb")%></a>  </td>
				</tr>
				<tr>
					<td bgcolor="#EFEFEF" height="21">
					<img border="0" src="images/help4.gif" width="16" height="14"><font color="#FF6600"><b>下载网址:</b></font></td>
				</tr>
				<tr>
					<td height="30"><a href="<%=rs("hw_downweb")%>" target=_blank><%=rs("hw_downweb")%></a></td>
				</tr>
				<tr>
					<td bgcolor="#EFEFEF" height="22">
					<img border="0" src="images/help4.gif" width="16" height="14"><font color="#FF6600"><b>在线客服:</b></font></td>
				</tr>
				<tr>
					<td height="30"><%=rs("hw_service")%>&nbsp; </td>
				</tr>
			</table>
			
			
			
			</td>
		</tr>
	</table>
</div>
</td>
		<td width="1"  background="images/line.jpg"></td>
</tr> 
<%rs.close
%>
</table>
<!--#include file="copy.asp"-->

⌨️ 快捷键说明

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