<!--#include file="Include/Const.Asp" -->
<!--#include file="Include/NoSQL.Asp" -->
<!--#include file="Include/ConnSiteData.Asp" -->
<%Call SiteInfo()%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的留言 - <% =SiteTitle %></title>
<meta name="keywords" content="<% =Keywords %>" />
<meta name="description" content="<% =Descriptions %>" />
<link href="css/public.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<!--#include file="Top.Asp" -->
<%
If Not (session("MemName")<>"" And session("MemLogin") = "Succeed") Then
    response.Write "<script language=javascript>alert('请先登录！');location.href='Index.Asp';</script>"
    response.End
End If
%>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:1px; background:url(images/main_bg.jpg) repeat-x;">
  <tr>
    <td width="230" align="left" valign="top" style="background:url(images/left_bg.gif) repeat-y right;"><table width="190" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:19px;">
        <tr>
          <td width="190"><img src="images/left_nav.gif" width="190" height="28" /></td>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF"><div id="nav"><%=WebMenu()%></div></td>
        </tr>
        <tr>
          <td height="18">&nbsp;</td>
        </tr>
      </table>
      <!--#include file="Center_Left.Asp" --></td>
    <td width="773" valign="top"><table width="733" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:19px;">
        <tr>
          <td width="733" style="background:url(images/bg1.gif) repeat-x left bottom;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="100%" align="right" style="color:#999999"><img src="images/arr6.gif" width="9" height="9" align="absmiddle" /><%=WebLocation()%></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td height="18">&nbsp;</td>
        </tr>
          <td height="20"><%=WebContent()%></td>
        </tr>
        <tr>
          <td height="20">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="End.Asp"-->
<%
Function WebMenu()
    If session("MemName") = "" Or session("GroupID") = "" Or session("MemLogin")<>"Succeed" Then
        response.Write "<a href=""MemberRegister.Asp"">注册会员</a>"
    Else
        response.Write "<a href=""MemberInfo.Asp"">修改注册资料</a>"
        response.Write "<a href=""MemberMessage.Asp"">我的留言</a>"
        response.Write "<a href=""MemberOrder.Asp"">我的订单</a>"
        response.Write "<a href=""MemberTalent.Asp"">我的应聘</a>"
        response.Write "<a href=""MemberLogin.Asp?Action=Out"">退出登录</a>"
    End If
End Function

Function WebLocation()
    WebLocation = "&nbsp;当前位置：<a href=""index.Asp"" class=""agray"">首页</a> - <a href=""MemberCenter.Asp"" class=""agray"">会员中心</a> - 我的留言"&vbCrLf
End Function

