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

dim ctell
del_user_true=true
del_upload_true=true
Index_Url="msing"
PageUrl = PageUrl&"ChannelIDs="&iChannelIDs&"&"
Call AMH_Master(1,2)
Call AMH_Header(1)

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 "clear"
  call AsaiMHGo_Clear()
case "add"
  call AsaiMHGo_add()
case "edit"
  call AsaiMHGo_edit()
case else
  call AsaiMHGo_main()
end select
call AMH_ender(1)

sub AsaiMHGo_edit()
dim preset:preset=split(Cls.ChannelPreset,"|||")
  dim dim_Ok:dim_Ok=split(Cls.ChannelOption,"|")
  dim name,tim,istop,pic,word,Comp,sex,abcd,bir,ispic,hidden,isgood,Isfocus,username
  call AMH_td("编辑"&tit_fir)
  sql="select top 1 * from "&Data_Name&" where id="&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
    ClassID=rs("ClassID")
  end if
  if chk() then
    name=Cls.code_admin("name",1,40)
    word=Cls.Code_Remark("word")
    csid=Cls.Code_Form("ClassID")
    if cs_nd(csid)=false then
      rs.close
      call AMH_error("请选择 "&tit_fir&"分类！<br />如有下级分类，请如实选择所属下级分类")
      exit sub
    End If
    if name="" or word="" then
      call AMH_error(tit_fir&"名称 和 "&tit_fir&"简介 不能为空！")
      exit sub
    end if
    sex=Cls.code_admin("sex",1,10)
    abcd=Cls.code_admin("abcd",1,10)
    Comp=Cls.code_admin("Comp",1,20)
    username=Cls.Code_Admin("username",1,20)
    if ChkName(username)=false then username=login_username
    tim=Cls.code_admin("tim",1,20)
    tim=Cls.time_type(tim,1)
    if tim="" then tim=Cls.now_time
    pic=Cls.code_admin("pic",1,100)
    ispic=true
    if pic="" then ispic=false
    istop=0
    if trim(request.form("istop"))="yes" then istop=1
    bir=Cls.code_admin("bir",1,20)
    if bir<>"" then call consview(bir)
    isgood=false
    if Cls.Code_Form("isgood")="yes" then isgood=true
	istop=0
    if Cls.Code_Form("istop")="yes" then istop=1
	Isfocus=false
    if Cls.Code_Form("Isfocus")="yes" then Isfocus=true
    hidden=true
    if Cls.Code_Form("hidden")="yes" then hidden=false
    Call Chk_Cid()
    rs("ClassID")=cid
    rs("name")=name
    rs("tim")=tim
    rs("username")=username
    rs("abcd")=abcd
    rs("Comp")=Comp
    if ctell<>"" then rs("ctell")=ctell
    rs("sex")=sex
    rs("bir")=Cls.time_type(bir,1)
    rs("pic")=pic
    rs("word")=word
    rs("isgood")=isgood
    rs("hidden")=hidden
    rs("ispic")=ispic
    rs("istop")=istop
	rs("Isfocus")=Isfocus
    rs.update
    rs.close
     sql="update AsaiMHMusicDisk set ClassID="&csid&" ,singer='"&name&"' where ClassID="&classid&""
     call Cls.exec(sql,0)
     sql="update AsaiMHMusicSong set ClassID="&csid&" ,singer='"&name&"' where ClassID="&classid&""
     call Cls.exec(sql,0)
    call AMH_msg("已成功编辑了一条"&tit_fir&"！","?AsaiMHMod="&AsaiMHMod&"&ClassID="&cid&"&ChannelIDs="&iChannelIDs,0)
    exit sub
  end if
  call form_first()
  cid=rs("ClassID")
  sid=rs("s_id")
  pic=rs("pic")

