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

Index_Url="Special"
Call AMH_Master(0,0)
Call AMH_Header(1)
tit=Cls.ChannelName&tit
Tit_Fir=Cls.ChannelTit&Tit_Fir
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><a href='?'><%Response.Write tit%></a></td>
  <td width=5></td>
<%
	Dim iListStr, Lii
	iListStr = Cls.Channel_Menu
	For Lii =0 To Ubound(iListStr,2)
	If Int(iListStr(5,Lii)) <> 2 And Not Cbool(iListStr(7,Lii)) And Cls.Get_ChannelSetup(iListStr(18,Lii),3) = 1 Then
			Response.Write "<td><a href='?ChannelIDs="&Int(iListStr(0,Lii))&"'"
			tit=iListStr(13,Lii)&tit_fir
			If Int(iChannelIDs) = Int(iListStr(0,Lii)) Then
				Response.Write " class=red"
			End If
			Response.Write ">"&tit&"</a></td>"
			Response.Write "<td width=5></td>"
		End If
	Next
	Erase iListStr
%>
</td></tr>
</table>
</td></tr>
<%
Call AMH_Table(1)
If action="handle" then Call AsaiMHGo_Handle()
Select Case LCase(Action)
Case "edit"
	AsaiMHSpecial_Edit()
Case "add"
	AsaiMHSpecial_Add()
Case Else
	AsaiMHSpecial_Main()
