<!--#include file="head.asp"-->
<style>body{background-color: #fff;}</style>


<%
'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


%>


<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">

                   
                                                     
            <!-------------------------------------- 开始 -------------------------------------->	
            <!--								
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">流量套餐</div>
            <div class="gexian20"></div>     
						<div class="neitable">
                        <table>

           		  		<tr class="hd">
                            <td>套餐ID</td> 
                            <td>套餐名称</td>
                            <td>套餐价格</td>
                            <td>套餐总流量/年</td>
                            <td>折合费率</td>
                            <td>有效期</td>
                            <td>购买</td>
                        </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='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td><%=rs("aytcid")%></td> 
                            <td><%=rs("aytcname")%></td>
                            <td><%=rs("aytcjin")%>元</td>
                            <td><%=rs("aytczong")%>元</td>
                            <td>
							<%
							zhehe=rs("aytcjin")/rs("aytczong")*100
							response.Write Formatnumber(zhehe,2,true,-1,0)&"%"
							%>
                            </td>
                            <td><%=rs("aytcsj")%>天<%=rs("aytcsj")%>天</td>
                            <td><a onClick="javascript:return confirm('您确定要购买此套餐吗？将从您的账户扣除相应套餐金额！');" href="?c=tc&tid=<%=rs("aytcid")%>" class="logindlreg2">购买</a></td>
                        </tr>
						<%
                        rs.movenext  
                        loop
						else%>
           		  		<tr onmouseover=this.bgColor='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td colspan="7">该类套餐未上架</td> 
                          </tr>
                        <%end if
                        rs.close%>
                        
                    </table>
                    </div>

                   
            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            说明：购买流量套餐 在套餐金额总流量内的交易 不在收取手续费。<br>
            例如购买套餐后发生100元的交易，商户会直接入账100元。直到套餐流量用完或到期。<br>
            注：套餐仅对PC端支付有效，WAP手机端支付不按套餐费率计算。
            </div>

			-->
            <!-------------------------------------- 结束 -------------------------------------->
                   
     
                   
            <!-------------------------------------- 开始 -------------------------------------->									
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">包年套餐</div>
			<div class="gexian20"></div>    
            <div class="neitable">
                        <table>
           		  		<tr class="hd">
                            <td>套餐ID </td>
                            <td>套餐名称</td>
                            <td>套餐价格</td>
                            <td>手续费</td>
                            <td>有效期</td>
                            <td>购买</td>
                        </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='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td><%=rs("aytcid")%> </td>
                            <td><%=rs("aytcname")%></td>
                            <td><%=rs("aytcjin")%>元</td>
                            <td><%=Formatnumber(rs("aytcyearf"),2,true,-1,0)%>%</td>
                            <td><%=rs("aytcsj")%>天</td>
                            <td><a onClick="javascript:return confirm('您确定要购买此套餐吗？将从您的账户扣除相应套餐金额！');" href="?c=tc&tid=<%=rs("aytcid")%>" class="logindlreg2">购买</a></td>
                        </tr>
						<%
                        rs.movenext  
                        loop
						else%>
           		  		<tr onmouseover=this.bgColor='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td colspan="7">该类套餐未上架</td> 
                          </tr>
                        <%end if
                        rs.close%>
                    </table>
 			</div>

            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            说明：购买包年套餐后，交易手续费按照套餐的手续费计算。<br>
            例如包年套餐的手续费为1.8%，发生100元的交易，商户会入账98.2元。<br>
            可以参考自己的交易额,选择更为合适的套餐。<br>
           
            </div>
            <!-------------------------------------- 结束 -------------------- 注：套餐仅对PC端支付有效，WAP手机端支付不按套餐费率计算。------------------>
            
            
          
            
           

        <div class="clearfix"></div>



</div>








</div>
</div>
</div>
</div>
</main>


<footer>
<div class="container">
</div>
</footer>

</body>
</html>