<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/nosql.asp"-->
<%
if request("action")="add" then
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
end if
showname=nosql(request("showname"))
shownr=nosql(request("shownr"))
userid=nosql(request("userid"))
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open "select * from mini_zjhome where userid="&session("id"),conn,1,1
if rs.eof or rs.bof then
conn.execute("insert into mini_zjhome (showname,shownr,userid)VALUES('"&showname&"','"&shownr&"',"&session("id")&")")  
response.write "<script language=javascript>alert('欢迎你参加最佳房间评选活动！');window.close();window.opener.location.reload();</script>"
response.end
else
response.write "<script language='javascript'>"
response.write "alert('你已经参加过了！');"
response.write"window.close()</SCRIPT>"
response.end
end if
elseif request("action")="vote" then
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
end if
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open "select * from snsn_info where lx=1 and userid="&session("id"),conn,1,1
if rs.eof or rs.bof then
if isChkInteger(request("id")) then
id=request("id")
else
Response.Redirect ("../index.asp")
end if
conn.execute("insert into [snsn_info] (userid,lx) values ("&session("id")&",1)")
conn.execute("update [mini_zjhome] set showtp=showtp+1 where id="&id&"")
response.cookies("homeIPAddress")=Request.ServerVariables("REMOTE_ADDR") 
response.write "<script language=javascript>alert('感谢你投出的神圣一票！');window.close();window.opener.location.reload();</script>"
response.end
else
response.write "<script language='javascript'>"
response.write "alert('你已经投过票了！');"
response.write"window.close()</SCRIPT>"
response.end
end if
else
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()</SCRIPT>"
response.end
end if
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../css.css" REL="stylesheet" TYPE="text/css">
<style type="text/css">
<!--
body {
	margin-left: 8px;
	margin-top: 8px;
	margin-right: 8px;
	margin-bottom: 8px;
}
.style1 {color: #999999}
-->
</style></head>

<body><form name="form1" method="post" action="?action=add">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="10" bgcolor="efefef"><strong>我加参加最佳房间评比：</strong></td>
  </tr>
  <tr>
    <td height="11" bgcolor="#FFFFFF">房间名称：
      <input name="showname" type="text" id="showname3" size="50" maxlength="50" class="wenbenkuang"></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF">房间说明：
      <textarea name="shownr" cols="48" rows="6" class="wenbenkuang" id="shownr"></textarea></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="参加" class="go-wenbenkuang"> <input type="reset" name="Submit2" value="重设" class="go-wenbenkuang">
      <input name="textfield" type="hidden" value="<%=session("id")%>">
    </td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><span class="style1">注：参赛房间即为你当前的迷你主页上显示的房间，系统已经直接绑定不用再提交，最终最佳房间将以得票数最多而定，投票数为用户自发评选，得票数最多者本站将给予一定奖励，奖励包括实物和虚拟等。</span></td>
  </tr>
</table>
</form>
</body>
</html>
<%end if%>