<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canmodkefu")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseIf request("Submit")="删除" and session("candelkefu")="" Then
	ef=True
	ec="您没有此操作的权限。"
'ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("kefu")) Then
'	ef=True
'	ec="客服人员名！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dskefu = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_KeFu where kefumd5='"&md5(trim(request("kefu")))&"'"
'	Sql="Select * from FreeHost.FreeHost_KeFu where kefu='"&request("kefu")&"'"
	dskefu.Open Sql,conn,1,3
if trim(request("kefu"))<>"" and (request("Submit")="新增/修改" or  request("Submit")="改名") then
if dskefu.Eof then
dskefu.addnew
dskefu("addtime")=now
end if

dskefu("kefu")=trim(request("kefu"))
dskefu("kefumd5")=md5(trim(request("kefu")))
if request("per")<>"" then dskefu("per")=request("per")*100
if request("havegetmoney")<>"" then dskefu("havegetmoney")=request("havegetmoney")

if request("Submit")="改名" and trim(request("kefunew"))<>"" then
dskefu("kefu")=trim(request("kefunew"))
dskefu("kefumd5")=md5(trim(request("kefunew")))

conn.Execute "update FreeHost.FreeHost_Product_Host set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_Email set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_SQL set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_Other set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_IDC set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_domain set kefu='"&Request("kefunew")&"' where kefu='"&Request("kefu")&"'"

conn.Execute "update FreeHost.FreeHost_USER set kefunow='"&Request("kefunew")&"' where kefunow='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Agent set kefunow='"&Request("kefunew")&"' where kefunow='"&Request("kefu")&"'"

end if



dskefu.update
'end if
dskefu.close

end if


if trim(request("kefu"))<>"" and request("Submit")="删除" then

Set dskefu = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_KeFu where kefumd5='"&md5(trim(request("kefu")))&"'"
	dskefu.Open Sql,conn,1,1
if not dskefu.eof then
conn.Execute "delete FreeHost.FreeHost_KeFu where kefumd5='"&md5(trim(request("kefu")))&"'"
conn.Execute "update FreeHost.FreeHost_Product_Host set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_Email set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_SQL set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_Other set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_IDC set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Product_domain set kefu=null where kefu='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_USER set kefunow=null where kefunow='"&Request("kefu")&"'"
conn.Execute "update FreeHost.FreeHost_Agent set kefunow=null where kefunow='"&Request("kefu")&"'"
end if
end if


Response.Redirect "admkefu.asp"
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if

%>


