<!-- #include file="include/admin_onlogin.asp" -->
<%

dim ctell
del_user_true=true
del_upload_true=true
index_url="msing"
call admin_master(1,0)
data_name="music_singer"
call admin_cid_sid()
call admin_header(0,0)
select case jk_mod
case "istop"
  ntit="推荐"&tit_fir
  sql_add=" where hidden=1 and istop=1"
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 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='?jk_mod=istop'<%if jk_mod="istop" then response.write " class=red"%>>推荐<%response.write tit_fir%></a></td>
  <td width=10></td>
  <td><a href='?action=add&c_id=<%response.write cid%>&s_id=<%response.write sid%>'<%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>
  <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='name'>按歌手名字</option>
  </select></td>
  <td><select name=sea_term size=1>
  <option value='all'>满足所有条件</option>
  <option value='only'>满足一个条件</option>
  </select></td>
  <td><input type=submit value='搜索'></td>
  </tr>
  </form>
  </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 "add"
  call joekoe_chk_add()
case "edit"
  call joekoe_chk_edit()
case else
  call joekoe_chk_main()
end select

call admin_ender(1)

sub joekoe_chk_edit()
  dim name,tim,istop,pic,word,comp,sex,abcd,bir,ispic,hidden,isgood
  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
    name=code_admin("name",1,40)
    word=request.form("word")
    csid=trim(request.form("c_id"))
    if cs_nd(csid)=false then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or word="" then
      call admin_error(tit_fir&"名称 和 "&tit_fir&"简介 不能为空！")
      exit sub
    end if
    sex=code_admin("sex",1,10)
    abcd=code_admin("abcd",1,10)
    comp=code_admin("comp",1,20)
    tim=code_admin("tim",1,20)
    tim=joekoe_cms.time_type(tim,1)
    if tim="" then tim=joekoe_cms.now_time
    pic=code_admin("pic",1,100)
    istop=0
    if trim(request.form("istop"))="yes" then istop=1
    bir=code_admin("bir",1,20)
    if bir<>"" then call consview(bir)
    call chk_cid_sid()
    rs("c_id")=cid
    rs("s_id")=sid
    rs("name")=name
    rs("tim")=tim
    rs("abcd")=abcd
    rs("comp")=comp
    if ctell<>"" then rs("ctell")=ctell
    rs("sex")=sex
    rs("bir")=joekoe_cms.time_type(bir,1)
    rs("pic")=pic
    rs("word")=word
    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
    end if
    rs.update
    rs.close
    call upload_note(index_url,id)
    call admin_msg("已成功编辑了一条"&tit_fir&"！","?jk_mod="&jk_mod&"&c_id="&cid&"&s_id="&sid,0)
    exit sub
  end if
  call form_first()
  cid=rs("c_id")
  sid=rs("s_id")
  pic=rs("pic")
  ispic=apart_filename(pic,1,"/")
  if ispic="" then ispic=joekoe_cms.rand_file(index_url)
%>
<form name=add_frm action='?jk_mod=<%response.write jk_mod%>&c_id=<%response.write cid%>&s_id=<%response.write sid%>&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=name value='<%response.write rs("name")%>' size=60 maxlength=40><%response.write redx%></td>
</tr>
<tr>
<td><%response.write tit_fir%>分类：</td>
<td><%call chk_csid(nsort,cid,sid)%></td>
</tr>
<tr>
<td>相关属性：</td>
<td>字母索引：<select size="1" name="abcd">
<%
for i=65 to 90 Step 1
%>
<option value="<%=chr(i)%>" <%if chr(i)=rs("abcd") then%> selected<%end if%>><%=chr(i)%></option>
<%Next%>       
</select>&nbsp;&nbsp;性别：<select size="1" name="sex"><script language=javascript>
<!--
sel_type('<%response.write rs("sex")%>','男|女|组合');
-->
</script></select>&nbsp;&nbsp;隶属公司：<select size="1" name="comp">
<script language=javascript>
<!--
sel_type('<%response.write rs("comp")%>','<%response.write web_dim(32)%>');
-->
</script>
</select></td>
</tr>
<tr>
<td><%response.write tit_fir%>生日：</td>
<td><input type=text name=bir size=20 maxlength=20 value='<%response.write rs("bir")%>'>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(bir);return false;"></td>
</tr>
<td>发布时间：</td>
<td><input type=text name=tim value='<%response.write rs("tim")%>' size=20 maxlength=20>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(tim);return false;">&nbsp;&nbsp;推荐：<input type=checkbox name=isgood value='yes'<%if rs("istop")=true then response.write " checked"%>>&nbsp;&nbsp;隐藏/审核：<input type=checkbox name=hidden<%if rs("hidden")=false then response.write " checked"%>></td>
</tr>
<%call html_edit("","add_frm","word","")%>
<tr>
<td valign=top><%response.write tit_fir%>内容：</td>
<td>
<table border=0><tr>
<td><textarea name=word rows=6 cols=65><%response.write joekoe_cms.code_word(rs("word"))%></textarea></td>
<td width=5></td>
<td valign=bottom><%call textarea_resize("word")%></td>
</tr></table>
</td>
</tr>
<tr>
<td><%response.write tit_fir%>图片：</td>
<td><input type=text name=pic value='<%response.write pic%>' size=40 maxlength=100>&nbsp;&nbsp;&nbsp;<a href='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write ispic%>&uptext=pic' target=upload_frame>上传图片</a>&nbsp;&nbsp;<a href='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write left(index_url,1)%>&uptext=word' target=upload_frame>上传至内容</a></td>
</tr>
<tr>
<td>上传图片：</td>
<td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write ispic%>&uptext=pic'></iframe></td>
</tr>
<%
  call submit_edit()
  rs.close
