<!-- #include file="include/skin.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->

<%
dim nummer,nums,rssum,page,viewpage,thepages,pageurl
dim id,party_username,party_master

nummer=5
nums=nummer
page=1
tit="聚会信息"
id=cint(request("id"))
if not symbol_name(id) or id="" then
  call format_redirect("party_list.asp")
end if

call web_head(0,0,0,0,0)
'----------------------------左边 开始----------------------------
call party_left()
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------

sql="select top 1 * from party_list where hidden=1 and id="&id
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,0,1
if rs.eof then
    rs.close
    call format_redirect("party_list.asp")
end if

%>
<table border=0 cellpadding=4 cellspacing=1 rules=cols width=100% align="center">
  <tr><td class=td0 colspan="2">&nbsp;<script language=javascript>document.write(img_skin("m_user"));</script>聚会详细信息</td></tr>
	<tr>
		<td>
		<table width="100%" class=tf>
			<tr>
				<td width="20%">聚会主题：</td>
				<td width="80%" colspan="3"><font color="#000080"><%=rs("party_info")%></font></td>
			</tr>
			<tr>
				<td>取会地点：</td>
				<td colspan="3"><font color="#000080"><%=rs("address")%></font></td>
			</tr>
			<tr>
				<td>聚会日期：</td>
				<td width="30%"><font color="#000080"><%=rs("party_date")%></font></td>
				<td width="20%">聚会时间：</td>
				<td width="30%"><font color="#000080"><%=rs("party_time")%></font></td>
			</tr>
			<tr>
				<td>聚会设想：</td>
				<td colspan="3"><font color="#000080"><%=rs("memo")%></font></td>
			</tr>
			<tr>
				<td>聚会暗号：</td>
				<td><font color="#000080"><%=rs("party_Sign")%></font></td>
				<td>聚会标志：</td>
				<td><font color="#000080"><%=rs("party_mark")%></font></td>
			</tr>
			<tr>
				<td>开销费用：</td>
				<td colspan="3"><font color="#000080">AA制<%=rs("party_money")%>元/人</font></td>
			</tr>
			<tr>
				<td>其它费用：</td>
				<td colspan="3"><font color="#000080"><%=rs("party_price")%></font></td>
			</tr>
			<tr>
				<td>发 起 人：</td>
				<td><font color="#000080"><%=rs("party_master")%></font></td>
				<td>联系方式：</td>
				<td><font color="#000080"><%=rs("party_link")%></font></td>
			</tr>
			<tr>
				<td colspan="3">要求参加聚会人的联系方式：<%=rs("contact")%></td>
				<td><div align="center"><a href="?action=join&id=<%=id%>" target=_blank><font color="#ff6600">按这里</font></a>加入本次聚会。</div></td>
			</tr>
		</table>
		</td>
	</tr>
<%rs.close%>
<tr><td class=td0 colspan="2">&nbsp;<script language=javascript>document.write(img_skin("m_user"));</script>聚会名单</td></tr>
<tr><td>
<%
sql="select * from party_user where party_id=" & id
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,0,1
do while not rs.eof%>
&nbsp;<font color="#0000FF"><%=rs("party_username")%></font>
<%rs.movenext
loop
rs.close%>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr><td class=td>&nbsp;<script language=javascript>document.write(img_skin("m_user"));</script>聚会留言</td></tr>
<%if login_mode<>""then %>
<form name="forms" method="post" action="party_view.asp?action=reply&id=<%=id%>">
<tr>
<td height="30"> 用 户 名：<%=login_username%> &nbsp;&nbsp;&nbsp;联式方式：<input type="text" maxlength=30 name="publink" size="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="发表意见"><input type="hidden" name="id" value="<%=id%>"> </td>
</tr>
<tr> 
<td height="30"> 发表意见：&nbsp;&nbsp;&nbsp;<textarea name="pubmain" maxlength=250 rows="2" cols="60"></textarea></td>
</tr>
</form>
<%end if%>
<table width="100%" border="0" cellspacing="1" cellpadding="2"><%
sql="select count(*) from party_book where party_id=" & id
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
call format_pagecute()

sql="select top "&nummer*viewpage&" * from party_book where party_id="&id&" order by id desc"
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,0,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
dim book_id
pageurl="?id="&id&"&"
for i=1 to nums
  book_id=cint(rs("id"))

   response.write vbcrlf&"<tr><td>用户名："&rs("pubname")&"</td><td>联系方式："&rs("publink")&"</td><td>留言时间："&rs("pubtime")&"</td></tr><tr><td colspan=3 >留言内容："&joekoe_cms.code_html(rs("pubmain"),2,0)&"</td><td><a href='?action=del&id="&id&"&book_id="&book_id&"'>删除</a></td></tr>"
 rs.movenext
next
rs.close%>
<tr class=bg_tds><td height=30 colspan=4>
现有 <font class=red><%response.write rssum%></font> 个<%response.write tit%>，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
&nbsp;分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%></td></tr></table></table>
<%

if action="del" then
	if login_mode<>"admin" then
    response.write "<script language='javascript'>alert(""只有管理员有此操作权！"");"
    else
    book_id=cint(trim(request("book_id")))
    conn.execute("delete from party_book where id="&book_id&"")
    response.write "<script language='javascript'>alert(""操作成功！"");"
    end if
