<!--#include file="../conn.asp" -->
<%
if session("admin")<>"" then
else
Response.Write("<script language=JavaScript>alert('对不起,您没有权限使用该功能!!');history.back();</script>")
response.end
end if

if request.QueryString("action")="deluser" then
set rs2=server.CreateObject("adodb.recordset")
userid=request.QueryString("userid")
sql2="select * from diaryuser where userid="&userid
rs2.open sql2,conn,1,3
rs2.delete
rs2.close
sql3="select * from diary where userid="&userid
rs2.open sql3,conn,1,3
rs2.delete
rs2.close
Response.Write("<script language=JavaScript>alert('删除成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_user.asp>")

set rs2=nothing
end if

if request.QueryString("action")="deldiary" then
set rs=server.CreateObject("adodb.recordset")
diaryid=request.QueryString("diaryid")
sql="select * from diary where diaryid="&diaryid
rs.open sql,conn,1,3
userid=rs("userid")
rs.delete
rs.close
Set r = Server.CreateObject("ADODB.Recordset")
  sql="select * from diaryuser where userid="&userid
   r.open sql,conn,3,2
   r("amount")=r("amount")-1
   r.update
    r.close
   
Response.Write("<script language=JavaScript>alert('删除成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_diary.asp>")
set rs=nothing
conn.close
end if

if request.QueryString("action")="good" then
set rs=server.CreateObject("adodb.recordset")
diaryid=request.QueryString("diaryid")
sql="select * from diary where diaryid="&diaryid
rs.open sql,conn,1,3
rs("good")=1
rs.update
rs.close
Response.Write("<script language=JavaScript>alert('推荐成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_diary.asp>")
set rs=nothing
conn.close
end if

if request.QueryString("action")="delgood" then
set rs=server.CreateObject("adodb.recordset")
diaryid=request.QueryString("diaryid")
sql="select * from diary where diaryid="&diaryid
rs.open sql,conn,1,3
rs("good")=0
rs.update
rs.close
Response.Write("<script language=JavaScript>alert('去除成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_good.asp>")
set rs=nothing
conn.close
end if

if request.QueryString("action")="bgood" then
set rs=server.CreateObject("adodb.recordset")
diaryid=request.QueryString("diaryid")
sql="select * from diaryuser where userid="&diaryid
rs.open sql,conn,1,3
rs("istui")="1"
rs.update
rs.close
Response.Write("<script language=JavaScript>alert('推荐成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_book.asp>")
set rs=nothing
conn.close
end if

if request.QueryString("action")="delbgood" then
set rs=server.CreateObject("adodb.recordset")
diaryid=request.QueryString("diaryid")
sql="select * from diaryuser where userid="&diaryid
rs.open sql,conn,1,3
rs("istui")="0"
rs.update
rs.close
Response.Write("<script language=JavaScript>alert('去除成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_goodbook.asp>")
set rs=nothing
conn.close
end if

if request.QueryString("action")="skins" then
name=Trim(Request.Form("name"))
m_html=Trim(Request.Form("m_html"))
m_html_2=Trim(Request.Form("m_html_2"))
set rs=server.CreateObject("adodb.recordset")
if request.QueryString("cz")="add" then
sql="select * from c_moban"
rs.open sql,conn,1,3
rs.addnew
else
m_id=request.QueryString("sking")
sql="select * from c_moban where m_id="&m_id
rs.open sql,conn,1,3
end if
rs("m_name")=name
rs("m_html")=m_html
rs("m_html_2")=m_html_2
rs.update
rs.close
Response.Write("<script language=JavaScript>alert('添加成功!');</script>")
Response.Write("<meta http-equiv=refresh content=0;URL=admin_skins.asp>")
set rs=nothing
conn.close
end if

%>
