<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_msg.asp
'* 最后更新 2013-03-01 by 56770.kingdge
'*****************************************
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_msg.inc"
include "lang/"& LangFilePath &"/lang_user.inc"
CurrentId = 4
CurrentUrl = "admin_msg.asp"
LB_Head()
LB_Menu()
action = request("action")
user_id = SafeReplace(request("user_id"))
m_type = SafeReplace(request("m_type"))
%>
<div class="tabmenu mainwidth">
	  <ul>
	  <%If user_id = "" Then%>
		<li <%If action = "" And m_type = "" Then Response.Write("class=""current""") End If%>><a href="admin_msg.asp"><span><%=Lang_Menu(117)%></span></a></li>
		<li <%If m_type = "1" Then Response.Write("class=""current""") End If%>><a href="?m_type=1"><span><%=Lang_Msg(14)%></span></a></li>
		<li <%If m_type = "2" Then Response.Write("class=""current""") End If%>><a href="?m_type=2"><span><%=Lang_Msg(15)%></span></a></li>
		<li <%If action = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_Menu(111)%></span></a></li>
	  <%Else%>
		<li><a href="admin_user.asp"><span><%=Lang_Menu(56)%></span></a></li>
		<li><a href="Admin_user.asp?action=view&user_id=<%=server.urlencode(user_id)%>"><span><%=user_id%></span></a></li>
		<li><a href="Admin_orders.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(58)%></span></a></li>
		<li><a href="Admin_user_log.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(59)%></span></a></li>
		<li><a href="Admin_user_account.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(154)%></span></a></li>
		<li class="current"><a href="Admin_msg.asp?action=add&user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(47)%></span></a></li>
	  <%End If%>
	  </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If OutSubmit = 1 Then CheckOutSubmit()
Select Case request("action")
       Case "add" : add()
	   Case "add_ok" : add_ok()
	   Case "re" : re()
	   Case "re_ok" : re_ok()
	   Case "del" : del()
	   Case "delmore" : delmore()
	   Case Else
	        main()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",7.1,"
        If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
                adminflag()
        Else
		        to_user = safereplace(Trim(request("to_user")))
				subject = Safereplace(trim(request("subject")))
				msg_content = Safereplace(request("msg_content"))
				Showlang = Safereplace(trim(request("Showlang")))
				user_grade = Replace(Safereplace(trim(request("user_grade")))," ","")
				If msg_content = "" Then
                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_Msg(1) &"');javascript:history.go(-1)</SCRIPT>"
						response.End
				End If
                If to_user <>"" Then
                        set rs = conn.execute("select * from [Lebi_user] where user_id='"& to_user &"'")
                        if rs.eof or rs.bof then
                                response.write"<SCRIPT language=JavaScript>alert('"& Lang_Msg(2) &"');javascript:history.go(-1)</SCRIPT>"
								response.End
                        Else
                                set rsm=server.CreateObject("adodb.recordset")
                                sqlm="select * from [Lebi_message]"
                                rsm.open sqlm,conn,1,3
                                rsm.addnew
                                rsm("to_user")=to_user
                                rsm("subject")=subject
                                rsm("msg")=msg_content
                                rsm("idate")=now()
                                rsm("user_id")="Admin"
                                rsm.update
                                rsm.close:Set rsm=Nothing
								ManageLog Lang_Msg(3) &" ["& to_user &"]"
                                Call Up_mes(Lang_Menu(174),"·"& Lang_Msg(4),0,"?",0,0,2,1)
                        End If
						rs.close : set rs=nothing
                Else
						sql = "select user_id from [Lebi_user] where 1=1"
						If Showlang <> "" Then sql = sql &" and LangName = '"& Showlang &"'"
						If user_grade <> "" And IsSqlDataBase = 1 Then sql = sql &" and charindex(user_grade,'"& user_grade &"')>0"
						If user_grade <> "" And IsSqlDataBase = 0 Then sql = sql &" and instr('"& user_grade &"',user_grade)>0"
						set rs = conn.execute(sql)
						do while not rs.eof
						conn.execute("insert into [Lebi_message] (to_user,user_id,subject,msg,idate) values('"&rs("user_id")&"','Admin','"& subject &"','"& msg_content &"',"& sqlnowstring &")")
						rs.movenext
						loop
						rs.close:set rs=Nothing
						If user_grade = "" Then 
								ManageLog Lang_Msg(5)
						Else
								ManageLog Lang_Msg(5) &" "& Lang_User(32) &"["& user_grade &"]"
						End If 
                        Call Up_mes(Lang_Menu(174),"·"& Lang_Msg(4),0,"?",0,0,2,1)
				End If
		End If
