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

Index_Url="Err"
PageUrl = "?ChannelIDs="&iChannelIDs&"&"
Call AMH_Master(0,0)
Call AMH_Header(1)
dim Channelurl
Select Case int(iChannelIDs)
  Case "1"
  Channelurl="Article"
  Case "2"
  Channelurl="Down"
  Case "3"
  Channelurl="Shop"
  Case "5"
  Channelurl="Photo"
  Case Else
  Channelurl="Movie"
End Select
tit=Cls.ChannelName&tit
tit_fir=Cls.ChannelTit&tit_fir
%><tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td><%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),5) = 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><a href='<%=PageUrl%>action=clear' onclick="return click_return('清空该频道下所有的<%Response.Write tit_fir%>',0);">清空<%Response.Write tit_fir%></a></td>
  </tr>
  </table>
</td></tr>
</table>
<%
Call AMH_Table(1)
Select Case LCase(Action)
  Case "delete"
    AsaiMHChk_Delete()
  Case "reply"
    AsaiMHChk_Reply()
  Case "clear"
    AsaiMHChk_Clear()
  Case Else
    AsaiMHChk_Main()
End Select
Call AMH_Ender(tit_fir)

sub AsaiMHChk_Delete()
  dim sel_id,hdim,hnum,hid,hi
  Sel_id=Cls.Code_Admin("sel_id",1,0)
  Sel_id=Replace(Sel_id," ","")
  If Sel_id="" Then
	Call AMH_Msg("没有选择可操作的记录！",PageUrl,1)
	Exit Sub
  End If
  Call Cls.Exec("Delete * From ["&Data_Name&"] Where rid In("&Sel_id&") And ChannelIDs="&iChannelIDs,1)
  call AMH_event("删除 "&(hnum+1)&"条（"&tit_fir&"）记录")
  call AMH_msg("已成功删除操作了"&(hnum+1)&"条记录！","?ChannelIDs="&iChannelIDs,1)
end sub
sub AsaiMHChk_Clear()
  sql_add=" where ChannelIDs="&iChannelIDs
  sql="delete from "&Data_Name&sql_add
  call Cls.exec(sql,0)
  call AMH_event("删除 "&tit&" 报错的记录")
  call AMH_msg("已成功删除了"&tit&"报错的记录！","?ChannelIDs="&iChannelIDs,1)
end sub

sub AsaiMHChk_Reply()
  dim reword,types,isread,eid,url,ebody,topic
  sql="select top 1 * from "&Data_Name&" where rid="&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
  reword=trim(Request.Form("reword"))
  url="/"&Channelurl&"/View.asp?id="&rs("eid")
  if request.form("ischeck")="true" then
	ebody=ebody&vbcrlf&">本站已经修复所存在的错误，请再次访问！" & _
		vbcrlf& _
		vbcrlf&">修复后的地址为：" & _
		vbcrlf& Cls.web_url&url & _
		vbcrlf
  end if
  ebody=ebody&vbcrlf&"以下是本站给您的附言：" & _
		vbcrlf&"--------------------------------------------------------" & _
		vbcrlf&reword
  types=1
  isread=0
  if chk() then
     sql="insert into AsaiMHUserMail(send_u,accept_u,topic,word,tim,types,isread) " & _
	"values ('"&login_username&"','"&rs("eusername")&"','站内资源报错回复!','"&ebody&"','"&Cls.now_time&"',"&types&","&isread&")"
    call Cls.exec(sql,0)	
       sql="select id from AsaiMHUserData where username='"&rs("eusername")&"'"
       set rs=Cls.exec(sql,1)
       application(Cls.web_cookies&"_"&rs(0))=rs(0)
       rs.close
    call AMH_msg("成功回复了"&tit_fir&"（ID："&id&"）","?ChannelIDs="&iChannelIDs,1)
    exit sub
  end if
  call form_first()
%>
<form action='?ChannelIDs=<%Response.Write iChannelIDs%>&action=reply&id=<%Response.Write id%>' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td width='20%' class=td></td>
<td width='80%' class=td><%Response.Write tit_fir%>详细信息</td>
</tr>
<tr>
<td><%Response.Write tit_fir%>用户：</td>
<td><%Response.Write format_user_view(rs("eusername"),1,0)%></td>
</tr>
<tr>
<td>用户邮件：</td>
<td><a href='javascript:;' onclick=open_win('AsaiMHMail.asp?user=<%Response.Write rs("email")%>','','510','335','no')><%Response.Write rs("email")%></a></td>
</tr>
<tr>
<td><%Response.Write tit_fir%>时间：</td>
<td><%Response.Write rs("etim")%></td>
</tr>
<tr>
<td>简短留言：</td>
<td><%Response.Write Cls.Code_Html(rs("eword"),1,0)%></td>
</tr>
<tr>
<td><%Response.Write tit_fir%>回复：<br /><br />250字以内<br /><br />(发到用户短信中)</td>
<td><textarea name=reword cols=50 rows=6>感谢你对本站的支持！你所报告的有关:已经修复，请访问！</textarea></td>
</tr>
<td>是否修正：</td>
<td><input name=ischeck type=checkbox  value=true checked><font class=Gys>&nbsp;&nbsp;如错误已修正，请保持选择状态发消息，否则取消后发消息！</font></td>
</tr>
<%
  call submit_add()
  rs.close
end sub

sub AsaiMHChk_Main()
  dim rid,eusername,eword,email,rtype,etim,eid,sqle,action
%>
<form name=sel_form action='<%Response.Write PageUrl%>action=delete' method=post>
<tr align=center>
<td class=td width='5%'>序号</td>
<td class=td width='55%'><%Response.Write tit_fir%>简短留言</td>
<td class=td width='15%'><%Response.Write tit_fir%>时间</td>
<td class=td width='20%'>操作</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="rid"
  call obj_page.p_init("*",Data_Name,"ChannelIDs="&iChannelIDs,"rid 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,"rid desc")
  for i=1 to obj_page.page_num
    rid=rs("rid")
    eword=rs("eword")
    etim=rs("etim")
	eid=rs("eid")
%>
<tr align=center>
<td><%Response.Write obj_page.page_now+i%></td>
<td align=left><%Response.Write Cls.Code_Html(eword,1,0)%></td>
<td><%Response.Write "<font class=tims alt='"&Cls.time_type(etim,2)&"'>"&Cls.time_type(etim,1)&"</font>"%></td>
<td><a href='?ChannelIDs=<%Response.Write iChannelIDs%>&action=reply&id=<%Response.Write rid%>'><%Response.Write img_admin("reply","处理此条"&tit_fir)%></a>&nbsp;<a href='<%Response.Write Cls.Web_Dir&Channelurl%>/View.asp?id=<%Response.Write eid%>' target=_blank><%Response.Write img_admin("edit","查看此条"&tit_fir&"的前台信息")%></a>
&nbsp;<a href='?ChannelIDs=<%Response.Write iChannelIDs%>&action=list&id=<%Response.Write eid%>'><%Response.Write img_admin("istop","归类此条"&tit_fir)%></a>
&nbsp;<a href='AMH_<%Response.Write Channelurl%>.asp?AsaiMHMod=&ChannelIDs=<%Response.Write iChannelIDs%>&action=edit&id=<%Response.Write eid%>'><%Response.Write img_admin("sys","修复此"&tit_fir)%></a>
</td>
<td><input type=checkbox name=sel_id value='<%Response.Write rid%>'></td>
</tr>
<%
  rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=3>
  <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=2 align=center>
<select name=sel_type size=1>
<option value='删除'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);" class=btn>
</td>
</tr>
</form>
<%
end sub
%>