end if
if action="join" then
	if login_mode="" then
    response.write "<script language='javascript'>alert(""只有登录后才能加入聚会！"");"
    end if

	party_username=login_username  

	sql="select * from party_user where party_username like '" & party_username & "'and party_id="&id
	call joekoe_cms.exec(sql,-1)
	rs.open sql,conn,1,3
	if rs.eof and rs.bof then
	rs.addnew
	rs("party_username")=party_username
	rs("party_id")=id
	rs.update
	rs.close
	else
    response.write "<script language='javascript'>alert(""对不起，你已是这次聚会里的成员了，不能再加第二次！"");"
	end if

 sql="select * from party_list where id="&id
 call joekoe_cms.exec(sql,-1)
 rs.open sql,conn,3,2
 rs("party_num")=rs("party_num")+1
 rs.update
 rs.close
response.write "<script language='javascript'>alert(""恭喜你，你已成功加入这次聚会！"");"
end if
if action="reply" then

	if login_mode="" then
		response.write "<script language='javascript'>" & VbCRlf
	    response.write "alert('请先登录');" & VbCrlf
	    response.write "history.go(-1);" & vbCrlf
	    response.write "</script>" & VbCRLF
    end if
dim pubname,publink,pubmain
 pubname=login_username
 publink=request("publink")  
 pubmain=request("pubmain")
 pubmain=code_admin("pubmain",1,250)

  if publink="" then
		response.write "<script language='javascript'>" & VbCRlf
	    response.write "alert('请填写联系方式');" & VbCrlf
	    response.write "history.go(-1);" & vbCrlf
	    response.write "</script>" & VbCRLF
  end if

  if pubmain="" then
		response.write "<script language='javascript'>" & VbCRlf
	    response.write "alert('请填写你的发言');" & VbCrlf
	    response.write "history.go(-1);" & vbCrlf
	    response.write "</script>" & VbCRLF
  end if

 sql="select * from party_book "
 call joekoe_cms.exec(sql,-1)
 rs.open sql,conn,3,2
 rs.addnew
 rs("party_id")=id
 rs("pubname")=pubname
 rs("publink")=publink
 rs("pubmain")=pubmain
 rs.update
 rs.close
response.redirect "party_view.asp?id="&id
end if
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub party_left()%>
<table border=0 cellpadding=4 cellspacing=1 rules=cols width=100% align="center">
  <tr><td class=td0 colspan="2">&nbsp;<script language=javascript>document.write(img_skin("m_user"));</script>网友聚会</td></tr>
  <tr> 
    <td align=center valign="top"> 
  	<table width=100% border=0>
  	<tr>
  	<td width=35% align=center><img src='<%response.write joekoe_cms.web_dir_skin%>/main/user_left_base.gif' border=0></td>
  	<td width=65%>
    <table border=0>
    <tr>
    <td><img src='<%response.write joekoe_cms.web_dir_skin%>/main/user_jt_base.gif' border=0></td>
    <td><a href='party_list.asp'>聚会列表</a></td>
    </tr>
    <tr>
    <td><img src='<%response.write joekoe_cms.web_dir_skin%>/main/user_jt_base.gif' border=0></td>
    <td><a href='user_put.asp?action=party'>发起聚会</a></td>
    </tr>
    </table>
  	</td>
  	</tr>
  	</table>
  	<table border=0>
  	<tr>
  	<td width=140 align="center">
<form name="myform"><br>
  	<select name="city" size="1" onchange="location=this.options[this.selectedIndex].value">
	<option selected>选择城市查看</option>
	<option value='party_list.asp?city=延安市'>延安市</option>
	<option value='party_list.asp?city=吴起县'>吴起县</option>
	<option value="party_list.asp?city=子长县">子长县</option>
	<option value="party_list.asp?city=志丹县">志丹县</option>
	<option value="party_list.asp?city=安塞县">安塞县</option>
	<option value="party_list.asp?city=甘泉县">甘泉县</option>
	<option value="party_list.asp?city=延川县">延川县</option>
	<option value="party_list.asp?city=延长县">延长县</option>
	<option value="party_list.asp?city=宜川县">宜川县</option>
	<option value="party_list.asp?city=富　县">富　县</option>
	<option value="party_list.asp?city=黄龙县">黄龙县</option>
	<option value="party_list.asp?city=黄陵县">黄陵县</option>
	<option value="party_list.asp?city=西安市">西安市</option>
	</select>
</form>
  	</td>
  	</tr>
  	</table>
    </td>
  </tr>
</table>
<table border=0 cellpadding=4 cellspacing=1 rules=cols width=100% align="center">
  <tr><td class=td0 colspan="2">&nbsp;<script language=javascript>document.write(img_skin("m_user"));</script>聚会说明</td></tr>
  <tr> 
    <td valign="top"> 
    <table cellspacing=1 cellpadding=4 class=table width=100%>
	<tr class=bg_td><td>&nbsp;&nbsp;&nbsp; 想参加本次聚会的网友,请先注册并登录，您的用户名会自动出现在该次聚会报名者名单列表中。只有本注册用户才能使用本功能,不是注册用户的请先<a href="../register.asp"><font color="#000080">注册</font></a>.
	</td></tr>
	</table>
    </td>
  </tr>
</table>
<%
end sub
%>