<!--#include file="inc/conn.asp"-->
<!--#include file="config.asp"-->

<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>
<%if request("jle")="delok" then
id=request("id")
delpass=request("delpass")
set rs=server.createobject("adodb.recordset")
sql="select * from [jle_info] where id="&cstr(id)
rs.open sql,conn,1,1
'On Error Resume Next
if (rs("delpass")<>"" and delpass=rs("delpass")) or delpass=delpass1 then
tupian=rs("tupian")
if tupian<>"0" and  tupian<>""  then
   fileExt=lcase(right(tupian,4))
   if (fileEXT=".gif" or fileEXT=".jpg" or fileEXT=".jpeg") and left(tupian,4)<>"http" then
   call deltu()
   end if
end if

dim xurl
xurl=server.mappath("\"&rs("xurl")& "")  
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(xurl) then
objFSO.DeleteFile(xurl)
end if
set objfso=nothing
rs.close

sql="delete from [jle_info] where id="&cstr(id)
rs.open sql,conn,1,3
sql1="delete from [jle_fav] where scid='"&cstr(id)&"' "
rs.open sql1,conn,1,3
sql2="delete from [reply] where xxid='"&cstr(id)&"' "
rs.open sql2,conn,1,3
sub deltu()
dim whichfile
whichfile=server.mappath("\"& tupian & "")  
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(whichfile) then
objFSO.DeleteFile(whichfile)
end if
set objfso=nothing
end sub
response.write "<script language=JavaScript>" & chr(13) & "alert('删除信息成功！')</script>"
cl
response.end
rs.close
set rs=nothing
closedb
else
response.write "<script language=JavaScript>" & chr(13) & "alert('删除密码不正确！');" & "history.back()" & "</script>"
end if
response.end
end if%>


<%if request("jle")="del" then
id=request("id")
%>
<form method="POST" action="?jle=delok&id=<%=id%>">
<p align="center">请输入删除密码：<input type="password" name="delpass" size="15"> </p>
<p align="center"> <input type="submit" value="确定删除" name="B1"></p>
</form>
<%
response.end
end if%>


<%
dim id,username,rs,sql
if request.cookies("jle")("username")="" or request.cookies("jle")("domain")="" or request.cookies("jle")("id")="" then 
response.write "<br>"
response.write "<li>你还没有登陆！"
cl
response.end
end if
id=trim(request("id"))
if id="" or not isnumeric(id) then
response.write "<li>参数错误！"
cl
response.end
end if
username=trim(request.cookies("jle")("username"))
set rs=server.createobject("adodb.recordset")
sql="select username,scid from jle_fav where username='"&username&"' and scid='"&id&"' "
rs.open sql,conn,1,3
if (rs.eof or rs.bof) then
rs.addnew
rs("username")=username
rs("scid")=id
rs.update
response.write "<br>"
response.write "<li>收藏成功！"
cl
else
response.write "<br>"
response.write "<li>你已经收藏过了！"
cl
response.end
end if
rs.close
set rs=nothing
closedb
%>
<%sub cl()
response.write "<meta http-equiv=refresh content='1;URL="&Request.ServerVariables("HTTP_REFERER")&"'>"
end sub%>