<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_em.asp" -->
<%
'****************************************************
' 咪咪娱乐社区 2006V4.0      Power by www.mimi88.cn
' Email: 556248@qq.com  , master@szvsun.com
' Web: http://www.mimi88.cn
' Copyright (C) 2006 www.mimi88.cn All Rights Reserved.
'****************************************************
index_url="song"
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>
<%
if action="" then
  call admin_table(1,0)
else
  call admin_table(1,1)
end if

if action="handle" then call joekoe_go_handle()

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

call admin_ender(1)

sub joekoe_chk_edit()
  dim musicName,data,content,UserName,Name
  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
    musicName=code_admin("musicName",1,40)
    content=request.form("content")
    if musicName="" or content="" then
      rs.close
      call admin_error(tit_fir&"标题 和 "&tit_fir&"内容 不能为空！")
      exit sub
    end if
    Name=code_admin("Name",1,50)
    UserName=code_admin("UserName",1,50)
    if symbol_name(UserName)=false then UserName=login_username
    data=code_admin("AddTime",1,20)
    data=joekoe_cms.time_type(data,1)
    if data="" then data=joekoe_cms.now_time
  
    rs("UserName")=UserName
    rs("data")=data
    rs("content")=content
    rs.update
    rs.close
    call upload_note(index_url,id)
    call admin_msg("已成功编辑了一条"&tit_fir&"！","?jk_mod="&jk_mod&"&id="&id,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=musicname value='<%response.write rs("musicname")%>' size=60 maxlength=40><%response.write redx%></td>
</tr>
<tr>
<td>发布时间：</td>
<td><input type=text name=data value='<%response.write rs("data")%>' size=20 maxlength=20>&nbsp;&nbsp;送给朋友：<input type=text name=Name value='<%response.write rs("Name")%>' size=20 maxlength=20></td>
</tr>
<tr>
<td>发布人：</td>
<td><input type=text name=UserName value='<%response.write rs("UserName")%>' size=20 maxlength=20>
</td>
</tr>
<tr>
<td><%call frm_ubb_type("")%></td>
<td><%call frm_ubb("add_frm","content","&nbsp;&nbsp;")%></td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>内容：</td>
<td><textarea name=content rows=15 cols=65><%response.write joekoe_cms.code_word(rs("content"))%></textarea></td>
</tr>
<%
  call submit_edit()
  rs.close
end sub


sub joekoe_chk_main()
  dim musicname,data
%>
<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%>发布人</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")
    musicname=rs("musicname")
    data=rs("data")
%>
<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><a href='?jk_mod=<%response.write jk_mod%>&action=edit&id=<%response.write id%>'><%response.write joekoe_cms.code_html(musicname,1,21+tnum)%></td>
  <td align=right><font class=tims alt='<%response.write joekoe_cms.time_type(data,2)%>'><%response.write joekoe_cms.time_type(data,4)%></font></td>
  </tr>
  </table>
</td>
<td align=left><%=rs("UserName")%></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
'****************************************************
' 咪咪娱乐社区 2006V4.0      Power by www.mimi88.cn
' Email: 556248@qq.com  , master@szvsun.com
' Web: http://www.mimi88.cn
' Copyright (C) 2006 www.mimi88.cn All Rights Reserved.
'****************************************************
%>
