<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"-->
<%
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if isChkInteger(request("classid")) then
classid=request("classid")
else
Response.Redirect ("index.asp")
end if
if request("action")="del" then
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("index.asp")
end if
sql="delete from [snsn_loveshow] where id in ("&id&")"
conn.execute sql
response.write "<script language='javascript'>"
response.write "alert('删除成功！');"
response.write"this.location.href='zttl.asp';</SCRIPT>"
response.end
else
xy=nosql(request("xy"))
if len(xy)>200 then
response.write "<script language='javascript'>"
response.write "alert('对不起，内容大于200字符！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="select * from snsn_user where id="&session("id")
Set rs1= Server.CreateObject("ADODB.Recordset") 
rs1.open sql,conn,1,3
if rs1.eof or rs1.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
else

Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open "select * from snsn_loveshow where username='"&session("user")&"' and classid="&classid&"",conn,1,1
if rs.eof or rs.bof then
conn.execute("insert into snsn_loveshow (lovexy,username,classid)VALUES('"&xy&"','"&session("user")&"',"&classid&")")  
response.write "<script language='javascript'>"
response.write "alert('发表成功！');"
response.write"this.location.href='zttl.asp';</SCRIPT>"
response.end
else
response.write "<script language='javascript'>"
response.write "alert('你已经发表过了！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
end if
end if
%>