%>
<form name=add_frm action='?AsaiMHMod=<%response.write AsaiMHMod%>&ChannelIDs=<%=iChannelIDs%>&ClassID=<%Response.Write ClassID%>&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>相关属性：</td><td>字母索引：<select size="1" name="abcd"><script language=javascript>
<!--
sel_type('<%response.write rs("abcd")%>','<%response.write dim_Ok(7)%>');
-->
</script></select>&nbsp;&nbsp;性别：<select size="1" name="sex"><script language=javascript>
<!--
sel_type('<%response.write rs("sex")%>','<%response.write dim_Ok(8)%>');
-->
</script></select>&nbsp;&nbsp;隶属公司：<select size="1" name="Comp">
<script language=javascript>
<!--
sel_type('<%response.write rs("Comp")%>','<%response.write dim_Ok(9)%>');
-->
</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>
<%
  Response.Write ShowClassSel(iChannelIDs,rs("ClassID"),Cls.ClassDepth)
  Response.Write ShowPutInfo(rs("username"),rs("tim"))
  Response.Write ShowUBBEditor(iChannelIDs,"add_frm","word","内容",Cls.Code_Html(rs("word"),0,0),"Basic",560,200)
  Response.Write ShowPicUpload(iChannelIDs,pic,"pic")
  Response.Write ShowUploadList()
  call submit_edit()
  rs.close
end sub

