<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head()
call saycardd("扣除元宝")
%>


<%dim ids,TP,num
TP=Request("TP")
ids=Request("ids")

if TP<>"" then

'检查ID是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM users where id="&ids,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("ID不存在！")
end if
  rs.close
  set rs=Nothing

num=Request("num")

if num="" or IsNumeric(num)=False then
  Call Error("数量无效！")
end if

  conn.Execute("update Users set rmbcent=rmbcent-"&num&" Where id="&ids)

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")="系统管理员扣除您"&num&"元宝，如有疑问，请联系管理员！"
rs("sid")=ids
rs("fid")=0
rs.update
rs.close
set rs=nothing

 Response.Write ""&num&"元宝成功的从ID:"&ids&"的账户中扣除<br/>"
else
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
end if
 Response.Write "扣除对象》ID:"&ids&"<br/>"
 Response.Write "扣除数量》：<br/>"
  if saytk>1 then
 call xlanlj("deductcentrmb.asp?saytk="&saytk&"&amp;sid="&sid&"")
 Response.Write "<input name=""num"" format='*N' maxlength='10' value=""""/>"
  call xltjlj("tp","1")
  call xltjlj("ids",""&ids&"")
  call xlanlj1("确认扣除")
  else
 Response.Write "<input name=""num"&tt&""" format='*N' maxlength='10' value=""""/>"
 Response.Write "<br/><anchor>确认扣除"
 Response.Write "<go href=""deductcentrmb.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"" accept-charset=""utf-8"">"
 Response.Write "<postfield name=""num"" value=""$(num"&tt&")""/>"
 Response.Write "<postfield name=""ids"" value="""&ids&"""/>"
 Response.Write "<postfield name=""TP"" value=""1""/>"
 Response.Write "</go></anchor><br/>"
 end if
end if
conn.close
set conn=nothing
Response.write "<br/><a href=""show.asp?id="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">[用户信息]</a>"%>
<!--#include file="fanhui.asp"-->

<%
call headsay()
%>
