<!-- #include file="include/AMH_onlogin.asp" -->
<!-- #INCLUDE file="AMH_music_config.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V2.0》，简称“AsaiMHV2”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

del_user_true=true
del_upload_true=true

tit="专辑管理"
Index_Url="mdisk"
PageUrl = PageUrl&"ChannelIDs="&iChannelIDs&"&"
Call AMH_Master(1,2)
Call AMH_Header(0)
Select Case AsaiMHMod
Case "isgood"
	ntit="推荐"&tit_fir
	sql_add="ChannelIDs="&iChannelIDs&" and hidden=1 and isgood=1"
Case "sh"
	ntit="待审核"&tit_fir
	sql_add="ChannelIDs="&iChannelIDs&" and hidden=0"
Case Else
	AsaiMHMod=""
	ntit=tit_fir&"列表"
	sql_add="ChannelIDs="&iChannelIDs&" and hidden=1"
End Select
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?ChannelIDs=<%=iChannelIDs%>'><%Response.Write tit_fir%>列表</a></td>
  <td width=10></td>
  <td><a href='?AsaiMHMod=isgood&ChannelIDs=<%=iChannelIDs%>'<%if AsaiMHMod="isgood" then Response.Write " class=red"%>>推荐<%Response.Write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?AsaiMHMod=sh&ChannelIDs=<%=iChannelIDs%>'<%if AsaiMHMod="sh" then Response.Write " class=red"%>>待审核<%Response.Write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?Action=Add&ChannelIDs=<%=iChannelIDs%>&ClassID=<%Response.Write ClassID%>'<%if action="add" then Response.Write " class=red"%>>添加<%Response.Write tit_fir%></a></td>
 </tr>
  </table>
  </td></tr>
  <tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
<%call AsaiMHIs_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=ChannelIDs value='<%Response.Write iChannelIDs%>'>
  <input type=hidden name=AsaiMHMod value='<%Response.Write AsaiMHMod%>'>
  <input type=hidden name=ClassID value='<%Response.Write ClassID%>'>
  <tr>
  <td>搜索（<%Response.Write ntit%>） 关键字：</td>
  <td><input type=text name=keyword value='<%Response.Write Cls.Code_Query("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 size=1><option value='all'>满足所有条件</option><option value='only'>满足一个条件</option></seelct></td>
  <td><input type=submit value='搜索' class=btn></td>
  </tr>
  </form>
  </table>
</td></tr>
</table>
<%
Call AMH_Table(1)
If Action="handle" Then call AsaiMHGo_Handle()
Select Case LCase(Action)
  case "add"
    call disk_add()
  case "edit"
    call disk_edit()
  case "clear"
    call AsaiMHGo_Clear()
  case else
    call disk_list_main()
end select
call AMH_ender(1)
'-----------------------------------修改专辑-----------------------------------------
sub disk_edit()
  dim ispic,hidden,tim,SpecialID,username,hits,istop,Isfocus,words,lang,pcom
  dim Music_Music:Music_Music=split(Cls.ChannelOption,"|")
    sql="select * from AsaiMHMusicSinger where id="&n_id 
    set rs=Cls.exec(sql,1)
    nclassname=rs("name")
    rs.close
    sql="select top 1 * from "&Data_Name&" where id="&d_id
    call Cls.exec(sql,-1)
    rs.open sql,conn,1,3
    if rs.eof then
      rs.close
      call AMH_msg(tit_fir&"ID（"&id&"）不存在！","?",1)
      exit sub
      else
      name=rs("name")
      ptim=rs("ptim")
      SpecialID=rs("SpecialID")
      'username=rs("username")
      username=Cls.Code_Admin("username",1,20)
      if ChkName(username)=false then username=login_username
      tim=rs("tim")
      isgood=rs("isgood")
      istop=rs("istop")
      Isfocus=rs("Isfocus")
      hidden=rs("hidden")
      hits=rs("hits")
      words=rs("words")
      pcom=rs("pcom")
      lang=rs("lang")
    end if
    if chk() then
    if trim(request("name"))="" then 
      rs.close
      call AMH_error("歌手姓名不能为空！")
      exit sub
    end if
    rs("name")=trim(request.form("name"))
    rs("pcom")=trim(Request.Form("pcom"))
    rs("ptim")=trim(Request.Form("ptim"))
    rs("lang")=trim(Request.Form("lang"))
    rs("Classid")=Classid
    rs("n_id")=n_id
    rs("singer")=nclassname
    rs("words")=request.form("words")
    rs("tim")=Cls.now_time
    rs("pic")=Cls.code_admin("pic",1,100)
    rs("username")=username
    isgood=trim(request.form("isgood"))
    hidden=trim(request.form("hidden"))
    rs("hits")=Cls.Code_Int("counter",1)
    if isgood="yes" then
      rs("istop")=true
    else
      rs("istop")=false
    end if

    if hidden="yes" then
      rs("hidden")=false
    else
      rs("hidden")=true
    end if
    rs.update
   rs.close
