<!-- #include file="include/admin_onlogin.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_em.asp" -->
<%
'****************************************************
' 阳光情缘 2006V3.0      Power by sdsun.com.cn
' Email: 27072320@qq.com  , sdsun163@163.com
' Web: http://www.sdsun.com.cn
' Copyright (C) 2006 sdsun.com.cn All Rights Reserved.
'****************************************************
index_url="word"
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 class=h_menu onmouseover=ShowMenu(strMenu_music,100) href='admin_music.asp'>音乐列表</a></td>
  <td width=10></td>
  <td><a href='admin_music_list.asp'>歌曲管理</a></td>
  <td width=10></td>
  <td><a class=h_menu onmouseover=ShowMenu(strMenu_singer,100) href='admin_music_singer.asp'>歌手管理</a></td>
  <td width=10></td>
  <td><a href='admin_music.asp?action=disk_list'>专辑管理</a></td> 
  <td width=10></td>
  <td><a href='admin_music_sort.asp'>音乐分类</a></td>
  <td width=10></td>
  <td><a href='admin_song.asp'>点歌管理</a></td>
  <td width=10></td>
  <td><a href='admin_fav.asp'>歌曲收藏</a></td>
  <td width=10></td>
  <td><a href='admin_disk.asp'>专辑收藏</a></td>
  </tr>
  </table>
</td></tr>
<tr><td colspan=2 align=center>
  <table border=0 cellspacing=0 cellpadding=2>
  <form action='admin_music_search.asp' name="search" method="post">
  <input type=hidden name=sea_term value='only'>
  <input type=hidden name=sea_type value='name'>
  <tr>
  <td>音 乐 搜 索</td>
  <td>&nbsp;<select name='stype' size=1>
<option value='Special'>专辑</option>
<option value='Music'>音乐</option>
<option value='Singer'>歌手</option>
</select></td>
  <td>&nbsp;<input type='text' name='keyword' value='' size=12 maxlength=20 alt='多个关键字请用 空格 格开'></td>
  <td>&nbsp;<select name=s_area size=1>
<option value='' class=mbg_tds>所有地区</option>
<option value='1'>大陆地区</option>
<option value='2'>港台地区</option>
<option value='3'>海外地区</option></select></td>
  <td>&nbsp;<select name=s_sex size=1>
<option value='' class=mbg_tds>所有歌手</option>
<option value='1'>男歌手</option>
<option value='2'>女歌手</option>
<option value='3'>乐队组合</option></select></td>
  <td>&nbsp;<select name=s_lang size=1>
<option value='' class=mbg_tds>语言</option>
<option value='中文'>中文</option>
<option value='粤语'>粤语</option>
<option value='英文'>英文</option>
<option value='日文'>日文</option>
<option value='韩文'>韩文</option>
<option value='其它'>其它</option>
</select></td>
  <td valign=top>&nbsp;<input type=submit value='搜 索'></td>
  </tr>
  </form>
</table>

<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'<%if action="add" then response.write " class=red"%>>添加<%response.write tit_fir%></a></td>
<%call joekoe_is_nsort_review()%>
  </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%>'>
  <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_disk()
end select

call admin_ender(1)

sub joekoe_chk_edit()
  dim musicName,AddTime,hidden,musicword,singer,AddUser,musicid
  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)
    musicword=request.form("musicword")
    if musicName="" or musicword="" then
      rs.close
      call admin_error(tit_fir&"标题 和 "&tit_fir&"内容 不能为空！")
      exit sub
    end if
    singer=code_admin("singer",1,50)
    musicid=code_admin("musicid",1,20)
    AddUser=code_admin("AddUser",1,20)
    if symbol_name(AddUser)=false then AddUser=login_username
    AddTime=code_admin("AddTime",1,20)
    AddTime=joekoe_cms.time_type(AddTime,1)
    if AddTime="" then AddTime=joekoe_cms.now_time
    hidden=true
    if trim(request.form("hidden"))="yes" then hidden=false
     rs("musicName")=musicName
    rs("musicid")=musicid
    rs("singer")=singer
    rs("AddUser")=AddUser
    rs("AddTime")=AddTime
    rs("hidden")=hidden
    rs("musicword")=musicword
    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=singer value='<%response.write rs("singer")%>' size=20 maxlength=20>&nbsp;&nbsp;歌词ID<input type=text name=musicid value='<%response.write rs("musicid")%>' size=20 maxlength=20>
