<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_ip_sys.asp" -->
<%
index_url="gbook"
call admin_master(0,0)
call admin_header(0,0)
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%response.write tit%></a></td>
<%call joekoe_is_nsort_review()%>
  </tr>
  </table>
</td></tr>
</table>
<%
call admin_table(1)

if action="handle" then call joekoe_go_handle()

select case action
case "clear"
  call joekoe_go_clear()
case "reply"
  call joekoe_chk_reply()
case else
  call joekoe_chk_main()
end select

call admin_ender(1)

sub joekoe_chk_reply()
  dim reword
  sql="select top 1 * from "&data_name&" where id="&id
  call joekoe_cms.exec("",-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
    reword=code_admin("reword",1,250)
    rs("re_word")=reword
    rs("re_tim")=joekoe_cms.now_time
    rs.update
    rs.close
    call admin_msg("成功回复了"&tit_fir&"（ID："&id&"）","?",1)
    exit sub
  end if
  call form_first()
%>

<form action='?nsort=<%response.write nsort%>&action=reply&id=<%response.write id%>' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td width='20%' class=td></td>
<td width='80%' class=td><%response.write tit_fir%>回复</td>
</tr>
<tr>
<td><%response.write tit_fir%>主题：</td>
<td><%response.write joekoe_cms.code_html(rs("topic"),1,0)%></td>
</tr>
<tr>
<td><%response.write tit_fir%>作者：</td>
<td><%response.write joekoe_cms.code_html(rs("nname"),1,0)%></td>
</tr>
<tr>
<td><%response.write tit_fir%>内容：</td>
<td><%response.write code_jk2(rs("word"))%></td>
</tr>
<tr>
<td><%response.write tit_fir%>时间：</td>
<td><%response.write rs("tim")%></td>
</tr>
<tr>
<td><%response.write tit_fir%>回复：<br><br>250字以内</td>
<td>
<table border=0><tr>
<td><textarea name=reword rows=6 cols=65><%response.write joekoe_cms.code_html(rs("re_word"),0,0)%></textarea></td>
<td width=5></td>
<td valign=bottom><%call textarea_resize("reword")%></td>
</tr></table>
</td>
</tr>
<td>回复时间：</td>
<td><%response.write rs("re_tim")%></td>
</tr>
<%
  call submit_edit()
  rs.close
end sub

sub joekoe_chk_main()
  dim topic,tim
%>
<form name=sel_form action='?jk_mod=<%response.write jk_mod%>&action=handle' method=post>
<tr align=center>
<td class=td width='6%'>序号</td>
<td class=td width='69%'><%response.write tit_fir%>主题 和 <%response.write tit_fir%>时间</td>
<td class=td width='20%'><%response.write tit_fir%>IP及发布人</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
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from "&data_name&" order by id desc"
  call joekoe_cms.exec("",-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("topic")
    tim=rs("tim")
%>
<tr align=center>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr>
  <td><%response.write joekoe_cms.code_html(topic,1,21+tnum)%></td>
  <td align=right><font class=tims alt='<%response.write joekoe_cms.time_type(tim,2)%>'><%response.write joekoe_cms.time_type(tim,4)%></font></td>
  </tr>
  </table>
</td>
<td align=left><a href='?action=reply&id=<%response.write id%>'><%response.write img_admin("reply","回复此条"&tit_fir)%></a>&nbsp;&nbsp;<%response.write img_admin("ip","IP："&rs("ip"))&"&nbsp;&nbsp;"&img_admin("sys",view_sys(rs("sys")))&"&nbsp;&nbsp;"&rs("nname")%></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>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);">
</td>
</tr>
<%
end sub

sub joekoe_chk_add()
  call admin_td("添加说明")
  if chk() then
    'topic=code_admin("topic",1,50)
    'call admin_error(tit_fir&"名称 不能为空！")
    
    call admin_msg("成功添加一项新的"&tit_fir&"名称","?",0)
    exit sub
  end if
  call form_first()
%>
<form action='?action=add' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td><%response.write tit_fir%>名称：</td>
<td><input type=text name=name size=20 maxlength=20></td>
</tr>
<%
  call submit_add()
end sub
%>