'修改专辑中的歌曲资料
    sql="select * from AsaiMHMusicSong where d_id="&d_id 
    call Cls.exec(sql,-1) 
    rs.open sql,conn,1,3
    if not rs.EOF then
      do while not rs.EOF
        rs("Singer")=NClassname
        rs("ClassID")=Classid
        rs("n_id")=n_id
        rs.update
      rs.MoveNext
      loop
    end if
    rs.Close
    call AMH_msg("已成功编辑了一张专辑！","?ClassID="&ClassID&"&n_id="&n_id&"&ChannelIDs="&iChannelIDs,0)
'结束修改
    exit sub
    end if
    call form_first()
%>
<tr><td colspan=2 class=td>修改专集&nbsp;<%=nclassname%>&nbsp;的资料</td></tr>
<form method="POST" action="<%Response.Write PageUrl%>Action=edit&d_id=<%=d_id%>&ClassID=<%=ClassID%>&n_id=<%=n_id%>" name=edit_frm>
<input type=hidden name=chk value='yes'>
<tr>
<td>选择栏目：</td><td><%response.write sel_s_id("?ChannelIDs="&iChannelIDs&"&action=add",iChannelIDs,Cls.ClassDepth,ClassID)&sel_n_id("?ChannelIDs="&iChannelIDs&"&Action=edit&d_id="&d_id)%>
</td>
</tr>
<tr>
<td>专辑名称：</td><td><input type="text" name="name" value="<%=name%>" size=60 maxlength=50></td>
</tr>
<tr>
<td>发行时间：</td><td><input type="text" name="ptim" value="<%=ptim%>" size="20">&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(ptim);return false;"></td>
</tr>
<tr >
<td>相关属性：</td><td>发行公司：<select size=1 name=pcom><script language=javascript>
<!--
sel_type('<%response.write pcom%>','<%response.write Music_Music(9)%>');
-->
</script></select>
&nbsp;&nbsp;专辑语言：<select size=1 name=lang>
<script language=javascript>
<!--
sel_type('<%response.write lang%>','<%response.write Music_Music(10)%>');
-->
</script>
</select></td>
</tr>
<%
  Response.Write ShowSpecialSel(iChannelIDs,SpecialID)
  Response.Write ShowPutInfo(username,tim)
  Response.Write ShowRelateInfo(isgood,istop,Isfocus,hidden,hits)
  Response.Write ShowUBBEditor(iChannelIDs,"add_frm","words","介绍",words,"Basic",560,200)
  Response.Write ShowPicUpload(iChannelIDs,pic,"pic")
  Response.Write ShowUploadList()
    Call Submit_Edit()
end sub

