<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="message.aspx.cs" Inherits="zhongchou.User.message" %>

<%@ Register Src="~/User/daohang.ascx" TagName="daohang" TagPrefix="ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titleContent" runat="server">
    私信列表区
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <link href="../Images/5de86140d87bd2dbed2f7d202594aff3.css" rel="stylesheet" type="text/css" />
    <link href="../Images/7ffb95504c3dc3e41f80429d1d3004ea.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="backstage-wrap clearfix">
        <ascx:daohang ID="daohang1" runat="server" />
        <div class="backstage-right">
            <div class="backstage-right-con fill-2 clearfix">
                <div style="border-bottom: 1px solid #ccc; margin-bottom: 10px; padding-bottom: 20px; font-size: 20px;">
                    支持的项目<%=cookieid %></div>
                <div class="promoters-pro-con">
                    <div class="direct-messages">
                        <asp:Repeater ID="liuyanRP" runat="server">
                            <ItemTemplate>
                                <ul>
                                    <li>
                                        <div class=" portrait">
                                            <%if (cookieid == dt.Rows[0]["fid"].ToString()) {%>
                                            <a href="backer.aspx?type=backer&uid=<%#Eval("fid") %>">
                                                <img class="fl" style="float: left" src="image/<%#Eval("fhead") %>" width="200" height="200" alt="<%#Eval("fuser") %>"></a>
                                            <%} else { %>
                                            <a href="backer.aspx?type=backer&uid=<%#Eval("sid") %>">
                                                <img class="fl" src="image/<%#Eval("shead") %>" width="200" height="200" alt="<%#Eval("suser") %>"></a>
                                            <%} %>
                                        </div>
                                        <div class="msg-box">
                                            <div class="user-name">
                                                <%if (cookieid == dt.Rows[0]["fid"].ToString()) {%>
                                                <a href="backer.aspx?type=backer&uid=<%#Eval("fid") %>">您</a> 对 <a href="backer.aspx?type=backer&uid=<%#Eval("sid") %>">
                                                    <%#Eval("suser") %></a>
                                                <%} else if (dt.Rows[0]["fid"].ToString() != "-1") {%>
                                                <a href="backer.aspx?type=backer&uid=<%#Eval("sid") %>">
                                                    <%#Eval("suser") %></a> 对 <a href="backer.aspx?type=backer&uid=<%#Eval("fid") %>">您</a>
                                                <%} else {%>
                                                <!-- 管理员发送内容 -->
                                                管理员 对 <a href="backer.aspx?type=backer&uid=<%#Eval("sid") %>">
                                                    <%#Eval("suser") %></a>
                                                <%} %><span class="gray"><%#Eval("addtime") %></span></div>
                                            <div class="msg-cnt">
                                                <%#Eval("neirong") %></div>
                                            <div class="talk-handle" data-info="<%#Eval("id") %>|<%#Eval("suser") %>|<%#Eval("sid") %>">
                                                <a class="Js-reply" href="javascript:;">回复</a>
                                                <%if (cookieid == dt.Rows[0]["fid"].ToString()) {%>
                                                <a class="Js-delMessItem" href="javascript:;">删除</a>
                                                <%} %>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </ItemTemplate>
                        </asp:Repeater>
                        <%=paging %>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(".a-btn-blue").live("click", function () {
            var content = $("textarea[name='msgs']").val();
            var sid = $("#sid").val();
            if (!content) {
                alert('什么都没写，我怎么留言啊？逗我呢');
                $("textarea[name='msgs']").focus();
                return;
            }
            $.ajax({
                type: 'get',
                cache: false,
                url: '?action=relpy&msg=' + content + "&sid=" + sid,
                success: function (msg) {
                    if (msg.indexOf('1') > -1) {
                        wx.alert("留言成功");
                    } else {
                        wx.alert("留言失败");
                    }
                },
                error: function () {
                    wx.alert("异常，请联系管理员");
                }
            });
        });
    </script>
    <script id="Js-mess-tpl" type="text">
    <div class="m-message">
    	<div class="title">
    		<h3 class="">发送私信</h3>
    		<a href="javascript:;" class="btn-close Js-pop-close">×</a>
    	</div> 
    	<div class="pop-body">
    			<div class="pop-msg">
    				<h3>收件人：<&name&></h3>
    				<textarea name="msgs" class="message"></textarea>
                    <input type="hidden" id="reply_comment_id" name="top_id" value="<&id&>">
                    <input type="hidden" id="sid" name="top_id" value="<&sid&>">
    			</div>
    			<div class="btn">
                    <a class="a-btn-gray Js-pop-close">
                        取消
                    </a>
    				<a class="a-btn-blue btn-effect-blue" type="button">
    					发送
    				</a>
    			</div>
    	</div>
    </div>
    </script>
</asp:Content>