sub AsaiMHGo_add()
    dim Name,keyes,Solves,jieuser,replys,username,tim,counter,istop,hidden,word,Reward,tcolor,Expired,pic,ispic,isgood,Isfocus,oSpecialID,Comp,sex,abcd,bir
  dim dim_Ok:dim_Ok=split(Cls.ChannelOption,"|")
  call AMH_td("添加"&tit_fir)
  if chk() then
    Name=Cls.code_admin("Name",1,50)
    word=Cls.Code_Remark("word")
    csid=Cls.Code_Form("ClassID")
    if cs_nd(csid)=false then
      call AMH_error("请选择 "&tit_fir&"分类！<br />如有下级分类，请如实选择所属下级分类")
      exit sub
    End If
    if name="" or word="" then
      call AMH_error(tit_fir&"名称 和 "&tit_fir&"简介 不能为空！")
      exit sub
    end if
    sex=Cls.code_admin("sex",1,10)
    abcd=Cls.code_admin("abcd",1,10)
    Comp=Cls.code_admin("Comp",1,20)
    username=Cls.Code_Admin("username",1,20)
    if ChkName(username)=false then username=login_username
    tim=Cls.code_admin("tim",1,20)
    tim=Cls.time_type(tim,1)
    if tim="" then tim=Cls.now_time
    pic=Cls.code_admin("pic",1,100)
    pic=Cls.code_admin("pic",1,100)
    ispic=true
    if pic="" then ispic=false
    'counter=Cls.Code_Int("counter",0)
    isgood=false
    if Cls.Code_Form("isgood")="yes" then isgood=true
	 istop=0
    if Cls.Code_Form("istop")="yes" then istop=1
	Isfocus=false
    if Cls.Code_Form("Isfocus")="yes" then Isfocus=true
    hidden=true
    if Cls.Code_Form("hidden")="yes" then hidden=false
    oSpecialID=Cls.Code_Int("SpecialID",0)
    bir=Cls.code_admin("bir",1,20)
    if bir<>"" then call consview(bir)
    Call Chk_Cid()
    sql="select * from "&Data_Name
    call Cls.exec(sql,-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("ChannelIDs")=iChannelIDs
    rs("SpecialID")=oSpecialID
    rs("ClassID")=cid
    rs("name")=name
    rs("username")=username
    rs("tim")=tim
    rs("abcd")=abcd
    rs("Comp")=Comp
    rs("ctell")=ctell
    rs("cod")=1
    rs("sex")=sex
    rs("bir")=Cls.time_type(bir,1)
    rs("pic")=pic
    rs("word")=word
    rs("isgood")=isgood
    rs("hidden")=hidden
    rs("istop")=istop
    rs("hidden")=hidden
    rs.update
    rs.close
    call AMH_msg("已成功添加了一条"&tit_fir&"！","?AsaiMHMod="&AsaiMHMod&"&ClassID="&cid&"&ChannelIDs="&iChannelIDS,0)
    exit sub
  end if
  call form_first()
%>
<form name=add_frm action='<%Response.Write PageUrl%>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>相关属性：</td><td>字母索引：<select size="1" name="abcd"><script language=javascript>
<!--
sel_type('','<%response.write dim_Ok(7)%>');
-->
</script></select>&nbsp;&nbsp;性别：<select size="1" name="sex"><script language=javascript>
<!--
sel_type('','<%response.write dim_Ok(8)%>');
-->
</script></select>&nbsp;&nbsp;隶属公司：<select size="1" name="Comp">
<script language=javascript>
<!--
sel_type('','<%response.write dim_Ok(9)%>');
-->
</script>
</select></td></tr>
<%
  Response.Write ShowClassSel(iChannelIDs,ClassID,Cls.ClassDepth)
  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","word","内容","","Basic",560,200)
  Response.Write ShowPicUpload(iChannelIDs,"","pic")
  Response.Write ShowUploadList()
	Call Submit_Add()
end sub

sub AsaiMHGo_main()
Dim IncludeInfo,IsReview,topic,pageurl2,tcolor,obj_page
  pageurl2=pageurl
  Call SQL_ClassID(sql_add)
  call format_search("name","name",2,1)
  Call AMH_Td(tit_fir&"列表")
%>
<tr valign=top align=center>
<td width='20%'>
  <table border=0 width='100%'>
  <tr><td height=5></td></tr>
  <tr><td class=htd><%Call Left_Channel_Class(pageurl2,iChannelIDs)%></td></tr>
  </table>
</td>
<td width='80%'>
  <table cellspacing=1 cellpadding=3 class=table0>
<form name=sel_form action='<%Response.Write PageUrl%>ClassID=<%Response.Write cid%>&Action=handle' method=post>
<tr align=center>
<td class=td width='10%'>序号</td>
<td class=td width='65%'><%Response.Write tit_fir%>标题及整理时间<%if keyword<>"" then Response.Write "（搜索结果："&keyword&"）"%></td>
<td class=td width='25%'>相关属性</td>
<td class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  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("id,s_id,ClassID,IncludeInfo,istop,Isfocus,name,ispic,tim,isgood,hidden,cod,tcolor",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("id,s_id,ClassID,IncludeInfo,istop,Isfocus,name,ispic,tim,isgood,hidden,cod,tcolor",Data_Name,sql_add,"id desc")
  for i=1 to obj_page.page_num
    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 i%></a></td>
<td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr>
  <td width='35%' align=center><a href='?AsaiMHMod=&ChannelIDs=<%=iChannelIDs%>&Action=edit&id=<%response.write id%>'><b><%response.write Cls.code_html(topic,1,(18+tnum))%><b></a></td>
  <td width='48%' align=center><font class=Gys>歌曲：<a href='AMH_Music_Song.asp?ChannelIDs=<%=iChannelIDs%>&Action=add&ClassID=<%=rs("ClassID")%>&n_id=<%=rs("id")%>'>添加</a>&nbsp;<a href='AMH_Music_Song.asp?ChannelIDs=<%=iChannelIDs%>&ClassID=<%=rs("ClassID")%>&n_id=<%=rs("id")%>'>列表</a>&nbsp;|&nbsp;专辑：<a href='AMH_music_disk.asp?ChannelIDs=<%=iChannelIDs%>&Action=add&ClassID=<%=rs("ClassID")%>&n_id=<%=rs("id")%>'>添加</a>&nbsp;<a href='AMH_music_disk.asp?ChannelIDs=<%=iChannelIDs%>&ClassID=<%=rs("ClassID")%>&n_id=<%=rs("id")%>'>列表</a></font>
  </td>
  <td width='17%' align=right><font class=tims><%response.write Cls.time_type(rs("tim"),4)%></font></td>
  </tr>
  </table>
</td>
<td align=left><%response.write pro_edit(PageUrl&"Action=edit&id="&id,"编辑该"&tit_fir) &"&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>
<td><input type=checkbox name=sel_id value='<%response.write id%>'></td>
</tr>
<%
    rs.movenext
  next
  rs.close
   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=4 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
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

%>
