﻿<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->
<%'============================================================
' Copyright 2007-09 燃点真情. All Rights Reserved.
' Last Update: 2008-3-22  13:28
' ADD:wap.nowtx.cn
' E-Mail: xivn@163.com  QQ:531233814
' WAP源码之家-手机:http://wapvy.cn电脑:http://www.wapvy.cn
'============================================================
%>
<%Call Head()

if myid=0 then
Response.write "<card title=""购买""><p>"
Response.write "<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","o="),"sid=","o=")&"'>请您先登陆...</a>"& chr(13)
  Response.write "<br/><anchor><prev/>返回</anchor>" & chr(13)
  Response.write "</p></card></wml>"
  Response.end
end if
id=usb(request("id"))
if id="" or IsNumeric(id)=False then
  Call Error("<card title=""购买""><p>ID无效！")
end if
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open "Select * from class where classid="&id,conn,1,2
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("<card title=""购买""><p>不存在的栏目！")
end if
if abs(int(myjb)) < rs("cent") then
  rs.close
  set rs=Nothing
  Call Error("<card title=""购买""><p>你的"&getcent&"不够！")
end if

if Instr(","&rs("payID")&",",","&myid&",") = 0 then
  if rs("payID") <> "" then
   rs("payID") = rs("payID")&","&myid
  else
   rs("payID") = myid
  end if
  rs.update
conn.Execute("update Users set myjb=myjb-"&abs(int(rs("cent")))&" Where id="&myid)
end if

Rs.close
set rs=nothing
conn.close
set conn=Nothing
response.write "<card title=""购买"" ontimer=""class.asp?class="&id&"&amp;sid="&sid&""">"
response.write "<timer value=""20""/><p>"
%>
购买成功,正在返回..<br/>
<a href="class.asp?class=<%=id%>&amp;sid=<%=sid%>">[返回上级]</a><br/>
</p>
</card>
</wml>