End Sub

Sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",7.2,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		Else
				id=safereplace(request("id"))
        		if id="" then
        		        response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
        		        response.end
        		end if
				conn.execute "delete from [Lebi_message] where id in (" & id &")"
				ManageLog Lang_Msg(6)
				m_u="admin_msg.asp?a=list&page="& request("page") &"&pagenum="& request("pagenum") &"&m_type="& request("m_type") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo")
				Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
		End If
End Sub

Sub delmore()
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",7.2,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		Else
		        user_id = safereplace(Trim(request("user_id")))
				msg_state = CheckNum(request("msg_state"),0)
				msg_date = CheckNum(request("msg_date"),30)
				sql = "delete from [Lebi_message] where "& sqlnowstring &"-idate>"& msg_date &""
				If InStr(msg_state,"0")> 0 Then
                        sql = sql &" and ifview = 0"
						mes = mes & Lang_Msg(7) &"、"
				End If
				If InStr(msg_state,"1")> 0 Then
                        sql = sql &" and ifview = 1"
						mes = mes & Lang_Msg(8) &"、"
				End If
				If InStr(msg_state,"2")> 0 Then
                        sql = sql &" and ifre = 0"
						mes = mes & Lang_Msg(9) &"、"
				End If
				If InStr(msg_state,"3")> 0 Then
                        sql = sql &" and ifre = 1"
						mes = mes & Lang_Msg(10) &"、"
				End If
				If user_id <> "" Then
                        sql = sql &" and (user_id = '"& user_id &"' or to_user = '"& user_id &"')"
						mes = mes & Lang_Msg(11) &"["&user_id&"] "
				End If
				conn.execute(sql)
				ManageLog Lang_Msg(6) &" ["&mes&"]"
				Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
		End If
End Sub

Sub re_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",7.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		Else
				to_user=Safereplace(trim(request("to_user")))
				user_id=Safereplace(trim(request("user_id")))
				subject=Safereplace(trim(request("subject")))
				ifre=1
				msg_content = Safereplace(request("msg_content"))
				conn.execute "insert into [Lebi_message] (subject,msg,idate,user_id,to_user,ifre)values('"&subject&"','"&msg_content&"',"&sqlnowstring&",'"&to_user&"', '"&user_id&"',1)"
				ManageLog Lang_Msg(12) &" ["& to_user &"]"
				Call Up_mes(Lang_Menu(174),"·"& Lang_Msg(4),0,"?",0,0,2,1)
		End If
End Sub

