<!--#include file="conn.asp"-->
<!--#include file="chkadmin.asp"-->
<!--#include file="inc/char.asp"-->
<%dim id,action
id=CInt(Trim(Request.QueryString("id")))
action=Trim(Request.QueryString("action"))

dim errmsg,founderr
founderr=false

if chkadmin=false or power(1)="0" then
	founderr=true
	if action="true" then
		errmsg=errmsg&"<li>您没有隐藏软件的权限</li>"
	else
		errmsg=errmsg&"<li>您没有还原软件的权限</li>"
	end if
end if

dim sql,rs
sql="select Poster from Software where ID="&id
set rs=conn.execute(sql)
if chkadmin=false or (power(4)="0" and rs(0)<>session("adm_usr")) then
	founderr=true
	if action="true" then
		errmsg=errmsg&"<li>您没有隐藏他人软件的权限</li>"
	else
		errmsg=errmsg&"<li>您没有还原他人软件的权限</li>"
	end if
end if
set rs=nothing

if founderr=false then
	conn.execute("update Software set Hidden="&action&" where ID="&id)
	dim gourl,msg
	gourl=request.ServerVariables("HTTP_REFERER")
	if action="true" then
		msg="此软件已隐藏！"
	else
		msg="此软件已还原！"
	end if
	call ok()
else
	call error()
end if

conn.close
set conn=nothing
%>