<!--#include virtual="/show/userhead.asp"-->

<script>document.getElementById('o_6').setAttribute("class", "ed"); document.getElementById("t_6").style.display="";document.getElementById('s_6_2').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />



<%
'call iszizhu()

Const stringmodarr = "0123456789"
dim randarr2,strlength
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 16 
randarr2 = randarr2&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
randarr =randarr2 & Right(("00" & Second(Now())),2)

c=SafeRequest("c")


if c="tc" then
tid=SafeRequest("tid")
if tid="" then call PopErr("参数有误")
sql="select * from aytaocan where aytcid="&tid&" and aytcisbuy=0" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then
call logadd(request.Cookies("aynameid"),"套餐购买信息有误",0,1)
call PopErr("套餐信息有误")
response.End()
else
aytczhiding=trim(rs("aytczhiding"))
aytcjin=rs("aytcjin")
aytcname=rs("aytcname")
aytcid=rs("aytcid")
aytczong=rs("aytczong")
aytcsj=rs("aytcsj")
aytcisyear=rs("aytcisyear")
aytcyearf=rs("aytcyearf")
end if
rs.close

sql="select * from ayname where aynameid="&request.Cookies("aynameid")&""
rs.open sql,conn,1,3

	if chkujb(rs("ayjibie"),aytczhiding)=false then
	call logadd(request.Cookies("aynameid"),"商家级别不支持购买套餐",0,1)
	call PopErr("您的商家级别暂不支持购买当前套餐")
	response.End()
	end if

	if ccur(rs("ayyue"))<ccur(aytcjin) then 
	call logadd(request.Cookies("aynameid"),"套餐购买余额不足",0,1)
	call PopErr2("账户余额不足，请先充值","/user/chong.asp?c=tc&tid="&tid)
	response.End()
	end if
fsyu=ccur(rs("ayyue"))-ccur(aytcjin)
if ccur(fsyu)<0 then fsyu=0
rs("ayyue")=fsyu
rs("ayxiaofei")=ccur(rs("ayxiaofei"))+ccur(aytcjin) 
rs.update
rs.close

sql="select * from aytaocanlog" 
rs.open sql,conn,1,3
rs.addnew
rs("aytcuid")=request.Cookies("aynameid")
rs("aytcname")=trim(aytcname)
rs("aytcjin")=trim(aytcjin)
rs("aytczong")=trim(aytczong)
rs("aytcsheng")=trim(aytczong)
rs("aytcsj")=trim(aytcsj)
rs("aytcisyear")=trim(aytcisyear)
rs("aytcyearf")=trim(aytcyearf)
rs("aytczhiding")=trim(aytczhiding)
rs.update
rs.close

conn.Execute("Insert Into "&request.Cookies("cwku")&"(aycaiwuleibie,aycaiwuuser,aycaiwudingdan,aycaiwudate,aycailiushui,aycaiwujine,aycaiwuyue,aycaiwuzhifu,aycwfsjin,aycwinjin,aycaiwubody,aycaiwuzt) values('5','"&request.Cookies("aynameid")&"','"&randarr&"','"&now()&"','"&randarr&"','"&Formatnumber(aytcjin,3,true,-1,0)&"','"&Formatnumber(fsyu,3,true,-1,0)&"','99','"&Formatnumber(aytcjin,3,true,-1,0)&"','"&Formatnumber(aytcjin,3,true,-1,0)&"','购买套餐-"&tid&"','1')")

call logadd(request.Cookies("aynameid"),"购买套餐成功"&left(tid,10),0,0)

call PopErr2("购买套餐操作成功","mytaocanc")

end if


%>
<br>
<DIV id=main2> 

<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>商户套餐</SPAN></H2>
<DIV class=main3>
  <table border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="?act=alldel&page=<%=page%>" method="post" name="myform" id="myform"> 
       <tr>
         <th colspan="7" align="center" class="border_right border_bottom" style="color: #FF6600" >
        流量套餐       </tr>
       <tr>
         <th align="center" class="border_right border_bottom" >套餐ID      
         <th align="center" class="border_right border_bottom">套餐名称                        
         <th align="center" class="border_right border_bottom">套餐价格                        
         <th align="center" class="border_right border_bottom">套餐总流量/年                         
         <th align="center" class="border_right border_bottom">折合费率                         
         <th align="center" class="border_right border_bottom">有效期         
         <th align="center" class="border_bottom">操作</tr>
<%
sql="select * from aytaocan where aytcisbuy=0 and aytcisyear=0 order by aytcid asc" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
do while not rs.eof%>

	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcid")%></td>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcname")%>		</td>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcjin")%>元</td>
        <td align="center" class="border_right border_bottom"><%=rs("aytczong")%>元</td>
        <td align="center" class="border_right border_bottom"><%
		zhehe=rs("aytcjin")/rs("aytczong")*100
		response.Write Formatnumber(zhehe,2,true,-1,0)&"%"
		%></td>
        <td align="center" class="border_right border_bottom"><%=rs("aytcsj")%>天</td>
        <td align="center" class="border_bottom"><a onClick="javascript:return confirm('您确定要购买此套餐吗？将从您的账户扣除相应套餐金额！');" href="?c=tc&tid=<%=rs("aytcid")%>">购买</a></td>
	    </tr>
<%
rs.movenext  
loop
end if
rs.close%>
	  

      <tr>
        <td colspan="7">
        <span style="color: #6666FF">
            说明：购买流量套餐 在套餐金额总流量内的交易 不在收取手续费。<br>
            例如购买套餐后发生100元的交易，商户会直接入账100元。直到套餐流量用完或到期。
        </span></td>
      </tr></form>
    </table>
	<br>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="?act=alldel&page=<%=page%>" method="post" name="myform" id="myform"> 
       <tr>
         <th colspan="6" align="center" class="border_right border_bottom" style="color: #FF6600" >
        包年套餐       </tr>
       <tr>
         <th align="center" class="border_right border_bottom" >套餐ID      
         <th align="center" class="border_right border_bottom">套餐名称                        
         <th align="center" class="border_right border_bottom">套餐价格                        
         <th align="center" class="border_right border_bottom">支付价值                         
         <th align="center" class="border_right border_bottom">有效期                         
         <th align="center" class="border_bottom">操作</tr>
<%
sql="select * from aytaocan where aytcisbuy=0 and aytcisyear=1 order by aytcid asc" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
do while not rs.eof%>

	  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcid")%></td>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcname")%>		</td>
        <td align="center" class="border_right border_bottom">
		<%=rs("aytcjin")%>元</td>
        <td align="center" class="border_right border_bottom"><%=Formatnumber(rs("aytcyearf"),2,true,-1,0)%>%</td>
        <td align="center" class="border_right border_bottom"><%=rs("aytcsj")%>天</td>
        <td align="center" class="border_bottom"><a onClick="javascript:return confirm('您确定要购买此套餐吗？将从您的账户扣除相应套餐金额！');" href="?c=tc&tid=<%=rs("aytcid")%>">购买</a></td>
	    </tr>
<%
rs.movenext  
loop
end if
rs.close%>
	  

      <tr>
        <td colspan="6">
        <span style="color: #6666FF">
            说明：购买包年套餐后，交易手续费按照套餐的手续费计算。<br>
            例如包年套餐的手续费为1.8%，发生100元的交易，商户会入账98.2元。<br>
            可以参考自己的交易额,选择更为合适的套餐。
        </span></td>
      </tr></form>
    </table>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>

<br>

	<!--#include virtual="/show/foot.asp"-->