Sub main()
		admin_flag=",7.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		m_type = CheckNum(request("m_type"),0)
		m_view = safeReplace(request("m_view"))
		m_reply = safeReplace(request("m_reply"))
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		keyword = safeReplace(request("keyword"))
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="id"
		.Field="id,user_id,to_user,subject,ifview,idate,ifre"
		.Table="[Lebi_message]"
		sql = "1=1"
		If m_type = 1 Then sql = sql &" and (user_id = '管理员' or user_id = 'Admin')"
		If m_type = 2 Then sql = sql &" and (to_user = '管理员' or to_user = 'Admin')"
		If m_view = "0" Then sql = sql &" and ifview = 0"
		If m_view = "1" Then sql = sql &" and ifview = 1"
		If m_reply = "0" Then sql = sql &" and ifre = 0"
		If m_reply = "1" Then sql = sql &" and ifre = 1"
		if keyword<>"" then sql=sql&" and (user_id like '%"&keyword&"%' or to_user like '%"&keyword&"%' or subject like '%"&keyword&"%')"
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,idate,'"& datefrom &"')<=0 and DateDiff(d,idate,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',idate,'"& datefrom &"')<=0 and DateDiff('d',idate,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/MyCalendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<form name="form" action="?" method="get">
<tr>
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="m_type">
<option value="">┌ <%=Lang_Msg(13)%></option>
<option value="1"<%=judge2(1,m_type)%>>├ <%=Lang_Msg(14)%></option>
<option value="2"<%=judge2(2,m_type)%>>├ <%=Lang_Msg(15)%></option>
</select></td>
<td style="padding-left:5px;">
<select name="m_view">
<option value="">┌ <%=Lang_Msg(16)%></option>
<option value="0"<%=judge2(0,m_view)%>>├ <%=Lang_Msg(7)%></option>
<option value="1"<%=judge2(1,m_view)%>>├ <%=Lang_Msg(8)%></option>
</select></td>
<td style="padding-left:5px;">
<select name="m_reply">
<option value="">┌ <%=Lang_Msg(23)%></option>
<option value="0"<%=judge2(0,m_reply)%>>├ <%=Lang_Msg(9)%></option>
<option value="1"<%=judge2(1,m_reply)%>>├ <%=Lang_Msg(10)%></option>
</select></td>
<td style="padding-left:5px;"><input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" /></td>
<td style="padding-left:5px;"><input name="keyword" type="text" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
</tr>
</table>
</td>
<td align="right" class="classhead" height="30">
<%=QuickMenu("admin_msg.asp?action=add|"& Lang_Menu(111) &"","Admin_book.asp|"& Lang_Menu(57) &"")%>
</td>
</tr>
</form>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form" action="?action=del" method="post">
<tr>
<td height="30" align="left" colspan="3" class="classhead">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="m_type" value="<%=m_type%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
<td height="30" class="classhead" align="right" colspan="4"><%=ors.ShowPageHead(page)%></td>
<tr>
<td width="5%" height="30" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="javascript:selectallid('id');return false;"><%=Lang_sys(50)%></td>
<td width="5%" class="classtop"><%=Lang_Msg(16)%></td>
<td width="13%" class="classtop"><%=Lang_Msg(17)%></td>
<td width="13%" class="classtop"><%=Lang_Msg(18)%></td>
<td width="40%" class="classtop"><%=Lang_Msg(19)%></td>
<td width="15%" class="classtop"><%=Lang_Msg(20)%></td>
<td class="classtop"><%=Lang_Msg(21)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" id="id" type="checkbox" value="<%=DataList(0,i)%>"></td>
<td class="classrow"><%
If DataList(6,i) = 1 Then
		response.write "<img src=""images/mes_reply.gif"" title="""& Lang_Msg(10) &""" width=""16"">"
ElseIf DataList(4,i) = 0 Then
		response.write "<img src=""images/mes_new.gif"" title="""& Lang_Msg(22) &""" width=""16"">"
ElseIf DataList(4,i) = 1 Then
		response.write "<img src=""images/mes_view.gif"" title="""& Lang_Msg(8) &""" width=""16"">"
End If
%></td>
<td class="classrow"><%=DataList(1,i)%></td>
<td class="classrow"><%=DataList(2,i)%></td>
<td class="classrow"> <a href="?action=re&id=<%=DataList(0,i)%>" title="<%=Lang_Msg(23)%>"><%=DataList(3,i)%></a></td>
<td class="classrow"><%=DataList(5,i)%></td>
<td class="classrow"><a href="?action=re&id=<%=DataList(0,i)%>"><%=Lang_Msg(23)%></a></td>
</tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="3"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="4"><%=ors.ShowPageFoot(page)%></td>
</tr>
</tbody>
</table>
<script>tdshow("classtable");</script>
</div>
</div>
<div class="mainbody-block">
<div class="mainbody-block2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable_q" class="classtable" style="margin-top:5px;">
<form action="?action=delmore" method="post">
    <tr class="classrow">
       <td class="classrow" height="30" width="15%"><%=Lang_Msg(24)%></td>
	   <td class="classrow"><input type="text" name="user_id" value="" size="10" class="form"></td>
	   <td class="classrow" width="15%" align="center" rowspan="3">
	   <div style="width:100%;height:80px;padding-top:20px;border-left:#CCC 1px solid;text-align:center"><input type="submit" name="submit" value="<%=Lang_sys(15)%>" class="delmoremsg"></div>
	   </td>
   </tr>
    <tr class="classrow">
       <td class="classrow" height="30"><%=Lang_Msg(25)%></td>
	   <td class="classrow"><input type="checkbox" name="msg_state" value="0" size="10"> <%=Lang_Msg(7)%> <input type="checkbox" name="msg_state" value="1" size="10"> <%=Lang_Msg(8)%>  <input type="checkbox" name="msg_state" value="2" size="10"> <%=Lang_Msg(9)%> <input type="checkbox" name="msg_state" value="3" size="10"> <%=Lang_Msg(10)%></td>
   </tr>
    <tr class="classrow">
       <td class="classrow" height="30"><%=Lang_Msg(26)%></td>
	   <td class="classrow"><input type="text" name="msg_date" value="30" size="5" style="width:40px;" class="form"></td>
   </tr>
</form>
</table>
<script>tdshow("classtable_q");</script>
<%
End Sub

Sub add()
        admin_flag=",7.1,"
        If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
                adminflag()
        Else
%>
				<script language="JavaScript" type="text/JavaScript">
				function CheckForm(theform)
				{
					if (CheckEmpty('subject')){ShowMessage('subject','<%=Lang_Msg(27)%>');return false;}
					if (CheckEmpty('msg_content')){ShowMessage('msg_content','<%=Lang_Msg(37)%>');return false;}
				}
				</script>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable">
				<form name="form2" method="post" action="?action=add_ok" onSubmit="return CheckForm(this);">
				<tr>
				  <td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
				  <td class="classhead" align="right"> <%=QuickMenu("","admin_msg.asp|"& Lang_Menu(117) &"")%></td>
				 </tr>
				<tr>
				   <td class="classtop" height="30" colspan="2"><%=Lang_Msg(3)%></td>
				</tr>
				<tr class="classrow">
				<td width="15%" height="30" class="classrow"><%=Lang_Msg(24)%></td>
				<td width="85%" class="classrow"><input type="text" name="to_user" class="form" value="<%=request("user_id")%>"> <img src="images/help.gif" title="<%=Lang_Msg(38)%>" align="absmiddle"></td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow"><%=Lang_Msg(28)%></td>
				<td class="classrow">
				<select name="Showlang">
				<option value="" selected>┌ <%=Lang_Msg(13)%></option>
				<%For LangT = 1 To TotalLang%>
				<option value="<%= LanguageName(LangT) %>">├ <%= LanguageName(LangT) %></option>
				<%Next%>
				</select>
				</td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow"><%=Lang_User(32)%></td>
				<td class="classrow">
				<%
				sql="select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj"
				set rs_ug = conn.execute(sql)
				do while not rs_ug.eof
					Response.write("<INPUT TYPE=""checkbox"" NAME=""user_grade"" value="""&rs_ug("grade_dj")&"""> "&rs_ug("grade_name")&"&nbsp;")
					rs_ug.movenext
				Loop
				rs_ug.close:Set rs_ug = Nothing
				%>
				</td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow"><%=Lang_Msg(29)%></td>
				<td class="classrow">
				<input type="text" name="subject" id="subject" class="form" size="50"> <span id="mes_subject"></span>
				</td>
				</tr>
				<tr class="classrow" class="classrow">
				<td height="30" class="classrow" valign="top" style="padding-top:6px;"><%=Lang_Msg(30)%><div class="autosave"><span id="timemsg"></span><br /><span id="msg2"></span><br /><span id="msg"></span></div></td>
				<td class="classrow">
				<textarea name="msg_content" id="msg_content" cols="85" rows="16" class=html></textarea> <span id="mes_msg_content"></span>
				<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=msgsend&Lang="></SCRIPT>
				</td> 
				</tr>
				<tr>
				<td colspan="2" height="30" class="classfooter" align="left">
				<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
				</td>
				</tr>
				</form>
				</table>
				<script>tdshow("classtable");</script>
<%
		end if
End Sub

Sub re()
		admin_flag=",7.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		Else
				id=CheckNum(request("id"),0)
				sql="select * from [Lebi_message] where id="&id
				Set rss = conn.execute(sql)
				msg=rss("msg")
				subject=rss("subject")
				user=rss("user_id")
				rss.close
				set rss=nothing
%>
				<script language="JavaScript" type="text/JavaScript">
				function CheckForm(theform)
				{
					if (!isEmpty(theform.subject,'<%=Lang_Msg(27)%>')) return false;
				}
				</script>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable">
				<form name="form2" method="post" action="?action=re_ok" onSubmit="return CheckForm(this);">
				<tr>
				  <td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" border="0" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
				<td align="right" class="classhead"><%=QuickMenu("","")%></td>
				 </tr>
				<tr>
				   <td class="classtop" height="30" colspan="2"><%=Lang_Msg(12)%></td>
				</tr>
				<%
				if id <> 0 Then
				set rs=server.createobject("ADODB.Recordset")
				sql="select msg,subject, idate, to_user, user_id, ifre, ifview from [Lebi_message] where id=" & id
				rs.open sql, conn, 1, 3
				If rs("user_id") <> "管理员" And rs("user_id") <> "Admin" Then
						rs("ifview")=1
				End If
				rs.update
				subject=rs("subject")
				reuser="回复人："&rs("to_user")
				user=rs("user_id")
				to_user=rs("to_user")
				msg=rs("msg")
				idate=rs("idate")
				rs.close
				set rs=nothing
				end if%>
				<tr class="classrow">
				<td width="15%" height="30" class="classrow"><%=Lang_Msg(17)%></td>
				<td class="classrow">
				<%=user%>
				</td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow"><%=Lang_Msg(31)%></td>
				<td class="classrow">
				<%=idate%>
				</td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow"><%=Lang_Msg(29)%></td>
				<td class="classrow">
				<input type="text" name="subject" class="form" value="<% response.write"Re "&subject %>" size="50">
				</td>
				</tr>
				<tr class="classrow">
				<td height="30" class="classrow" valign="top" style="padding-top:6px;"><%=Lang_Msg(30)%><div class="autosave"><span id="timemsg"></span><br /><span id="msg2"></span><br /><span id="msg"></span></div>
				<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=msg"></SCRIPT></td>
				<td class="classrow">
				<textarea name="msg_content" id="msg_content" cols="85" rows="16" class=html>


---------------------
<%=msg%>
				</textarea>
				</td>
				</tr>
				<tr>
				<td colspan="2" height="30" class="classfooter" align="left">
				<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
				<input type="hidden" name="user_id" value="<%=user%>">
				<input type="hidden" name="to_user" value="<%=to_user%>">
				<input type="hidden" name="id" value="<%=id%>">
				</td>
				</tr>
				</form>
				</table>
				<script>tdshow("classtable");</script>
<%
		end if
End Sub
%>