<!--#include file="../Inc/Consts.inc" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/strfunc.Asp" -->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<script language="javascript" src="Admin.js"></script>
<script language="javascript" src="javascript/date.js"></script>
<%
If InStr(SsMasterPurview, "|23,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
Dim Result
Result = request.QueryString("Result")
Dim ReplyContent, ReplyTime, ID, MesName, Content, ViewFlag, SecretFlag
Dim mLinkman, mCompany, mAddress, mZipCode, mTelephone, mFax, mMobile, mEmail, AddTime
ID = request.QueryString("ID")
Call MesEdit()
%>
<br />
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="editForm" method="post" action="Ss_MessageEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【审核、回复留言】</th>
    </tr>
    <tr>
      <td width="20%" align="right" class="forumRow">留言标题：</td>
      <td width="80%" class="forumRowHighlight"><input name="MesName" type="text" id="MesName" style="width: 280" value="<%=MesName%>" maxlength="250"> <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">留言内容：</td>
      <td class="forumRowHighlight"><textarea name="Content" rows="8" id="Content" style="width: 500"><%=Content%></textarea> <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">留言人：</td>
      <td class="forumRowHighlight"><%=mLinkman%></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">单位名称：</td>
      <td class="forumRowHighlight"><input name="Company" type="text" style="width: 250" value="<%=mCompany%>" maxlength="250" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">通信地址：</td>
      <td class="forumRowHighlight"><input name="Address" type="text" style="width: 250" value="<%=mAddress%>" maxlength="250" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">邮政编码：</td>
      <td class="forumRowHighlight"><input name="ZipCode" type="text" style="width: 80" value="<%=mZipCode%>" maxlength="80" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">联系电话：</td>
      <td class="forumRowHighlight"><input name="Telephone" type="text" style="width: 180" value="<%=mTelephone%>" maxlength="180" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">传真号码：</td>
      <td class="forumRowHighlight"><input name="Fax" type="text" style="width: 180" value="<%=mFax%>" maxlength="180" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">手机号码：</td>
      <td class="forumRowHighlight"><input name="Mobile" type="text" style="width: 180" value="<%=mMobile%>" maxlength="180" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">电子信箱：</td>
      <td class="forumRowHighlight"><input name="Email" type="text" style="width: 180" value="<%=mEmail%>" maxlength="180" readonly></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">当前状态：</td>
      <td class="forumRowHighlight"><input name="ViewFlag" type="checkbox" id="ViewFlag" value="1" <%if ViewFlag then response.write ("checked")%>>
      通过审核</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">留言时间：</td>
      <td class="forumRowHighlight"><input name="AddTime" type="text" style="width: 180" value="<%=AddTime%>" maxlength="180" readonly onClick="setDay(this);"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">回复时间：</td>
      <td class="forumRowHighlight"><input name="ReplyTime" type="text" style="width: 180" value="<%=ReplyTime%>" maxlength="180" readonly onClick="setDay(this);"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">回复内容：</td>
      <td class="forumRowHighlight"><textarea name="ReplyContent" rows="8" id="ReplyContent" style="width: 500"><%=ReplyContent%></textarea></td>
    </tr>
    <tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" value="保存"> <input type="button" value="返回上一页" onclick="history.back(-1)"></td>
    </tr>
  </form>
</table>
<%
Sub MesEdit()
    Dim Action, rsCheckAdd, rs, sql
    Action = request.QueryString("Action")
    If Action = "SaveEdit" Then
        If Len(Trim(request.Form("MesName")))<1 Then Call Alert("请填写留言标题！","b-1"):response.End
        If Len(Trim(request.Form("Content")))<1 Then Call Alert("请填写留言内容！","b-1"):response.End
        If Result = "Modify" Then
            sql = "select * from ["&Datapre&"_Message] where ID="&ID
            set rs=db(sql,3)
            rs("MesName") = Trim(Request.Form("MesName"))
            rs("Content") = StrReplace(Request.Form("Content"))
            If Request.Form("ViewFlag") = 1 Then
                rs("ViewFlag") = 1
            Else
                rs("ViewFlag") = 0
            End If
            rs("ReplyContent") = StrReplace(Request.Form("ReplyContent"))
                if request.Form("RelpyTime")="" then 
				rs("ReplyTime") = Now()
				else
				rs("ReplyTime")=request.Form("replytime")
				end if
           
        End If
        rs.update
        rs.Close:Set rs = Nothing
        Call Alert("审核、回复成功！","Ss_MessageList.asp")
    Else
        If Result = "Modify" Then
            sql = "select * from ["&Datapre&"_Message] where ID="& ID
            set rs=db(sql,2)
            MesName = rs("MesName")
            Content = ReStrReplace(rs("Content"))
            mLinkman = rs("Linkman")&"("&rs("Sex")&")"
            mCompany = rs("Company")
            mAddress = rs("Address")
            mZipCode = rs("ZipCode")
            mTelephone = rs("Telephone")
            mFax = rs("Fax")
            mMobile = rs("Mobile")
            mEmail = rs("Email")
            ViewFlag = rs("ViewFlag")
            AddTime = rs("AddTime")
            ReplyContent = ReStrReplace(rs("ReplyContent"))
            ReplyTime = rs("ReplyTime")
            rs.Close: Set rs = Nothing
        End If
    End If
End Sub
%>