<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->

<%call head()
call saycardd("编辑帖子道具")


%>

<%
dim ID,action
ID=request("ID")
action=request("action")
if ID="" or IsNumeric(ID)=False then
  Call Error("版块ID无效！")
  end if
if action="edit" then
call edit()
elseif action="del" then
call del()
else 
call show
end if
sub edit()
nam=request("nam")
tou=request("tou")
cen=request("cen")
if nam="" or tou="" or cen="" then
call error("各项都不能为空!")
end if

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from xundj where ID="&id,conn,1,2
if rs.eof then
  Call Error("不存在的记录！")
  end if
  rs("name")=nam
  rs("tou")=tou
  rs("cent")=cen
  rs.update()
  rs.close
  set rs=nothing
  response.write"修改成功!"
  end sub
sub del()
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from xundj where ID="&id,conn,1,2
if rs.eof then
  Call Error("不存在的记录！")
  end if
  rs.delete
  rs.update()
  rs.close
  set rs=nothing
  response.write"删除成功!"
  end sub
sub show()
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from xundj where ID="&id,conn,1,1
if rs.eof then
  Call Error("不存在的帖子道具！")
  end if
nam=rs("name")
tou=rs("tou")
cen=rs("cent")
rs.close
set rs=nothing
response.write"帖子道具名称<br/>"
if saytk>1 then
call xlanlj("admineditxxxdj.asp?action=edit&amp;ID="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&"")
response.write"<input name='nam' value='"&nam&"' title='名称'/><br/>"
response.write"文件地址:<br/><input name='tou' value='"&tou&"' emptyok='false'/><br/>"
response.write"购买价格:<br/>"
response.write"<input name='cen' value='"&cen&"' title='价格'/><br/>"
call xltjlj("tp","1")
call xlanlj1("确定提交")
else
response.write"<input name='nam"&tt&"' value='"&nam&"' title='名称'/><br/>"
response.write"文件地址:<br/><input name='tou"&tt&"' value='"&tou&"' emptyok='false'/><br/>"
response.write"购买价格:<br/>"
response.write"<input name='cen"&tt&"' value='"&cen&"' title='价格'/><br/>"
response.write"<anchor>[确定提交]<go href='admineditxxxdj.asp?action=edit&amp;ID="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&"' method='post' accept-charset='utf-8'>"
response.write"<postfield name='nam' value='$(nam"&tt&")'/>"
response.write"<postfield name='tou' value='$(tou"&tt&")'/>"
response.write"<postfield name='cen' value='$(cen"&tt&")'/>"
response.write"<postfield name='TP' value='1'/>"
response.write"</go></anchor><br/>"
end if
response.write"<a href=""admineditxxxdj.asp?action=del&amp;id="&id&"&amp;saytk="&saytk&"&amp;sid="&sid&""">[删除帖子道具]</a>"
end sub
response.write"<br/><a href=""adminxundj.asp?saytk="&saytk&"&amp;sid="&sid&""">[帖子道具管理]</a>"
%><!--#include file="fanhui.asp"-->
<%
call headsay()
%>