</td>
</tr>
<tr>
<td>发布时间：</td>
<td><input type=text name=AddTime value='<%response.write rs("AddTime")%>' 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 type=text name=AddUser value='<%response.write rs("AddUser")%>' size=20 maxlength=20>
</td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>内容：</td>
<td><textarea name=musicword rows=15 cols=65><%response.write joekoe_cms.code_word(rs("musicword"))%></textarea></td>
</tr>
<%
  call submit_edit()
  rs.close
end sub


sub joekoe_chk_add()
dim musicName,AddTime,hidden,musicword,singer,AddUser,musicid,errmsg
  call admin_td("添加"&tit_fir)
  if chk() then
    musicName=code_admin("musicName",1,40)
    musicword=request.form("musicword")
    if musicName="" or musicword="" then
      call admin_error(tit_fir&"标题 和 "&tit_fir&"内容 不能为空！")
      exit sub
    end if
    singer=code_admin("singer",1,50)
    musicid=code_admin("musicid",1,20)
    AddUser=code_admin("AddUser",1,20)
    if symbol_name(AddUser)=false then AddUser=login_username
    AddTime=code_admin("AddTime",1,20)
    AddTime=joekoe_cms.time_type(AddTime,1)
    if AddTime="" then AddTime=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("musicName")=musicName
    rs("musicid")=musicid
    rs("singer")=singer
    rs("AddUser")=AddUser
    rs("AddTime")=AddTime
    rs("hidden")=hidden
    rs("musicword")=musicword
    rs.update
    rs.close
    call upload_note(index_url,first_id(data_name,"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=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=musicName size=60 maxlength=40><%response.write redx%></td>
</tr>
<tr>
<td>歌手：</td>
<td><input type=text name=singer size=20 maxlength=20>&nbsp;&nbsp;歌词ID<input type=text name=musicid size=20 maxlength=20>
</td>
</tr>
<tr>
<td>发布时间：</td>
<td><input type=text name=AddTime value='<%response.write joekoe_cms.now_time%>' size=20 maxlength=20></td>
</tr>
<tr>
<td>发布人：</td>
<td><input type=text name=AddUser value='<%response.write login_username%>' size=20 maxlength=20>
</td>
</tr>
<tr>
<td valign=top><%response.write tit_fir%>内容：</td>
<td><textarea name=musicword rows=15 cols=65></textarea></td>
</tr>
<%
  call submit_edit()
end sub

sub joekoe_chk_disk()
  dim musicword,hidden,musicname,pageurl2
pageurl2=pageurl
call format_search("musicName","musicName,AddUser",2,1)
%>
<form name=sel_form action='?jk_mod=<%response.write jk_mod%>&action=handle' 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"
  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")
    musicword=rs("musicword")
    hidden=rs("hidden")
%>
<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,(18+tnum))%></a></td>
  <td align=right><%=rs("AddUser")%>&nbsp;&nbsp;<font class=tims><%response.write joekoe_cms.time_type(rs("AddTime"),4)%></font></td>
  </tr>
  </table>
</td>
<td><%response.write pro_edit("?jk_mod="&jk_mod&"&action=edit&id="&id,"编辑该"&tit_fir) &"&nbsp;&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>
<%
end sub
'****************************************************
' 阳光情缘 2006V3.0      Power by sdsun.com.cn
' Email: 27072320@qq.com  , sdsun163@163.com
' Web: http://www.sdsun.com.cn
' Copyright (C) 2006 sdsun.com.cn All Rights Reserved.
'****************************************************
%>