Function WebContent()
    Dim idCount
    Dim pages
    pages = 8
    Dim pagec
    Dim page
    page = CLng(request("Page"))
    Dim pagenc
    pagenc = 5
    Dim pagenmax
    Dim pagenmin
    Dim pageprevious
    Dim pagenext
    Dim datafrom
    datafrom = "Shenbi_Message "
    Dim datawhere
    datawhere = "where MemID="&conn.Execute("select * from Shenbi_Members where MemName='"&session("MemName")&"'")("ID")&" "
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")'
    If QUERY_STRING = "" Then
        Myself = PATH_INFO & "?"
    ElseIf InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?" & QUERY_STRING & "&"
    Else
        Myself = Left(PATH_INFO & "?" & QUERY_STRING, InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") -1)
    End If
    Dim taxis
    taxis = "order by id desc "
    Dim i
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select count(ID) as idCount from ["& datafrom &"]" & datawhere
    Set rs = server.CreateObject("adodb.recordset")
    rs.Open sql, conn, 0, 1
    idCount = rs("idCount")
    If(idcount>0) Then
    If(idcount Mod pages = 0)Then
    pagec = Int(idcount / pages)
Else
    pagec = Int(idcount / pages) + 1
End If
sql = "select id from ["& datafrom &"] " & datawhere & taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 1, 1
rs.pagesize = pages
If page < 1 Then page = 1
If page > pagec Then page = pagec
If pagec > 0 Then rs.absolutepage = page
For i = 1 To rs.pagesize
    If rs.EOF Then Exit For
    If(i = 1)Then
    sqlid = rs("id")
Else
    sqlid = sqlid &","&rs("id")
End If
rs.movenext
Next
End If
If(idcount>0 And sqlid<>"") Then
sql = "select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 0, 1
While Not rs.EOF
    Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbCrLf
    Response.Write "  <tr>"&vbCrLf
    Response.Write "    <td width=""5%"" height=""25"" bgcolor=""#820000"" align=""center""><font color=""#FFFFFF""><b>"&rs("ID")&"</b></font></td>"&vbCrLf
    Response.Write "    <td width=""50%"" height=""25"" bgcolor=""#EDEEEF"" align=""left"" style=""padding-left: 8px""><font color=""#333333""><b>"&rs("Company")&"</b></font>("&rs("Linkman")&""&rs("Sex")&")</td>"&vbCrLf
    Response.Write "    <td width=""45%"" height=""25"" bgcolor=""#EDEEEF"" align=""right"" style=""padding-right: 8px""><font color=""#808080"">留言时间：</font>"&rs("Addtime")&"</td>"&vbCrLf
    Response.Write "  </tr>"&vbCrLf
    Response.Write "</table>"&vbCrLf
    Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""1"">"&vbCrLf
    Response.Write "  <tr align=""left"">"&vbCrLf
    Response.Write "    <td width=""15%"" height=""20"" align=""right"" style=""padding-right: 8px"">咨询主题：</td>"&vbCrLf
    Response.Write "    <td><b>"&rs("MesName")&"</b></td>"&vbCrLf
    Response.Write "  </tr>"&vbCrLf
    Response.Write "  <tr align=""left"">"&vbCrLf
    Response.Write "    <td height=""20"" align=""right"" style=""padding-right: 8px"">咨询内容：</td>"&vbCrLf
    Response.Write "    <td style=""padding-right: 5px"">"&MessageContent(rs("MemID"), rs("SecretFlag"), HtmlStrReplace(rs("Content")))&"</td>"&vbCrLf
    Response.Write "  </tr>"&vbCrLf
    If rs("ReplyContent") <> "" Then
        Response.Write "  <tr>"&vbCrLf
        Response.Write "    <td>&nbsp;</td>"&vbCrLf
        Response.Write "    <td bgcolor=""#F7F7F7"" style=""line-height: 200%""><font color=""#333333""><b>管理员回复：</b></font><br />"&MessageReply (rs("MemID"), rs("MesName"), rs("SecretFlag"), rs("ReplyContent"))&"</td>"&vbCrLf
        Response.Write "  </tr>"&vbCrLf
    End If
    Response.Write "  <tr>"&vbCrLf
    Response.Write "    <td colspan=""2"" height=""5""></td>"&vbCrLf
    Response.Write "  </tr>"&vbCrLf
    Response.Write "</table>"&vbCrLf
    rs.movenext
Wend
Else
    response.Write "<center>暂无相关信息</center>"
    Exit Function
End If
Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbCrLf
Response.Write "  <tr height=""35"">"&vbCrLf
Response.Write "    <td align=""center"">"&vbCrLf
Response.Write "共<strong style=""color:red"">"&idcount&"</strong>条记录 页次：<strong style=""color:red"">"&page&"</strong>/"&pagec&" 每页：<strong style=""color:red"">"&pages&"</strong>条记录" & vbCrLf
pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If(page>1) Then response.Write ("<a href="""& myself &"Page=1"" title=""回到第一页""><font face=""webdings"" color=""#000000"">9</font></a> ")
If page - (pagenc * 2 + 1)<= 0 Then
    pageprevious = 1
Else
    pageprevious = page - (pagenc * 2 + 1)
End If
If(pagenmin>1) Then response.Write ("<a href="""& myself &"Page="& pageprevious &""" title=""第"& pageprevious &"页""><font face=""webdings"" color=""#000000"">3</font></a> ")
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    response.Write ("&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;")
Else
    response.Write ("[<a href="""& myself &"Page="& i &""">"& i &"</a>]")
End If
Next
If page+(pagenc * 2 + 1)>= pagec Then
    pagenext = pagec
Else
    pagenext = page+(pagenc * 2 + 1)
End If
If(pagenmax<pagec) Then response.Write (" <a href="""& myself &"Page="& pagenext &""" title=""跳转到第"&pagenext&"页""><font face=""webdings"" color=""#999999"">:</font></a> ")
If(page<pagec) Then response.Write (" <a href="""& myself &"Page="& pagec &""" title=""跳转到第"&pagec&"页""><font face=""webdings"" color=""#000000"">:</font></a>")
Response.Write "    </td>"&vbCrLf
Response.Write "  </tr>"&vbCrLf
Response.Write "</table>"&vbCrLf
rs.Close
Set rs = Nothing
End Function

Function MessageContent(MemID, SecretFlag, Content)
    If SecretFlag Then
        Dim rs, sql
        Set rs = server.CreateObject("adodb.recordset")
        sql = "select * from Shenbi_Members where ID="&MemID
        rs.Open sql, conn, 1, 1
        If rs("MemName") = session("MemName") And session("MemLogin") = "Succeed" Then
            MessageContent = Content
        Else
            MessageContent = "隐秘内容"
        End If
        rs.Close
        Set rs = Nothing
    Else
        MessageContent = Content
    End If
End Function

Function MessageReply(MemID, MesName, SecretFlag, ReplyContent)
    If ReplyContent<>"" Then
        If SecretFlag Then
            Dim rs, sql
            Set rs = server.CreateObject("adodb.recordset")
            sql = "select * from Shenbi_Members where ID="&MemID
            rs.Open sql, conn, 1, 1
            If rs("MemName") = session("MemName") And session("MemLogin") = "Succeed" Then
                MessageReply = MessageReply&HtmlStrReplace(ReplyContent)
            Else
                MessageReply = MessageReply&"<font color=""#CC0000"">回复已隐藏，请登录后查看。</font>"
            End If
            rs.Close
            Set rs = Nothing
        Else
            MessageReply = MessageReply&HtmlStrReplace(ReplyContent)
        End If
    End If
End Function
%>