'-----------------------------------添加专辑------------------------------------
sub disk_add()
  dim ispic,tim,hidden,Istop,username
  dim Music_Music:Music_Music=split(Cls.ChannelOption,"|")
    username=Cls.Code_Admin("username",1,20)
    if ChkName(username)=false then username=login_username
  if chk() then
    Sql="select * from AsaiMHMusicSinger where id="&n_id
    set rs=Cls.exec(sql,1)
    NClassname=rs("name")
    rs.close
    sql="select * from "&Data_Name&" where (id is null)"
    call Cls.exec(sql,-1) 
    rs.open sql,conn,1,3
    rs.addnew
    rs("ChannelIDs")=iChannelIDs
    rs("name")=trim(Request.Form("name"))
    rs("pcom")=trim(Request.Form("pcom"))
    if trim(Request.Form("ptim"))="" then
    rs("ptim")=""
    else
    rs("ptim")=trim(Request.Form("ptim"))
    end if
    rs("lang")=trim(Request.Form("lang"))
    rs("ClassID")=ClassID
    rs("n_id")=n_id
    rs("singer")=Nclassname
    rs("pic")=Cls.code_admin("pic",1,100)
    rs("words")=Request.Form("words")
    rs("hits")=Cls.Code_Int("counter",0)
    tim=Cls.code_admin("tim",1,20)
    tim=Cls.time_type(tim,1)
    if tim="" then tim=Cls.now_time
    rs("tim")=tim
    rs("username")=username
    isgood=trim(request.form("isgood"))
    hidden=trim(request.form("hidden"))
    if isgood="yes" then
      rs("istop")=true
    else
      rs("istop")=false
    end if
    if hidden="yes" then
      rs("hidden")=false
    else
      rs("hidden")=true
	  rs("counter")=0
    end if
    rs.update
    rs.close	
    call AMH_msg("已成功添加了一张专辑！","?AsaiMHMod="&AsaiMHMod&"&ClassID="&cid&"&n_id="&n_id&"&ChannelIDs="&iChannelIDS,0)
  else
    call form_first()
    call AMH_td("添加&nbsp;&nbsp;的专辑")
%>
<form method="POST" action="<%Response.Write PageUrl%>Action=add&ClassID=<%=ClassID%>&n_id=<%=n_id%>" name=add_frm><input type=hidden name=chk value='yes'>
<tr>
<td>选择栏目：</td><td><%response.write sel_s_id("?ChannelIDs="&iChannelIDs&"&action=add",iChannelIDs,Cls.ClassDepth,ClassID)&sel_n_id("?ChannelIDs="&iChannelIDs&"&action=add")%>
</td>
</tr>
<tr>
<td>专辑名称：</td><td ><input type="text" name="name" size="60" maxlength=50></td>
</tr>
<tr>
<td>发行时间：</td><td><input type="text" name="ptim" size="20">&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(ptim);return false;"></td>
</tr>
<tr>
<td>发布时间：</td><td><input type="text" name="tim" value="<%=now()%>" size=20 maxlength=40>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(tim);return false;">&nbsp;&nbsp;浏览：<input type="text" name="hits" value="0" size=5 maxlength=40>&nbsp;人次&nbsp;&nbsp;推荐：<input type=checkbox name=isgood value='yes'>&nbsp;&nbsp;隐藏/审核：<input type=checkbox name=hidden value='yes'></td>
</tr>
<tr>
<td>相关属性：</td><td>发行公司：<select size=1 name=pcom><script language=javascript>
<!--
sel_type('','<%response.write Music_Music(9)%>');
-->
</script></select>
&nbsp;&nbsp;专辑语言：<select size=1 name=lang>
<script language=javascript>
<!--
sel_type('','<%response.write Music_Music(10)%>');
-->
</script></select></td>
</tr>
<%
  Response.Write ShowSpecialSel(iChannelIDs,0)
  Response.Write ShowPutInfo(Login_username,Cls.Now_time)
  Response.Write ShowRelateInfo("",Istop,"",1,0)
  Response.Write ShowUBBEditor(iChannelIDs,"add_frm","words","内容","","Basic",560,200)
  Response.Write ShowPicUpload(iChannelIDs,"","pic")
  Response.Write ShowUploadList()
  call submit_add()
  end if
