<%if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close();</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()';</SCRIPT>"
response.end
end if%>
<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"-->
<!--#include file="conn/config.asp"-->
<%
if nosql(request("act"))="vip"  then
vip=nosql(request.form("vip"))
if  isnumeric(int(vip)) and int(vip)>0 then
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open"select * from snsn_user where id="&session("id"),conn,1,3
if rs("jifen")>=vip*1000 then
rs("vip")=1
if isnull(rs("vipdate")) or rs("vipdate")=""  then
rs("vipdate")=dateadd("m",vip,now())
else
rs("vipdate")=dateadd("m",vip,rs("vipdate"))
end if
rs("jifen")=rs("jifen")-(vip*1000)
rs.update
session("jifen")=rs("jifen")
session("snsnvip")=rs("vip")
response.write "<script language=javascript>alert('恭喜你已成为VIP会员,本页将会关闭！');window.close();window.opener.location.reload();</script>"
else
response.write "<script language='javascript'>"
response.write "alert('您的银两不足,您可以通过预存款兑换银两！预存款可以在线冲值!');"
response.write"location.href='/sjvip.asp'</SCRIPT>"
end if
else
response.write "<script language='javascript'>"
response.write "alert('参数不正确，请联系管员！');"
response.write"location.href='/sjvip.asp'</SCRIPT>"
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>升级VIP-<%=webname%></title>

<style type="text/css">
<!--
.wenbenkuang {color: #333333;border: 1px solid #cccccc;font-family: "??";font-size: 9pt;}
.go-wenbenkuang {font-family: "??";font-size: 9pt;color: #333333;background-color: #eeeeee;cursor: hand;padding: 1px;height: 19px;border-top: 1px solid #FFFFFF;border-right: 1px solid #a2a2a2;border-bottom: 1px solid #a2a2a2;border-left: 1px solid #FFFFFF;}
.z12 {
	font-size: 12px;
}
.style1 {color: #FF0000}
-->
</style>
</head>

<body >
<%Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open"select * from snsn_user where id="&session("id"),conn,1,1
%>
<form name="form1" method="post" action="?act=vip">
  <table width="262"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="z12">
    <tr align="center" bgcolor="#FFFFFF">
      <td width="260" height="21" bgcolor="efefef"><strong>升级VIP</strong></td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21">升级VIP费用:1000两/月(银两不足可在线冲值)</td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21"><span class="style1">升级月数：</span>
        
        <select name="vip" class="wenbenkuang" id="vip" onchange="javascript:qian.innerHTML=form1.vip.options[vip.selectedIndex].value*1000+'两'">
          <option value="1" selected>一个月</option>
          <option value="2">二个月</option>
          <option value="3">三个月</option>
          <option value="4">四个月</option>
          <option value="5">五个月</option>
          <option value="6">六个月</option>
          <option value="7">七个月</option>
          <option value="8">八个月</option>
          <option value="9">九个月</option>
          <option value="10">十个月</option>
          <option value="12">一　年</option>
        </select>
费用：<font color="red" id=qian>1000两</font></td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21" bgcolor="#FFFFFF">银两：<span class="style12"><%=rs("jifen")%></span>&nbsp;预存款：<span class="style12"><%=rs("jine")%></span>元
        <input name="Submit222" type="button" class="go-wenbenkuang" onClick="window.open('/dueihuan.asp','dueihuan','scrollbars=no,resizable=no,width=280,height=140,menubar=no,top=188,left=188')" value="兑换银两"></td>
    </tr>
    <tr align="center" bgcolor="#FFFFFF">
      <td height="21"><input name="Submit" type="submit" class="go-wenbenkuang" onClick="return ck()" value="升级VIP">
        <input name="Submit22" type="button" class="go-wenbenkuang" onClick="javascript:window.open('/pay/pay.asp')" value="在线冲值">
        <input name="Submit2" type="button" class="go-wenbenkuang" onClick="window.close()" value="取消"></td>
    </tr>
  </table>
</form>

</body>
</html>
