<!-- #include file="include/admin_onlogin.asp" -->
<!-- #INCLUDE file="admin_music_config.asp" -->
<%
tit="点歌管理"
call admin_header(0,0)
data_name="music_mail"
select case jk_mod
case "isread"
  ntit="已收点歌"
  sql_add=" where isread=1"
case "noread"
  ntit="已收点歌"
  sql_add=" where isread=0"
case else
  jk_mod=""
  ntit="点歌列表"
  sql_add=""
end select
%>
<tr><td colspan=2 align=center>
<a href='?'>点歌列表</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='?jk_mod=isread'<%if jk_mod="isread" then response.write " class=red"%>>已收点歌</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='?jk_mod=noread'<%if jk_mod="noread" then response.write " class=red"%>>未收点歌</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='admin_music_singer.asp'>歌手管理</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='admin_music_disk.asp'>专辑管理</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='admin_music_song.asp'>歌曲管理</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='?action=clear' onclick="javascript:return click_return('清空所有点歌',0);">清空所有点歌</a>
</td></tr>
<tr><td colspan=2 align=center>
  <table border=0 cellspacing=0 cellpadding=2>
  <form action='?action=maillist&types=sea' method=post>
  <tr>
  <td>搜索（点歌列表）关键字：</td>
  <td><input type=text name=keyword value='<%response.write keyword%>' size=15 maxlength=20></td>
  <td><input type=submit value='搜索'></td>
  </tr>
  </form>
  </table>
</td></tr>
<%
call admin_table(1,0)
if action="handle" then call joekoe_go_handle()
select case action
  case "clear"
    call joekoe_go_clear()
  case else
    call mail_list_main()
end select
call admin_ender(1)
'-----------------------------------点歌列表-------------------------------------------
sub mail_list_main()
  dim read
  PageUrl="?"
  response.write "<form name=sel_form action='?jk_mod="&jk_mod&"&action=handle' method=post>" & _
             vbcrlf&"<tr align=center>" & _
             vbcrlf&"<td class=td width='7%'>序号</td>" & _
             vbcrlf&"<td class=td width='40%'>点歌名称</td>" & _
             vbcrlf&"<td class=td width='11%'>来自</td>" & _
             vbcrlf&"<td class=td width='16%'>送给</td>" & _
             vbcrlf&"<td class=td width='13%'>点歌时间</td>" & _
             vbcrlf&"<td class=td width='6%'>是否已读</td>" & _
             vbcrlf&"<td class=td width='7%'><input type=checkbox name=sel_all value='yes' onclick=""javascript:select_all(this.form);""></td>" & _
             vbcrlf&"</tr>"
  if types="sea" then
    sql_add=" where name like '%"& keyword &"%'"
  end if
  sql="select count(id) from music_mail"&sql_add
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from music_mail"&sql_add&" order by id desc"
  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
  if rs("isread")=true then
     read="已读"
  else
     read="未读"
  end if
      response.write "<tr align=center>" & _
             vbcrlf&"<td>"&i&"</td>" & _
             vbcrlf&"<td>"&rs("m_name")&"</td>" & _
             vbcrlf&"<td>"&rs("s_user")&"</td>" & _
             vbcrlf&"<td>"&rs("r_user")&"</td>" & _
             vbcrlf&"<td class=tims>"&joekoe_cms.time_type(rs("tim"),4)&"</td>" & _
             vbcrlf&"<td>"&read&"</td>" & _
             vbcrlf&"<td><input type=checkbox name=sel_id value='"&rs("id")&"' class=bg_tds></td>" & _
             vbcrlf&"</tr>"
      rs.movenext
    next
    rs.close
    set rs=nothing
    response.write "<tr class=tr1>" & _
             vbcrlf&"<td colspan=4>现有<font class=red>"&rssum&"</font>个点歌，页次：<font class=red>"&viewpage&"</font>/<font class=red>"&thepages&"</font>分页："&jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")&"</td>" & _
             vbcrlf&"<td colspan=3 align=center>执行<select name=sel_type size=1><option value='删除'>删除</option></select><input type=submit value='操作' onclick=""return sel_click(this.form);""></td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</form>" & _
             vbcrlf&"</table></td></tr>" 
end sub

%>