<!-- #include file="conn.asp" -->
<!-- #include file="inc.asp" -->
<%
Call Check_Session("Tch")
if request.Form("action")="buy" then
color_num=Cint(Trim(Request.Form("color_num")))
top_num=Cint(Trim(Request.Form("top_num")))
index_num=Cint(Trim(Request.Form("index_num")))
jjb=color_num*80 + top_num*120 + index_num*160
set rs=server.createobject("ADODB.Recordset")
sql="select * from teacher where jjb>="&jjb&" and id="&makeid("tch","in",Session("Tch_ID"))
rs.open sql,conn,1,3
if rs.eof and rs.bof then 
response.write"<SCRIPT language=JavaScript>alert('家教币不足啦！努力挣钱去 ^-^');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.write.end
end if
rs("color_num")=rs("color_num") + color_num
rs("top_num")=rs("top_num") + top_num
rs("index_num")=rs("index_num") + index_num
rs("jjb")=rs("jjb") - jjb
rs.update
response.write"<SCRIPT language=JavaScript>alert('\n       购买成功! \n\n     您花掉了 "&jjb&" B!\n\n您成功购买变色道具 "&color_num&" 个\n\n您成功购买置顶道具 "&top_num&" 个\n\n您成功购买首页道具 "&index_num&" 个');"
response.write"this.location.href='tch_mod.asp';</SCRIPT>"
response.write.end
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
%>
<html>
<head>
<title>购买道具</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<BODY LEFTMARGIN=0 TOPMARGIN=10 MARGINWIDTH=0 MARGINHEIGHT=0><div align="center">
<!-- #include file="head.asp" -->
    <table width="778" height="30" border="0" cellpadding="0" cellspacing="0" bgcolor="FBFCED">
      <tr>
        <td height="30" valign="bottom">&nbsp;&nbsp;&nbsp;<strong>当前位置</strong>：【<a href="http://www.whjiajiao.com" title="www.whjiajiao.com"><font color=red><b>武汉家教网</b></font></a>】 → <a href="index.asp">首页</a> → 道具店</td>
      </tr>
      <tr>
        <td align="center" valign="bottom"><img src="IMAGES/line.gif" width="730" height="2"></td>
      </tr>
    </table>
    <TABLE WIDTH=778 BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="FBFCED">
  <TR>
    <TD align="center">
      <br>
	<table width="660"  border="1" cellpadding="5" cellspacing="0" borderColorLight=#cccccc borderColorDark=#ffffff bgcolor="#eeeeee">
      <form name="pro" method="post" action="">
      <tr align="center">
      <td colspan="2" class="font_blue_b">购 买 道 具</td>
    </tr><tr> 
      <td width="25%" align="right">变色道具<span class="font12_red">(价格 80B/个)</span> </td>
        <td bgcolor="#FFFFFF">
		购买&nbsp;
		<input name="color_num" type="text" value="0" size="2" maxlength="2" onKeyUp="value=value.replace(/\D+/g,'')">
		个 <span class="font12_red">（每个变色道具有效时间为3天） </span></td>
      </tr>
	  <tr>
      <td align="right">置顶道具<span class="font12_red">(价格120B/个)</span> </td>
      <td bgcolor="#FFFFFF"> 
          购买&nbsp;&nbsp;<input name="top_num" type="text" value="0" size="2" maxlength="2" onKeyUp="value=value.replace(/\D+/g,'')">
          个 <span class="font12_red">（每次使用置顶道具有效时间为3天/次） </span></td>
    </tr>
	  <tr> 
      <td align="right">首页道具<span class="font12_red">(价格160B/个)</span> </td>
        <td bgcolor="#FFFFFF">
          购买&nbsp;&nbsp;<input name="index_num" type="text" value="0" size="2" maxlength="2" onKeyUp="value=value.replace(/\D+/g,'')">
          个  <span class="font12_red">（每个首页道具有效时间为1天） </span> </td>
      </tr>
	  <td align="right">共计：</td>
        <td bgcolor="#FFFFFF">          <INPUT name=Reset2 type=button value=计算 class="input2" onClick="javascript:(document.pro.all.value=document.pro.color_num.value*80 + document.pro.top_num.value*120 + document.pro.index_num.value*160)">          
          
          <input name="all" type="text" value="0" size="6" maxlength="2" style="color:blue">
          B</td>
      </tr>
	  <tr align="center">
      <td height="11" colspan="2">
	  <INPUT class="input3" name=B1 type="submit" onclick="{if(confirm('确定购买吗？')){return true;}return false;}" value="提 交">
	  <INPUT name=action type=hidden value="buy">
<INPUT name=Reset type=reset value=重新填写 class="input2">
      </td>
    </tr></form>
  </table>
      <br></TD>
  </TR>
</TABLE>
<!-- #include file="foot.asp" -->
</div>
</body>
</html>
