<!--#include file="inc/conn.asp"--> 
<!--#include file=usercookies.asp-->
<!--#include file="inc/inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-会员管理中心-购买道具</title>
</head>
<body topmargin="0">
<%call t()%>
<%
dim i_1,i_2,i_3,i_4,hb,a_1,b_1,c_1,d_1,dhdj
dhdj=trim(request("dhdj"))
if request("hb")<>"" then
hb=trim(request("hb"))
end if
a=trim(request("a"))
b=trim(request("b"))
c=trim(request("c"))
d=trim(request("d"))
if a="" then
a=0
end if
if b="" then
b=0
end if
if c="" then
c=0
end if
if d="" then
d=0
end if
if request.cookies("a_1")="" then
Response.cookies("a_1")=0
else
Response.cookies("a_1")=int(request.cookies("a_1"))+int(a)
end if
if request.cookies("b_1")="" then
Response.cookies("b_1")=0
else
Response.cookies("b_1")=int(request.cookies("b_1"))+int(b)
end if
if request.cookies("c_1")="" then
Response.cookies("c_1")=0
else
Response.cookies("c_1")=int(request.cookies("c_1"))+int(c)
end if
if request.cookies("d_1")="" then
Response.cookies("d_1")=0
else
Response.cookies("d_1")=int(request.cookies("d_1"))+int(d)
end if
username=request.cookies("cnmai")("username")
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select hb from [jle_user] where username='"&username&"'" 
rs.open sql,conn,1,1
if request("cnmai")="1" then
hb=hb-(a*g_a+b*g_b+c*g_c+d*g_d)
else
Response.cookies("a_1")=0
Response.cookies("b_1")=0
Response.cookies("c_1")=0
Response.cookies("d_1")=0
hb=rs("hb")
end if
%>
<div align="center">
<table width="755" id="table1" bgcolor="#FFFFFF" style="border-left:1px solid #999999; border-right:1px solid #999999; padding:1px; border-top-width:1px; border-bottom-width:1px" cellspacing="1">
<tr>
<td width="158" height="25" class=td1>
<p align="center">会员管理系统</td>
<td width="1" height="170" rowspan="2">　</td>
<td width="594" height="25" class=td1>
<p align="center">会员管理中心</font>-兑换道具</td>
</tr>
<tr>
<td width="157" height="144" bgcolor="#F6F6F6" valign="top"><!--#include file=userleft.asp--></td>
<td valign="top" bgcolor="#F6F6F6">
<%if dhdj="" then%>
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="575" height="25" colspan="6" bgcolor="#FFEEDF">
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">&nbsp; 当前我的虚拟货币：<%=rs("hb")%> 
元，兑换道具需要你有足够的虚拟货币才可以，如果没有用以下两种方式获得:</p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">&nbsp; ①<font color="#FF0000">1天1元,包月30元,联系本站申请为VIP会员即可享受无限发布</font></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">&nbsp; 
②登陆本站/发布信息获得积分→积分转换成虚拟货币→虚拟货币兑换道具→用道具发布您的个性信息</td>
</tr>
<tr>
<td width="575" height="25" class=td4 colspan="6">
<p align="left">&nbsp;&nbsp; 兑换道具</td>
</tr>
<tr>
<td height="25" align="left" width="54">
<p align="right"><img src="image/point05.gif" width="9" height="12"></td>
<td width="115" height="25" align="left">
兑换<font color="#0000FF">标题变色</font>道具</td>
<td width="166" height="25" align="left" colspan="2">
<select name="a" onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value="?">请选择兑换的数量</option>
<%
i_1=hb/g_a
for i=1 to int(i_1)
%>
<option value="?a=<%=i%>&cnmai=1&hb=<%=hb%>&a_1=<%=a_1%>"><%=i%>个</option>
<%next%>
</select>
</td>
<td width="150" height="25" align="right"><font color="#0000FF"><%=g_a%></font> 
元（虚拟货币）/个</td>
<td width="90" height="25" align="left">　</td>
</tr>
<tr>
<td height="25" align="left" width="54">
<p align="right"><img src="image/point05.gif"></td>
<td width="115" height="25" align="left">
兑换<font color="#0000FF">信息置顶</font>道具</td>
<td width="166" height="25" align="left" colspan="2">
<select name="b" onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value="?">请选择兑换的数量</option>
<%
			i_2=hb/g_b
			for i=1 to int(i_2)
			%>
<option value="?b=<%=i%>&cnmai=1&hb=<%=hb%>&b_1=<%=b_1%>"><%=i%>个</option>
<%next%>
</select>
</td>
<td width="150" height="25" align="right">
<font color="#0000FF"><%=g_b%></font> 元（虚拟货币）/个</td>
<td width="90" height="25" align="left">
　</td>
</tr>
<tr>
<td height="25" align="left" width="54">
<p align="right"><img src="image/point05.gif"></td>
<td width="115" height="25" align="left">
兑换<font color="#0000FF">内容贴图</font>道具</td>
<td width="166" height="25" align="left" colspan="2">
<select name="c" onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value="?">请选择兑换的数量</option>
<%
			i_3=hb/g_c
			for i=1 to int(i_3)
			%>