end sub
'-----------------------------------专辑列表--------------------------------------
sub disk_list_main()
Dim IncludeInfo,IsReview,topic,pageurl2,tcolor,obj_page
  response.write "<form name=sel_form action='"&PageUrl&"&ClassID="&c_id&"&s_id="&s_id&"&n_id="&n_id&"&Action=handle' method=post>" & _
             vbcrlf&"<tr align=center>" & _
             vbcrlf&"<td class=td width='7%'>序号</td>" & _
             vbcrlf&"<td class=td width='30%'>专辑名称及整理时间</td>" & _
             vbcrlf&"<td class=td width='12%'>所属歌手</td>" & _
             vbcrlf&"<td class=td  width='12%'>歌曲列表</td>" & _
             vbcrlf&"<td class=td width='7%'>点击</td>" & _
             vbcrlf&"<td class=td width='25%'>相关属性</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 n_id<>"" then
    
  sql_add=sql_add&" and n_id="+cstr(n_id)
  
  elseif c_id<>"" then
    
  sql_add=sql_add&" and c_id="+cstr(c_id)
  
  end if

  if types="sea" then
    sql_add=" where name like '%"& keyword &"%'"
  end if
  set obj_page=New Cls_pageCute
  obj_page.nummer=nummer
  obj_page.pageurl=pageurl
  obj_page.page_tit=tit_fir
  obj_page.page_unit="条"
  obj_page.v_id="id"
  call obj_page.p_init("n_id,id,ClassID,istop,name,tim,isgood,hidden,tcolor,hits,singer,Isfocus,cod,ispic",Data_Name,sql_add,"id desc")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
  call obj_page.p_main("n_id,id,ClassID,istop,name,tim,isgood,hidden,tcolor,hits,singer,Isfocus,cod,ispic",Data_Name,sql_add,"id desc")
  for i=1 to obj_page.page_num
      response.write "<tr align=center>" & _
             vbcrlf&"<td>"&i&"</td>" & _
             vbcrlf&"<td>" & _
             vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'><tr>" & _
             vbcrlf&"<td><a href='?"&PageUrl&"action=edit&d_id="&rs("id")&"&ClassID="&rs("ClassID")&"&n_id="&rs("n_id")&"'>"&rs("name")&"</a></td><td align=right><font class=tims>"&Cls.time_type(rs("tim"),4)&"</font></td>" & _
             vbcrlf&"</tr></table>" & _
             vbcrlf&"</td>" & _
             vbcrlf&"<td>"&rs("singer")&"</td>" & _
             vbcrlf&"<td><a href='AMH_Music_Song.asp?"&PageUrl&"d_id="&rs("id")&"&ClassID="&rs("ClassID")&"&n_id="&rs("n_id")&"'>歌曲列表</a></td>" & _
             vbcrlf&"<td>"&rs("hits")&"</td>" & _
             vbcrlf&"<td>"&pro_edit(PageUrl&"Action=edit&d_id="&rs("id")&"&ClassID="&rs("ClassID")&"&n_id="&rs("n_id"),"编辑该专辑") &"&nbsp;"& pro_hidden(rs("hidden"),1) &"&nbsp;"& pro_cod(rs("cod")) &"&nbsp;"& pro_isgood(rs("isgood")) &"&nbsp;"& pro_Isfocus(rs("Isfocus")) &"&nbsp;"& pro_istop(rs("istop")) &"&nbsp;"& pro_ispic(rs("ispic")) &"</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=2>" & _
    vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
    vbcrlf&"<tr class=tr1><td>"&obj_page.page_var&"</td><td width=3></td><td>分页：</td><td>"&obj_page.page_cute&"</td>" & _
    vbcrlf&"</tr>" & _
    vbcrlf&"</table>" & _
    vbcrlf&"</td>" & _
    vbcrlf&"<td colspan=5 align=center>执行<select name=sel_type size=1><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><input type=submit value='操作' onclick=""return sel_click(this.form);"" class=btn>" & _
    vbcrlf&"</td>" & _
    vbcrlf&"</tr>" & _
    vbcrlf&"</form>" & _
    vbcrlf&"</table>" & _
    vbcrlf&"</td>" & _
    vbcrlf&"</tr>"
end sub

%>
