<!-- #include file="include/admin_onlogin.asp" -->
<%
index_url="party"
call admin_master(0,0)
call admin_header(0,0)
select case jk_mod
case "sh"
  ntit="待审核"&tit_fir
  sql_add=" where hidden=0"
case else
  jk_mod=""
  ntit=tit_fir&"列表"
  sql_add=" where hidden=1"
end select
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%response.write tit_fir%>列表</a></td>
  <td width=10></td>
  <td><a href='?jk_mod=sh'<%if jk_mod="sh" then response.write " class=red"%>>待审核<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=add&c_id=<%response.write cid%>&s_id=<%response.write sid%>'<%if action="add" then response.write " class=red"%>>添加<%response.write tit_fir%></a></td>
  </tr>
  </table>
</td></tr>
<tr><td colspan=2 align=center>
  <table border=0 cellspacing=0 cellpadding=2>
  <form action='?' method=get>
  <input type=hidden name=jk_mod value='<%response.write jk_mod%>'>
  <input type=hidden name=c_id value='<%response.write cid%>'>
  <input type=hidden name=s_id value='<%response.write sid%>'>
  <tr>
  <td>搜索（<%response.write ntit%>） 关键字：</td>
  <td><input type=text name=keyword value='<%response.write trim(request.querystring("keyword"))%>' size=15 maxlength=20></td>
  <td><select name=sea_type size=1>
<option value='topic'>按标题</option>
<option value='username'>按发布人</option>
</select></td>
  <td><select name=sea_term sizs=1><option value='all'>满足所有条件</option><option value='only'>满足一个条件</option></seelct></td>
  <td><input type=submit value='搜索'></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
call admin_table(1,1)

if action="handle" then call joekoe_go_handle()

select case action
case "clear"
  call joekoe_go_clear()
case "add"
  call joekoe_chk_add()
case "edit"
  call joekoe_chk_edit()
case else
  call joekoe_chk_main()
end select

call admin_ender(1)

sub joekoe_chk_edit()
  dim topic,party_user,comto,username,tim,party_link,address,hidden,word,party_Sign,party_Mark,party_date,party_time,contact,party_money,party_price
  call admin_td("编辑"&tit_fir)
  sql="select top 1 * from "&data_name&" where id="&id
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    call admin_msg(tit_fir&"ID（"&id&"）不存在！","?",1)
    exit sub
  end if
  if chk() then
    topic=code_admin("topic",1,50)
    word=request.form("word")
    comto=code_admin("comto",1,20)
    party_user=request("party_user")  '发起人真名
    party_link=request("party_link")  '发起人联系方式
    address=request("address")        '地点
    party_Sign=request("party_Sign")  '暗号
    party_Mark=request("party_Mark")  '标志
    party_date=trim(request.form("b_year"))&"-"&trim(request.form("b_month"))&"-"&trim(request.form("b_day"))  '日期
    party_time=request("party_time")  '时间
    contact=request("contact")     '参加人联系方式
    party_money=request("party_money") 'AA制费用
    party_price=request("party_price") '其它费用

    if topic="" then
      rs.close
      call admin_error(tit_fir&"标题不能为空！")
      exit sub
    end if
    if comto="" then
      rs.close
      call admin_error(tit_fir&"城市不能为空！")
      exit sub
    end if
    if party_user="" then
      rs.close
      call admin_error(tit_fir&"发起人真名不能为空！")
      exit sub
    end if
    if party_link="" then
      rs.close
      call admin_error(tit_fir&"发起人联系方式不能为空！")
      exit sub
    end if
    if address="" then
      rs.close
      call admin_error(tit_fir&"地点不能为空！")
      exit sub
    end if
    if party_date="" then
      rs.close
      call admin_error(tit_fir&"日期不能为空！")
      exit sub
    end if
    if party_time="" then
      rs.close
      call admin_error(tit_fir&"时间不能为空！")
      exit sub
    end if
    if party_money="" then
      rs.close
      call admin_error(tit_fir&"AA制费用不能为空！")
      exit sub
    end if
    if word="" then
      rs.close
      call admin_error(tit_fir&"详情不能为空！")
      exit sub
    end if
    username=code_admin("username",1,20)
    if symbol_name(username)=false then username=login_username
    tim=code_admin("tim",1,20)
    tim=joekoe_cms.time_type(tim,1)
    if tim="" then tim=joekoe_cms.now_time
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false
    rs("party_info")=topic
    rs("party_add")=comto
    rs("party_master")=username
    rs("star_time")=tim
    rs("hidden")=hidden
    rs("memo")=word
 rs("party_user")=party_user
 rs("party_link")=party_link
 rs("address")=address
 rs("party_Sign")=party_Sign
 rs("party_Mark")=party_Mark
 rs("party_date")=party_date
 rs("party_time")=party_time
 rs("contact")=contact
 rs("party_money")=party_money
 rs("party_price")=party_price
    rs.update
    rs.close
    call upload_note(index_url,id)
    call admin_msg("已成功编辑了一条"&tit_fir&"！","?jk_mod="&jk_mod&"&c_id="&cid&"&s_id="&sid,0)
    exit sub
  end if
  call form_first()
