<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<LINK 
href="img/code43.css" type=text/css rel=stylesheet>
<%
select case FormatSQL(SafeRequest("action",0))

case "vipscore"
vipscore

case "uptovip"
uptovip

case "chgscore"
chgscore

end select

sub vipscore
%>
<title><%=webname%>--VIP会员资格和推荐会员奖励</title>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select webimg11,webimg13,webimg14 from config",conn,1,1
%> 
<TABLE class=table-xia height=1 align="center" cellSpacing=0 cellPadding=0 width="100%" border=0>
      <TBODY>
        <TR><TD></TD></TR></TBODY></TABLE>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=table-zuoyou>
  <tr> 
    <td HEIGHT="20" align="center" class=table-xia bgcolor="<% = bgclr1 %>"><b>VIP会员资格和推荐会员奖励</b></td>
  </tr>
  <tr height="120"> 
    <td valign="top" class=table-xia><br>
      &nbsp;推荐一个会员奖励积分：  <font color="red"><%=trim(rs("webimg13"))%></font>&nbsp;分 <br>
	  &nbsp;VIP会员享受的服务：<%=trim(rs("webimg11"))%></td>
  </tr>
</table>
<%rs.close
set rs=nothing
conn.close
set conn = nothing
end sub

sub chgscore
dim strdeposit,strscore,strchg
if not isnumeric(request.form("strchg")) then
response.Write "<script language=javascript>alert('要转换的积分必须用数字表示，请正确操作！');history.go(-1);</script>"
conn.close
set conn = nothing
response.end
end if
strchg=ABS(CLng(request.form("strchg")))

set rs=server.CreateObject("adodb.recordset")
rs.open "select score,deposit from [user] where username='"&strUserName&"' ",conn,1,3
strscore=CLng(rs("score"))
strdeposit=rs("deposit")
if strchg>strscore then
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('你的积分不够！');history.go(-1);</script>"
response.End
else
rs("deposit")=strdeposit+strchg*webbj6
rs("score")=strscore-strchg
rs.update
rs.close
set rs=nothing
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('积分转预存款成功！');history.go(-1);</script>"
response.End
end if
end sub
%> 