end sub

sub joekoe_chk_add()
  dim name,tim,istop,pic,word,comp,sex,abcd,bir,ispic,hidden,isgood
  call admin_td("添加"&tit_fir)
  if chk() then
    name=code_admin("name",1,40)
    word=request.form("word")
    csid=trim(request.form("c_id"))
    if cs_nd(csid)=false then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or word="" then
      call admin_error(tit_fir&"名称 和 "&tit_fir&"简介 不能为空！")
      exit sub
    end if
    sex=code_admin("sex",1,10)
    abcd=code_admin("abcd",1,10)
    comp=code_admin("comp",1,20)
    tim=code_admin("tim",1,20)
    tim=joekoe_cms.time_type(tim,1)
    if tim="" then tim=joekoe_cms.now_time
    pic=code_admin("pic",1,100)
    istop=0
    if trim(request.form("istop"))="yes" then istop=1
    bir=code_admin("bir",1,20)
    if bir<>"" then call consview(bir)
    call chk_cid_sid()
    sql="select * from "&data_name
    call joekoe_cms.exec(sql,-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("c_id")=cid
    rs("s_id")=sid
    rs("name")=name
    rs("tim")=tim
    rs("abcd")=abcd
    rs("comp")=comp
    rs("ctell")=ctell
    rs("sex")=sex
    rs("bir")=joekoe_cms.time_type(bir,1)
    rs("pic")=pic
    rs("word")=word
    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
    end if
    rs.update
    rs.close
    call upload_note(index_url,first_id(data_name,"id"))
    call admin_msg("已成功添加了一条"&tit_fir&"！","?jk_mod="&jk_mod&"&c_id="&cid&"&s_id="&sid,0)
    exit sub
  end if
  call form_first()
  ispic=joekoe_cms.rand_file(index_url)
%>
<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=name size=60 maxlength=40><%response.write redx%></td>
</tr>
<tr>
<td><%response.write tit_fir%>分类：</td>
<td><%call chk_csid(nsort,cid,sid)%></td>
</tr>
<tr>
<td>相关属性：</td>
<td>字母索引：<select size="1" name="abcd">
<%
for i=65 to 90 Step 1
%>
<option value="<%=chr(i)%>"><%=chr(i)%></option>
<%Next%>       
</select>&nbsp;&nbsp;性别：<select size="1" name="sex"><option value="男">男</option><option value="女">女</option><option value="组合">组合</option></select>&nbsp;&nbsp;隶属公司：<select size="1" name="comp">
<script language=javascript>
<!--
sel_type('','<%response.write web_dim(32)%>');
-->
</script>
</select></td>
</tr>
<tr>
<td><%response.write tit_fir%>生日：</td>
<td><input type=text name=bir size=20 maxlength=20>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(bir);return false;"></td>
</tr>
<tr>
<td>发布时间：</td>
<td><input type=text name=tim value='<%response.write joekoe_cms.now_time%>' size=20 maxlength=20>&nbsp;<input type=button name=st_btn value="选择" onclick="javascript:select_time(tim);return false;">&nbsp;&nbsp;推荐：<input type=checkbox name=isgood value='yes'>&nbsp;&nbsp;隐藏/审核：<input type=checkbox name=hidden value='yes'></td>
</tr>
<%call html_edit(1,"add_frm","word","")%>
<tr>
<td valign=top><%response.write tit_fir%>简介：</td>
<td>
<table border=0><tr>
<td><textarea name=word rows=6 cols=65></textarea></td>
<td width=5></td>
<td valign=bottom><%call textarea_resize("word")%></td>
</tr></table>
</td>
</tr>
<tr>
<td><%response.write tit_fir%>相片：</td>
<td><input type=text name=pic value='<%response.write pic%>' size=40 maxlength=100>&nbsp;&nbsp;&nbsp;<a href='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write ispic%>&uptext=pic' target=upload_frame>上传相片</a>&nbsp;&nbsp;<a href='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write left(index_url,1)%>&uptext=word' target=upload_frame>上传至内容</a></td>
</tr>
<tr>
<td>上传相片：</td>
<td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=<%response.write index_url%>&upname=<%response.write ispic%>&uptext=pic'></iframe></td>
</tr>
<%
  call submit_add()
end sub

sub joekoe_chk_main()
  dim topic,pageurl2
  pageurl2=pageurl
  call sql_cid_sid(sql_add)
  call format_search("name","name",2,1)
%>
<tr valign=top align=center>
<td width='20%'>
  <table class=table2>
  <tr><td><%response.write img_admin("s_left_sort","")%> <a href='?jk_mod=<%response.write jk_mod%>'><%response.write ntit%></a></td></tr>
  <tr><td height=5></td></tr>
  <tr><td class=htd><%call left_sort(pageurl2,"")%></td></tr>
  </table>
</td>
<td width='80%'>
  <table cellspacing=1 cellpadding=1 class=table0>
<form name=sel_form action='?jk_mod=<%response.write jk_mod%>&action=handle&c_id=<%response.write cid%>&s_id=<%response.write sid%>' 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"
  set rs=server.createobject("adodb.recordset")
  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
    id=rs("id")
    topic=rs("name")
%>
<tr align=center>
<td class=tims><a href='<%response.write index_url%>_view.asp?id=<%response.write id%>' target=_blank><%response.write (viewpage-1)*nummer+i%></a></td>
<td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr>
  <td width='15%' align=center><a href='?jk_mod=<%response.write jk_mod%>&action=edit&id=<%response.write id%>'><b><%response.write joekoe_cms.code_html(topic,1,(18+tnum))%><b></a></td>
  <td width='65%' align=center><font class=gray>歌曲：<a href='admin_music_song.asp?action=add&c_id=<%=rs("c_id")%>&s_id=<%=rs("s_id")%>&n_id=<%=rs("id")%>'>添加</a>&nbsp;<a href='admin_music_song.asp?c_id=<%=rs("c_id")%>&s_id=<%=rs("s_id")%>&n_id=<%=rs("id")%>'>列表</a>&nbsp;|&nbsp;专辑：<a href='admin_music_disk.asp?action=add&c_id=<%=rs("c_id")%>&s_id=<%=rs("s_id")%>&n_id=<%=rs("id")%>'>添加</a>&nbsp;<a href='admin_music_disk.asp?c_id=<%=rs("c_id")%>&s_id=<%=rs("s_id")%>&n_id=<%=rs("id")%>'>列表</a></font>
  </td>
  <td width='20%' align=right><font class=tims><%response.write joekoe_cms.time_type(rs("tim"),4)%></font></td>
  </tr>
  </table>
</td>
<td align=left><%response.write pro_edit("?jk_mod="&jk_mod&"&action=edit&id="&id,"编辑该"&tit_fir) &"&nbsp;"&pro_hidden(rs("hidden"),1)&"&nbsp;"& pro_istop(rs("istop")) &"&nbsp;"%></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>
&nbsp;现有<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>
执行&nbsp;&nbsp;
<select name=sel_type size=1>
<option value='推荐'>推荐</option>
<option value='取消推荐'>取消推荐</option>
<option value='审核'>审核</option>
<option value='待审核'>待审核</option>
<option value='删除'>删除</option>
</select>&nbsp;&nbsp;
<input type=submit value='操作' onclick="return sel_click(this.form);">
</td>
</tr>
</form>
  </table>
</td>
</tr>
<%
end sub

sub consview(bir)
 dim bmonth,bday
 bmonth=month(bir)
 bday=day(bir)
  if bmonth="" or bmonth="" then
    ctell=""
  elseif (bmonth=12 and bday>=22) or (bmonth=1 and bday<=19)  then
    ctell= "山羊座"
  elseif (bmonth=1 and bday>=20)  or (bmonth=2 and bday<=18)  then
    ctell= "水瓶座"
  elseif (bmonth=2 and bday>=19)  or (bmonth=3 and bday<=20)  then
    ctell= "双鱼座"
  elseif (bmonth=3 and bday>=21)  or (bmonth=4 and bday<=19)  then
    ctell= "白羊座"
  elseif (bmonth=4 and bday>=20)  or (bmonth=5 and bday<=20)  then
    ctell= "金牛座"
  elseif (bmonth=5 and bday>=21)  or (bmonth=6 and bday<=20)  then
    ctell= "双子座"
  elseif (bmonth=6 and bday>=21)  or (bmonth=7 and bday<=22)  then
    ctell= "巨蟹座"
  elseif (bmonth=7 and bday>=23)  or (bmonth=8 and bday<=22)  then
    ctell= "狮子座"
  elseif (bmonth=8 and bday>=23)  or (bmonth=9 and bday<=22)  then
    ctell= "处女座"
  elseif (bmonth=9 and bday>=23)  or (bmonth=10 and bday<=22) then
    ctell= "天枰座"
  elseif (bmonth=10 and bday>=23) or (bmonth=11 and bday<=21) then
    ctell= "天蝎座"
  elseif (bmonth=11 and bday>=22) or (bmonth=12 and bday<=21) then
    ctell= "射手座"
  end if
end sub

%>