%>
<form name=add_frm action='?jk_mod=<%response.write jk_mod%>&action=edit&id=<%response.write id%>' method=post>
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<tr>
<td><%response.write tit_fir%>聚会主题：</td>
<td><input type=text name=topic value='<%response.write rs("party_info")%>' size=60 maxlength=50><%response.write redx%></td>
</tr>
<tr>
<td><%response.write tit_fir%>所在城市：</td>
<td><select name=comto size=1>
<option>所在城市</option>
<option value='上海市' <%if rs("party_add")="上海市" then response.write "selected"%>>上海市</option>
<option value='郑州市' <%if rs("party_add")="郑州市" then response.write "selected"%>>郑州市</option>
<option value='北京市' <%if rs("party_add")="北京市" then response.write "selected"%>>北京市</option>
<option value="上海市" <%if rs("party_add")="上海市" then response.write "selected"%>>上海市</option>
<option value="广州市" <%if rs("party_add")="广州市" then response.write "selected"%>>广州市</option>
<option value="深圳市" <%if rs("party_add")="深圳市" then response.write "selected"%>>深圳市</option>
<option value="重庆市" <%if rs("party_add")="重庆市" then response.write "selected"%>>重庆市</option>
<option value="天津市" <%if rs("party_add")="天津市" then response.write "selected"%>>天津市</option>
<option value="杭州市" <%if rs("party_add")="杭州市" then response.write "selected"%>>杭州市</option>
<option value="南京市" <%if rs("party_add")="南京市" then response.write "selected"%>>南京市</option>
<option value="武汉市" <%if rs("party_add")="武汉市" then response.write "selected"%>>武汉市</option>
<option value="宁波市" <%if rs("party_add")="宁波市" then response.write "selected"%>>宁波市</option>
<option value="大连市" <%if rs("party_add")="大连市" then response.write "selected"%>>大连市</option>
<option value="青岛市" <%if rs("party_add")="青岛市" then response.write "selected"%>>青岛市</option>
<option value="上海市" <%if rs("party_add")="上海市" then response.write "selected"%>>上海市</option>
<option value="西安市" <%if rs("party_add")="西安市" then response.write "selected"%>>西安市</option>
<option value="哈尔滨市" <%if rs("party_add")="哈尔滨市" then response.write "selected"%>>杭州市</option>
<option value="成都市" <%if rs("party_add")="成都市" then response.write "selected"%>>成都市</option>
</select><%response.write redx%>&nbsp;&nbsp;<%response.write tit_fir%>发起人姓名： <input class=wu maxlength=10 name=party_user size=10 value='<%response.write rs("party_user")%>'><%response.write redx%></td>
</tr>
<tr>
<td>聚会地点：</td>
<td><input class=wu maxlength=50 name=address value='<%response.write rs("address")%>' size=60><%response.write redx%></td>
</tr>
<tr>
<td>会员帐号：</td>
<td><input type=text name=username value='<%response.write rs("party_master")%>' size=20 maxlength=20>&nbsp;&nbsp;发布时间：<input type=text name=tim value='<%response.write rs("star_time")%>' size=20 maxlength=20>&nbsp;&nbsp;隐藏/审核：<input type=checkbox name=hidden value='yes'<%if rs("hidden")=false then response.write " checked"%>>
</td>
</tr>
<tr>
<td>接头暗号：</td>
<td><input maxlength=50 name=party_Sign value='<%response.write rs("party_Sign")%>' size=30>&nbsp;&nbsp;聚会标志：<input maxlength=50 name=party_Mark value='<%response.write rs("party_Mark")%>' size=30></td>
</tr>
<tr>
<td>聚会日期：</td>
<td><select name=b_year><%
  dim bires,birse
  bires=rs("party_date")
  if not(isdate(bires)) then
    bires=now()
  end if
  for i=year(now) to 2020
    birse=""
    if int(year(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
  response.write vbcrlf&"</select>年 <select name=b_month>"
  for i=1 to 12
    birse=""
    if int(month(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
  response.write vbcrlf&"</select>月 <select name=b_day>"
  for i=1 to 31
    birse=""
    if int(day(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
%></select><%response.write redx%>&nbsp;&nbsp;具体时间：<input class=wu maxlength=30 name=party_time value='<%response.write rs("party_time")%>' size=30><%response.write redx%></td>
</tr>
<tr>
<td>发起人联系方式：</td>
<td><input maxlength=40 name=party_link value='<%response.write rs("party_link")%>' size=30><%response.write redx%>(电话或email)</td>
</tr>
<tr>
<td>开销支付方式：</td>
<td>AA制： <input maxlength=4 name=party_money value='<%response.write rs("party_money")%>' size=3>元/人<%response.write redx%><br>其它： <input maxlength=50 name=party_price value='<%response.write rs("party_link")%>'></td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>聚会设计构想：</td>
<td><textarea name=word rows=15 cols=65><%response.write joekoe_cms.code_word(rs("memo"))%></textarea><%response.write redx%></td>
</tr>
<%
  call submit_edit()
  rs.close
end sub

sub joekoe_chk_add()
  dim topic,party_user,comto,username,tim,party_link,address,hidden,word,party_Sign,party_Mark,party_date,party_time,contact,party_money,party_price
  call admin_td("添加"&tit_fir)
  if chk() then
    topic=code_admin("topic",1,50)
    word=request.form("word")
    comto=code_admin("comto",1,20)
    party_user=request("party_user")  '发起人真名
    party_link=request("party_link")  '发起人联系方式
    address=request("address")        '地点
    party_Sign=request("party_Sign")  '暗号
    party_Mark=request("party_Mark")  '标志
    party_date=trim(request.form("b_year"))&"-"&trim(request.form("b_month"))&"-"&trim(request.form("b_day"))  '日期
    party_time=request("party_time")  '时间
    contact=request("contact")     '参加人联系方式
    party_money=request("party_money") 'AA制费用
    party_price=request("party_price") '其它费用

    if topic="" then
      rs.close
      call admin_error(tit_fir&"标题不能为空！")
      exit sub
    end if
    if comto="" then
      rs.close
      call admin_error(tit_fir&"城市不能为空！")
      exit sub
    end if
    if party_user="" then
      rs.close
      call admin_error(tit_fir&"发起人真名不能为空！")
      exit sub
    end if
    if party_link="" then
      rs.close
      call admin_error(tit_fir&"发起人联系方式不能为空！")
      exit sub
    end if
    if address="" then
      rs.close
      call admin_error(tit_fir&"地点不能为空！")
      exit sub
    end if
    if party_date="" then
      rs.close
      call admin_error(tit_fir&"日期不能为空！")
      exit sub
    end if
    if party_time="" then
      rs.close
      call admin_error(tit_fir&"时间不能为空！")
      exit sub
    end if
    if party_money="" then
      rs.close
      call admin_error(tit_fir&"AA制费用不能为空！")
      exit sub
    end if
    if word="" then
      rs.close
      call admin_error(tit_fir&"详情不能为空！")
      exit sub
    end if
    username=code_admin("username",1,20)
    if symbol_name(username)=false then username=login_username
    tim=code_admin("tim",1,20)
    tim=joekoe_cms.time_type(tim,1)
    if tim="" then tim=joekoe_cms.now_time
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false

    sql="select * from "&data_name
    call joekoe_cms.exec(sql,-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("party_info")=topic
    rs("party_add")=comto
    rs("party_master")=username
    rs("star_time")=tim
    rs("hidden")=hidden
    rs("memo")=word
 rs("party_user")=party_user
 rs("party_link")=party_link
 rs("address")=address
 rs("party_Sign")=party_Sign
 rs("party_Mark")=party_Mark
 rs("party_date")=party_date
 rs("party_time")=party_time
 rs("contact")=contact
 rs("party_money")=party_money
 rs("party_price")=party_price
    rs.update
    rs.close
    call upload_note(index_url,first_id(data_name,"id"))
    call admin_msg("已成功添加了一条"&tit_fir&"！","?jk_mod="&jk_mod&"&c_id="&cid&"&s_id="&sid,0)
    exit sub
  end if
  call form_first()
%>
<form name=add_frm action='?jk_mod=<%response.write jk_mod%>&action=add' method=post>
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<tr>
<td><%response.write tit_fir%>聚会主题：</td>
<td><input type=text name=topic size=60 maxlength=50><%response.write redx%></td>
</tr>
<tr>
<td><%response.write tit_fir%>所在城市：</td>
<td><select name=comto size=1>
<option>所在城市</option>
<option value='上海市'>上海市</option>
<option value='郑州市'>郑州市</option>
<option value='北京市'>北京市</option>
<option value="上海市">上海市</option>
<option value="广州市">广州市</option>
<option value="深圳市">深圳市</option>
<option value="重庆市">重庆市</option>
<option value="天津市">天津市</option>
<option value="杭州市">杭州市</option>
<option value="南京市">南京市</option>
<option value="武汉市">武汉市</option>
<option value="宁波市">宁波市</option>
<option value="大连市">大连市</option>
<option value="青岛市">青岛市</option>
<option value="上海市">上海市</option>
<option value="西安市">西安市</option>
<option value="哈尔滨市">哈尔滨市</option>
<option value="成都市">成都市</option>
</select><%response.write redx%>&nbsp;&nbsp;<%response.write tit_fir%>发起人姓名： <input class=wu maxlength=10 name=party_user size=10><%response.write redx%></td>
</tr>
<tr>
<td>聚会地点：</td>
<td><input class=wu maxlength=50 name=address size=60><%response.write redx%></td>
</tr>
<tr>
<td>会员帐号：</td>
<td><input type=text name=username size=20 maxlength=20>&nbsp;&nbsp;发布时间：<input type=text name=tim size=20 maxlength=20>&nbsp;&nbsp;隐藏/审核：<input type=checkbox name=hidden value='yes' checked>
</td>
</tr>
<tr>
<td>接头暗号：</td>
<td><input maxlength=50 name=party_Sign size=30>&nbsp;&nbsp;聚会标志：<input maxlength=50 name=party_Mark size=30></td>
</tr>
<tr>
<td>聚会日期：</td>
<td><select name=b_year><%
  dim bires,birse
  if not(isdate(bires)) then
    bires=now()
  end if
  for i=year(now) to 2020
    birse=""
    if int(year(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
  response.write vbcrlf&"</select>年 <select name=b_month>"
  for i=1 to 12
    birse=""
    if int(month(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
  response.write vbcrlf&"</select>月 <select name=b_day>"
  for i=1 to 31
    birse=""
    if int(day(bires))=int(i) then
      birse=" selected"
    end if
    response.write vbcrlf&"<option value='"&i&"'"&birse&">"&i&"</option>"
  next
%></select><%response.write redx%>&nbsp;&nbsp;具体时间：<input class=wu maxlength=30 name=party_time size=20 value=14:30:00><%response.write redx%></td>
</tr>
<tr>
<td>发起人联系方式：</td>
<td><input maxlength=40 name=party_link size=30><%response.write redx%>(电话或email)</td>
</tr>
<tr>
<td>开销支付方式：</td>
<td>AA制： <input maxlength=4 name=party_money size=3>元/人<%response.write redx%><br>其它： <input maxlength=50 name=party_price></td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>聚会设计构想：</td>
<td><textarea name=word rows=15 cols=65></textarea><%response.write redx%></td>
</tr>
<%
  call submit_add()
end sub

sub joekoe_chk_main()
  dim topic
  call format_search("party_info","party_info,party_master",2,1)
%>
<tr valign=top align=center>
<td width=100%>
  <table width=100% cellspacing=1 cellpadding=3 class=table0>
<form name=sel_form action='?jk_mod=<%response.write jk_mod%>&action=handle&c_id=<%response.write cid%>&s_id=<%response.write sid%>' method=post>
<tr align=center>
<td class=td width='7%'>序号</td>
<td class=td width='66%'><%response.write tit_fir%>标题及整理时间<%if sql_tmp<>"" then response.write "（搜索结果："&keyword&"）"%></td>
<td class=td width='22%'>相关属性</td>
<td class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  sql="select count(id) from "&data_name&sql_add
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from "&data_name&sql_add&" order by id desc"
  set rs=server.createobject("adodb.recordset")
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
    id=rs("id")
    topic=rs("party_info")
%>
<tr align=center>
<td class=tims><a href='<%response.write index_url%>_view.asp?id=<%response.write id%>' target=_blank><%response.write (viewpage-1)*nummer+i%></a></td>
<td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr>
  <td><a href='?jk_mod=<%response.write jk_mod%>&action=edit&id=<%response.write id%>'><%response.write joekoe_cms.code_html(topic,1,(18+tnum))%></a></td>
  <td align=right><font class=tims><%response.write joekoe_cms.time_type(rs("star_time"),4)%></font></td>
  </tr>
  </table>
</td>
<td align=left><%response.write pro_edit("?jk_mod="&jk_mod&"&action=edit&id="&id,"编辑该"&tit_fir) &"&nbsp;"& pro_hidden(rs("hidden"),1)%></td>
<td><input type=checkbox name=sel_id value='<%response.write id%>'></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=2>
现有<font class=red><%response.write rssum%></font>条<%response.write tit_fir%>，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>
分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td>
<td colspan=2 align=center>
执行
<select name=sel_type size=1>
<option value='审核'>审核</option>
<option value='待审核'>待审核</option>
<option value='删除'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);">
</td>
</tr>
</form>
  </table>
</td>
</tr>
<%
end sub
%>