<option value="?c=<%=i%>&cnmai=1&hb=<%=hb%>&c_1=<%=c_1%>"><%=i%>个</option>
<%next%>
</select></td>
<td width="150" height="25" align="right">
<font color="#0000FF"><%=g_c%></font> 元（虚拟货币）/个</td>
<td width="90" height="25" align="left">
　
</td>
</tr>
<tr>
<td height="25" align="left" width="54">
<p align="right"><img src="image/point05.gif"></td>
<td width="115" height="25" align="left">
兑换<font color="#0000FF">通过验证</font>道具</td>
<td width="166" height="25" align="left" colspan="2">
<select name="d" onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value="?">请选择兑换的数量</option>
<%
			i_4=hb/g_d
			for i=1 to int(i_4)
			%>
<option value="?d=<%=i%>&cnmai=1&hb=<%=hb%>&d_1=<%=d_1%>"><%=i%>个</option>
<%next%>
</select></td>
<td width="150" height="25" align="right">
<font color="#0000FF"><%=g_d%></font> 元（虚拟货币）/个</td>
<td width="90" height="25" align="left">
　</td>
</tr>
<tr>
<td width="575" height="25" colspan="6">&nbsp; 当前我可以消费的虚拟货币为：<%=hb%> 元</td>
</tr>
<tr>
<td width="54" height="25" class="td4">
<p align="right"><img src="image/point05.gif"></td>
<td width="115" height="25" class="td4"><font color="#FF0000">当前
兑换的道具</font></td>
<td width="166" height="25" colspan="2" class="td4">
<p align="center"><img src="image/point05.gif"><a href="u_dhdj.asp"><font color="#0000FF">重新兑换</font></a></td>
<td width="240" height="25" colspan="2" class="td4">　</td>
</tr>
<form action="u_dhdj.asp" method="POST">
<tr>
<td width="54" height="25">　</td>
<td width="115" height="25">标题道具</td>
<td width="54" height="25" align="right" ><%=request.cookies("a_1")%><input type="hidden" name="a" size="6" value="<%=request.cookies("a_1")%>">　</td>
<td width="112" height="25" >&nbsp;个</td>
<td width="240" height="25" colspan="2">　</td>
</tr>
<tr>
<td width="54" height="25">　</td>
<td width="115" height="25">信息置顶</td>
<td width="54" height="25" align="right"><%=request.cookies("b_1")%><input type="hidden" name="b" size="6" value="<%=request.cookies("b_1")%>">　</td>
<td width="112" height="25">&nbsp;个</td>
<td width="240" height="25" colspan="2">　</td>
</tr>
<tr>
<td width="54" height="25">　</td>
<td width="115" height="25">内容贴图</td>
<td width="54" height="25" align="right"><%=request.cookies("c_1")%><input type="hidden" name="c" size="6" value="<%=request.cookies("c_1")%>">　</td>
<td width="112" height="25">&nbsp;个</td>
<td width="240" height="25" colspan="2">
<input type="submit" value="确定兑换" name="dhdj"></td>
</tr>
<tr>
<td width="54" height="25" style="border-bottom-style: solid; border-bottom-width: 1" bordercolor="#CCCCCC">　</td>
<td width="115" height="25" style="border-bottom-style: solid; border-bottom-width: 1" bordercolor="#CCCCCC">通过验证</td>
<td width="54" height="25" style="border-bottom-style: solid; border-bottom-width: 1" bordercolor="#CCCCCC" align="right"><%=request.cookies("d_1")%><input type="hidden" name="d" size="6" value="<%=request.cookies("d_1")%>">　</td>
<td width="112" height="25" style="border-bottom-style: solid; border-bottom-width: 1" bordercolor="#CCCCCC">&nbsp;个</td>
<td width="240" height="25" colspan="2" style="border-bottom-style: solid; border-bottom-width: 1" bordercolor="#CCCCCC">　</td>
</tr>
<tr>
<td width="575" height="25" style="border-top-style: solid; border-top-width: 1" colspan="6">
<font color="#FF0000">&nbsp; 注意：在该页兑换道具时不要重复刷新页面，否则会导致兑换道具的数量混乱，且支付会不成功。</font></td>
</tr>
</form>
</table>
<%else
dim hb_all
if request("a")="" or request("b")="" or request("c")="" or request("d")="" then
response.write "<li>参数错误！"
response.write "<meta http-equiv=refresh content=""1;URL=u_dhdj.asp"">"
response.end
end if
username=request.cookies("cnmai")("username")
hb_all=a*g_a+b*g_b+c*g_c+d*g_d
set rs=server.createobject("adodb.recordset")
sql = "select hb,jf,a,b,c,d from [jle_user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs("hb")<hb_all then
response.write "<li>你的虚拟货币太少，无法购买这么多道具！"
response.write "<meta http-equiv=refresh content=""2;URL=u_dhdj.asp"">"
response.end
else
rs("hb")=int(rs("hb")-hb_all)
rs("a")=rs("a")+int(a)
rs("b")=rs("b")+int(b)
rs("c")=rs("c")+int(c)
rs("d")=rs("d")+int(d)
rs("jf")=int(rs("jf")+hb_all/jf_4)
rs.update
end if
response.write "<li>购买道具成功，你的积分同时增加！"
response.write "<meta http-equiv=refresh content=""2;URL=user.asp"">"
end if%></td>
</tr>
</table>
</div><!--#include file="foot.asp"-->
</body>
</html>
<%
rs.close
set rs=nothing
closedb
%>