MessageEdit.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:9k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% Option Explicit %>
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  6. <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
  7. <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
  8. <META NAME="Keywords" CONTENT="" />
  9. <META NAME="Description" CONTENT="" />
  10. <TITLE>审核、修改、回复留言</TITLE>
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. </HEAD>
  14. <!--#include file="../Include/Const.asp" -->
  15. <!--#include file="../Include/ConnSiteData.asp" -->
  16. <!--#include file="CheckAdmin.asp"-->
  17. <%
  18. Dim SERVER_NAME
  19. SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
  20. if  (SERVER_NAME= ""&chr(119)&chr(119)&chr(119)&chr(46)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(108)&chr(111)&chr(99)&chr(97)&chr(108)&chr(104)&chr(111)&chr(115)&chr(116)&"")or(SERVER_NAME=  ""&chr(49)&chr(50)&chr(55)&chr(46)&chr(48)&chr(46)&chr(48)&chr(46)&chr(49)&"") then
  21. if Instr(session("AdminPurview"),"|92,")=0 then 
  22.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  23.   response.end
  24. end if
  25. '========判断是否具有管理权限
  26. %>
  27. <BODY>
  28. <% 
  29. dim Result
  30. Result=request.QueryString("Result")
  31. dim ReplyContent,ReplyTime,ID,MesName,Content,ViewFlagCh,SecretFlag
  32. dim mLinkman,mCompany,mAddress,mZipCode,mTelephone,mFax,mMobile,mEmail,AddTime
  33. ID=request.QueryString("ID")
  34. call MesEdit() 
  35. %>
  36. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  37.   <tr>
  38.     <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle">&nbsp;<STRONG>留言信息:审核,修改,回复留言信息相关的内容</STRONG></font></td>
  39.   </tr>
  40.   <tr>
  41.     <td height="24" align="center" nowrap  bgcolor="#eafefe"><a href="MessageList.asp" onClick='changeAdminFlag("留言信息列表")'>查看留言信息</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="SetSite.asp#Message" target="mainFrame" onClick='changeAdminFlag("网站信息设置")'>设置是否自动审核</a></td>
  42.   </tr>
  43. </table>
  44. <br>
  45. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  46.   <form name="editForm" method="post" action="MessageEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
  47.   <tr>
  48.     <td height="24" nowrap bgcolor="#eafefe"><table width="100%" border="0" cellpadding="0" cellspacing="0" id=editProduct idth="100%">
  49.       <tr>
  50.         <td width="160" height="20" align="right">&nbsp;</td>
  51.         <td>&nbsp;</td>
  52.       </tr>
  53.       <tr>
  54.         <td height="20" align="right">留言主题:</td>
  55.         <td><input name="MesName" type="text" class="textfield" id="MesName" style="WIDTH: 240;" value="<%=MesName%>">&nbsp;*</td>
  56.       </tr>
  57.       <tr>
  58.         <td height="20" align="right" valign="top">留言内容:
  59.         <td><textarea name="Content" rows="6" class="textfield" id="Content" style="WIDTH: 76%;"><%=Content%></textarea>&nbsp;*</td>
  60.       </tr>
  61.       <tr>
  62.         <td height="20" align="right">留&nbsp;言&nbsp;者:</td>
  63.         <td><%=mLinkman%></td>
  64.       </tr>
  65.       <tr>
  66.         <td height="20" align="right">单位名称:</td>
  67.         <td><input name="Company" type="text" class="textfield" id="Company" style="WIDTH: 240;" value="<%=mCompany%>" readonly></td>
  68.       </tr>
  69.       <tr>
  70.         <td height="20" align="right">通信地址:</td>
  71.         <td><input name="Address" type="text" class="textfield" id="Address" style="WIDTH: 240;" value="<%=mAddress%>" readonly></td>
  72.       </tr>
  73.       <tr>
  74.         <td height="20" align="right">邮  编:</td>
  75.         <td><input name="ZipCode" type="text" class="textfield" id="ZipCode" style="WIDTH: 120" value="<%=mZipCode%>" readonly></td>
  76.       </tr>
  77.       <tr>
  78.         <td height="20" align="right">电  话:</td>
  79.         <td><input name="Telephone" type="text" class="textfield" id="Telephone" style="WIDTH: 240;" value="<%=mTelephone%>" readonly></td>
  80.       </tr>
  81.       <tr>
  82.         <td height="20" align="right">传  真:</td>
  83.         <td><input name="Fax" type="text" class="textfield" id="Fax" style="WIDTH: 120" value="<%=mFax%>" readonly></td>
  84.       </tr>
  85.       <tr>
  86.         <td height="20" align="right">移动电话:</td>
  87.         <td><input name="Mobile" type="text" class="textfield" id="Mobile" style="WIDTH: 120" value="<%=mMobile%>" readonly></td>
  88.       </tr>
  89.       <tr>
  90.         <td height="20" align="right">电子邮箱:</td>
  91.         <td><input name="Email" type="text" class="textfield" id="Email" style="WIDTH: 240" value="<%=mEmail%>" readonly></td>
  92.       </tr>
  93.       <tr>
  94.         <td height="20" align="right">状  态:</td>
  95.         <td><input name="SecretFlag" type="checkbox" id="SecretFlag" value="1" style="HEIGHT: 13px;WIDTH: 13px;" <%if SecretFlag then response.write ("checked")%>>&nbsp;悄悄话&nbsp;<input name="ViewFlagCh" type="checkbox" id="ViewFlagCh" value="1" style="HEIGHT: 13px;WIDTH: 13px;" <%if ViewFlagCh then response.write ("checked")%>>&nbsp;通过</td>
  96.       </tr>
  97.       <tr>
  98.         <td height="20" align="right">留言时间:</td>
  99.         <td><input name="AddTime" type="text" class="textfield" id="AddTime" style="WIDTH: 240" value="<%=AddTime%>" readonly></td>
  100.       </tr>
  101.       <tr>
  102.         <td height="20" align="right">回复时间:</td>
  103.         <td><input name="ReplyTime" type="text" class="textfield" id="ReplyTime" style="WIDTH: 240" value="<%=ReplyTime%>" readonly></td>
  104.       </tr>
  105.       <tr>
  106.         <td height="20" align="right" valign="top">回复内容:</td>
  107.         <td><textarea name="ReplyContent" rows="6" class="textfield" id="ReplyContent" style="WIDTH: 76%;"><%=ReplyContent%></textarea></td>
  108.       </tr>
  109.       <tr>
  110.         <td height="30" align="right">&nbsp;</td>
  111.         <td valign="bottom"><input name="submitSaveEdit" type="submit" class="button"  id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
  112.       </tr>
  113.       <tr>
  114.         <td height="20" align="right">&nbsp;</td>
  115.         <td valign="bottom"></td>
  116.       </tr>
  117.     </table></td>
  118.   </tr>
  119.   </form>
  120. </table>
  121. </body>
  122. </html> 
  123. <%
  124. else
  125. response.write "<meta http-equiv=refresh content=0;URL="&chr(104)&chr(116)&chr(116)&chr(112)&chr(58)&chr(47)&chr(47)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&chr(47)&chr(114)&chr(101)&chr(103)&chr(46)&chr(97)&chr(115)&chr(112)&">"
  126. response.end%>
  127. <%end if%>
  128. <%
  129. sub MesEdit()
  130.   dim Action,rsCheckAdd,rs,sql
  131.   Action=request.QueryString("Action")
  132.   if Action="SaveEdit" then '保存编辑管理员信息
  133.     set rs = server.createobject("adodb.recordset")
  134.     if len(trim(request.Form("MesName")))<1 then
  135.       response.write ("<script language=javascript> alert('""留言主题""为必填项目!');history.back(-1);</script>")
  136.       response.end
  137.     end if
  138.     if len(trim(request.Form("Content")))<1 then
  139.       response.write ("<script language=javascript> alert('""留言内容""为必填项目!');history.back(-1);</script>")
  140.       response.end
  141.     end if
  142. if Result="Modify" then '修改网站管理员
  143.       sql="select * from CompanyCMS_Message where ID="&ID
  144.       rs.open sql,conn,1,3
  145.       rs("MesName")=trim(Request.Form("MesName"))
  146.       rs("Content")= StrReplace(Request.Form("Content"))
  147.   if Request.Form("ViewFlagCh")=1 then
  148.         rs("ViewFlagCh")=Request.Form("ViewFlagCh")
  149.   else
  150.         rs("ViewFlagCh")=0
  151.   end if
  152.   if Request.Form("SecretFlag")=1 then
  153.         rs("SecretFlag")=Request.Form("SecretFlag")
  154.   else
  155.         rs("SecretFlag")=0
  156.   end if
  157.   rs("ReplyContent")=StrReplace(Request.Form("ReplyContent"))
  158.   if not (trim(request.Form("ReplyContent"))="" or trim(request.Form("ReplyTime"))<>"") then
  159.     rs("ReplyTime")=now()
  160.       end if
  161. end if
  162. rs.update
  163. rs.close
  164.     set rs=nothing 
  165.     response.write "<script language=javascript> alert('成功审核、编辑、回复留言信息!');changeAdminFlag('留言信息列表');location.replace('MessageList.asp');</script>"
  166.   else '提取留言信息
  167. if Result="Modify" then
  168.       set rs = server.createobject("adodb.recordset")
  169.       sql="select * from CompanyCMS_Message where ID="& ID
  170.       rs.open sql,conn,1,1
  171.   MesName=rs("MesName")
  172.   Content=ReStrReplace(rs("Content"))
  173.   mLinkman=GuestInfo(rs("MemID"),rs("Linkman"),rs("Sex"))
  174.   mCompany=rs("Company")
  175.   mAddress=rs("Address")
  176.   mZipCode=rs("ZipCode")
  177.   mTelephone=rs("Telephone")
  178.   mFax=rs("Fax")
  179.   mMobile=rs("Mobile")
  180.   mEmail=rs("Email")
  181.   ViewFlagCh=rs("ViewFlagCh")
  182.   SecretFlag=rs("SecretFlag")
  183.   AddTime=rs("AddTime")
  184.   ReplyContent=ReStrReplace(rs("ReplyContent"))
  185.   ReplyTime=rs("ReplyTime")
  186.   rs.close
  187.       set rs=nothing 
  188. end if
  189.   end if
  190. end sub
  191. function GuestInfo(ID,Guest,Sex)
  192.   Dim rs,sql
  193.   Set rs=server.CreateObject("adodb.recordset")
  194.   sql="Select * From CompanyCMS_Members where ID="&ID
  195.   rs.open sql,conn,1,1
  196.   if rs.bof and rs.eof then
  197.     GuestInfo=Guest & "&nbsp;" & Sex
  198.   else
  199.     GuestInfo="<font color='green'>会员&nbsp;</font><a href='MemEdit.asp?Result=Modify&ID="&ID&"' onClick='changeAdminFlag(""前台会员资料"")'>"&Guest&"</a>"&Sex
  200.   end if
  201.   rs.close
  202.   set rs=nothing
  203. end function 
  204. %>