End Select
Call AMH_Ender(tit)
'//* 专题编辑 *//
Sub AsaiMHSpecial_Edit()
  sql="select top 1 * from "&data_name&" Where ChannelIDs="&iChannelIDs&" and id="&id
  call Cls.exec("",-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    call AMH_msg(tit_fir&"（ID："&id&"）不在存！","?ChannelIDs="&iChannelIDs,1)
    exit sub
  end if
  dim Topic,Pic,Tim,Remark,hidden
  if chk() then
    rs.update
    rs.close
    call AMH_msg("成功编辑一条"&tit_fir,"?ChannelIDs="&iChannelIDs,1)
    exit sub
  end if
  call form_first()
%>
<form name=add_frm action='?ChannelIDs=<%=iChannelIDs%>&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=Topic value='<%Response.Write rs("Topic")%>' size=30 maxlength=50><%Response.Write redx%></td>
</tr>
<tr valign=top>
<td><%Response.Write tit_fir%>简介：</td>
<td><textarea name=Remark rows=8 cols=65><%Response.Write Cls.Code_Word(rs("Remark"))%></textarea><%Response.Write redx%></td>
</tr>
<%
    Response.Write "<tr>"
    Response.Write "<td>"&tit_fir&"添加时间：</td>"
    Response.Write "<td>"
	Response.Write "<input type=text name=tim value='"&rs("tim")&"' size=30 maxlength=20>&nbsp;<input type=button name=st_btn value='选择' onclick='javascript:select_time(tim);return false;' class=btn>&nbsp;&nbsp;日期格式：<font class=blue>年-月-日 小时:分钟:秒"
	Response.Write "</td>"
%>
<tr>
<td>是否隐藏：</td>
<td><input type=checkbox name=hidden value='yes'<%if rs("hidden")=false then response.write " checked"%>> 选择表示隐藏该<%response.write tit_fir%></td>
</tr>
<%
  rs.close
  call submit_edit()
end sub
'//* 专题添加 *//
sub AsaiMHSpecial_Add()
  dim Topic,Tim,Remark,hidden
  call AMH_td("添加"&tit_fir)
  if chk() then
    Topic=Cls.Code_Admin("Topic",1,50)
    Remark=request.form("Remark")
    if Topic="" or Remark="" then
      call AMH_error(tit_fir&"标题 和 "&tit_fir&"标题 不能为空！")
      exit sub
    end if
    sql="select * from "&Data_Name&" where ChannelIDs="&iChannelIDs
    call Cls.exec("",-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("ChannelIDs")=iChannelIDs
    rs("Topic")=Topic
    rs("Remark")=Remark
    rs("tim")=Cls.now_time
    rs("hidden")=true
    rs.update
    rs.close
	Call Cls.Cache_Del("channel_special"&iChannelIDs)
	Call ReloadMenu(0)
    call AMH_msg("成功添加一条新的"&tit_fir,"?ChannelIDs="&iChannelIDs,1)
    exit sub
  end if
  call form_first()
%>
<form name=add_frm action='?ChannelIDs=<%=iChannelIDs%>&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=Topic size=30 maxlength=50><%Response.Write redx%></td>
</tr>
<tr valign=top>
<td><%Response.Write tit_fir%>简介：</td>
<td><textarea name=Remark rows=8 cols=65></textarea><%Response.Write redx%></td>
</tr>
<%
    Response.Write "<tr>"
    Response.Write "<td>"&tit_fir&"添加时间：</td>"
    Response.Write "<td>"
	Response.Write "<input type=text name=tim value='"&Cls.Now_time&"' size=30 maxlength=20>&nbsp;<input type=button name=st_btn value='选择' onclick='javascript:select_time(tim);return false;' class=btn>&nbsp;&nbsp;日期格式：<font class=blue>年-月-日 小时:分钟:秒"
	Response.Write "</td>"
%>
<tr>
<td>是否隐藏：</td>
<td><input type=checkbox name=hidden value='yes'> 选择表示隐藏该<%response.write tit_fir%></td>
</tr>
<%
  call submit_add()
end sub
Sub AsaiMHSpecial_Main()
  dim topic,pic,tim,hidden
  call AMH_td(tit_fir&"管理")
%>
<form name=sel_form action='?ChannelIDs=<%=iChannelIDs%>&Action=handle' method=post>
<tr align=center valign=top>
<td width='20%'>
  <table border=0>
  <tr><td height=30><%Response.Write img_admin("","")%>&nbsp;<%if iChannelIDs=0 then iChannelIDs=1%><a href='?ChannelIDs=<%=iChannelIDs%>&action=add'>添加新<%Response.Write tit_fir%></a></td></tr>
  </table>
</td>
<td width='80%'>
  <table cellspacing=1 cellpadding=3 class=table0>
  <tr align=center>
  <td class=td width='10%'>序号</td>
  <td class=td width='50%'><%Response.Write tit_fir%>标题</td>
  <td class=td width='20%'>添加时间</td>
  <td class=td width='15%'>状态</td>
  <td class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
  </tr>
<%
  dim obj_page
  set obj_page=new Cls_PageCute
  obj_page.pageurl=pageurl
  obj_page.nummer=nummer
  obj_page.page_t=1
  obj_page.page_p=5
  obj_page.page_unit="条"
  obj_page.page_tit=tit_fir
  obj_page.v_id="id"
  call obj_page.p_init("*",Data_Name,"ChannelIDs="&iChannelIDs,"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("*",Data_Name,"ChannelIDs="&iChannelIDs,"id desc")
  for i=1 to obj_page.page_num
    id=rs("id")
    iChannelIDs = Rs("ChannelIDs")
    topic=rs("topic")
	pic=rs("pic")
    tim=rs("tim")
	hidden=rs("hidden")
%>
  <tr class=tr align=center>
  <td class=tims><%Response.Write obj_page.page_now+i%></a></td>
  <td align=left><a href='?action=edit&ChannelIDs=<%=iChannelIDs%>&id=<%Response.Write id%>' title='<img src=<%Response.Write Cls.url_true("",pic)%> border=0 height=105>'><%Response.Write Cls.Code_Html(topic,1,(20+tnum))%></a></td>
  <td><font class=tims><%Response.Write Cls.time_type(rs("Tim"),4)%></font></td>
  <td align=left><%Response.Write pro_edit("?action=edit&ChannelIDs="&iChannelIDs&"&id="&id,"编辑该"&tit_fir)%>&nbsp;&nbsp;<%Response.Write 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>
  <table border=0>
  <tr class=tr1>
  <td></td>
  <td><%Response.Write obj_page.page_var%></td>
  <td width=3></td>
  <td>分页：</td>
  <td><%Response.Write obj_page.page_cute%></td>
  </tr>
  </table>
</td>
<td colspan=4 align=right>
执行
<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);" class=btn>
</td>
</tr>
</form>
  </table>
</td>
</tr>
<%
end sub
%>
