<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_member_ShopComplain, WebApp_deploy" title="投诉管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">
        function setButtonActive(flags) {
            var _flag = parseInt(flags);
            var ulObj = document.getElementById("M1");
            for (var i = 0; i < ulObj.childNodes.length; i++) {
                ulObj.childNodes[i].className = "";
            }
            if (ulObj.childNodes.length > 3)
            { _flag = _flag * 2 + 1; }
            ulObj.childNodes[_flag].className = "active";

        }
    </script>
    <style type="text/css">
        .showDiv
        {
            position: absolute;
            border: 1px #ccc solid;
            background-color: #fff;
            padding: 5px;
        }
    </style>
    <div class="pageTitle">
        投诉举报管理</div>
    <div id="MainMenu">
        <div class="TabMenu">
            <!--一级导航-->
            <ul id="M1">
                <li class="active">
                    <asp:LinkButton ID="LinkButton1" runat="server" Text="我的投诉" CommandName="myComplain"
                        OnCommand="IComplain_SelectType" CausesValidation="false" OnClientClick="setButtonActive(0)" /></li>
                <li>
                    <asp:LinkButton ID="LinkButton2" runat="server" Text="收到的投诉" CommandName="receiveComplain"
                        OnCommand="IComplain_SelectType" CausesValidation="False" OnClientClick="setButtonActive(1)" /></li>
                <li>
                    <asp:LinkButton ID="LinkButton3" runat="server" Text="投诉/举报" CommandName="complainOther"
                        OnCommand="IComplain_SelectType" CausesValidation="False" OnClientClick="setButtonActive(2)" /></li>
            </ul>
        </div>
        <div class="TabText">
            <br />
            <asp:PlaceHolder ID="PlaceHolder1" runat="server">
                <table class="SearchTableStyle">
                    <tr>
                        <td>
                            <asp:DropDownList ID="DropType" runat="server" Width="94px" Height="20px">
                            </asp:DropDownList>
                            &nbsp;&nbsp;
                            <asp:DropDownList ID="DropStatus" runat="server" Width="94px" Height="20px">
                            </asp:DropDownList>
                            &nbsp;&nbsp; 开始时间：<asp:TextBox ID="startTime" runat="server" Width="70px"></asp:TextBox>&nbsp;&nbsp;结束时间：<asp:TextBox
                                ID="EndTime" runat="server" Width="70"></asp:TextBox>
                            <asp:Button ID="SeachBut" runat="server" Text="查询" OnClick="SeachBut_Click" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="GridView1" runat="server" OnDataBound="GridView1_OnDataBound" AllowPaging="True"
                    AutoGenerateColumns="false" CssClass="tableHead">
                    <Columns>
                        <asp:BoundField HeaderText="编号" DataField="ComplainID" />
                        <asp:BoundField DataField="complainUserName" HeaderText="被投诉人" />
                        <asp:CheckBoxField DataField="Status" HeaderText="是否已处理" Text="已处理" />
                        <asp:TemplateField HeaderText="投诉原因" ItemStyle-Width="100px">
                            <ItemTemplate>
                                <asp:Label ID="reasonBar" runat="server" Text="查看投诉原因" />
                                <asp:Label ID="TxtReason" runat="server" Text='<%#Eval("reason") %>' Style="color: #000000;
                                    position: absolute;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="处理结果" ItemStyle-Width="100px">
                            <ItemTemplate>
                                <asp:Label ID="resultBar" runat="server" Text="查看处理结果" />
                                <asp:Label ID="TxtResult" runat="server" Text='<%#Eval("result") %>' Style="color: #000000;
                                    position: absolute;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="日期" DataField="StartTime" />
                        <asp:HyperLinkField DataNavigateUrlFields="ComplainID" DataNavigateUrlFormatString="Shop_Complain.aspx?ReviewComplainID={0}"
                            HeaderText="查看 " Text="查看" />
                    </Columns>
                    <EmptyDataTemplate>
                        <table style="width: 98%">
                            <tr>
                                <th>
                                    编号
                                </th>
                                <th>
                                    被投诉人
                                </th>
                                <th>
                                    是否已处理
                                </th>
                                <th>
                                    投诉原因
                                </th>
                                <th>
                                    处理结果
                                </th>
                                <th>
                                    日期
                                </th>
                                <th>
                                    查看
                                </th>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    没有符合查询条件的记录！
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>
            </asp:PlaceHolder>
            <asp:PlaceHolder ID="PlaceHolder2" runat="server" Visible="false">
                <table class="SearchTableStyle">
                    <tr>
                        <td>
                            <asp:DropDownList ID="DropType1" runat="server" Height="20px" Width="94px">
                                <asp:ListItem Value="-1">投诉／举报</asp:ListItem>
                                <asp:ListItem Value="投诉">投诉</asp:ListItem>
                                <asp:ListItem Value="举报">举报</asp:ListItem>
                            </asp:DropDownList>
                            &nbsp;&nbsp;
                            <asp:DropDownList ID="DropStatus1" runat="server" Height="20px" AutoPostBack="true"
                                Width="94px">
                                <asp:ListItem Value="状态">状态</asp:ListItem>
                                <asp:ListItem Value="0">待处理</asp:ListItem>
                                <asp:ListItem Value="1">处理完毕</asp:ListItem>
                            </asp:DropDownList>
                            &nbsp;&nbsp; 开始时间：<asp:TextBox ID="StartTime1" runat="server" Width="70px"></asp:TextBox>&nbsp;&nbsp;结束时间：<asp:TextBox
                                ID="EndTime1" runat="server" Width="70"></asp:TextBox>
                            <asp:Button ID="btn_search2" runat="server" Text="查询" OnClick="btn_search2_Click"
                                Style="margin-left: 20px" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="GridView2" runat="server" OnDataBound="GridView2_OnDataBound" AllowPaging="True"
                    AutoGenerateColumns="False" CssClass="tableHead">
                    <Columns>
                        <asp:BoundField DataField="ComplainID" HeaderText="编号" HeaderStyle-Width="50px" />
                        <asp:BoundField HeaderText="投诉人" DataField="userName" HeaderStyle-Width="50px" />
                        <asp:CheckBoxField DataField="status" HeaderText="是否已处理" Text="已处理" />
                        <asp:TemplateField HeaderText="投诉原因" ItemStyle-Width="100px">
                            <ItemTemplate>
                                <asp:Label ID="reasonBar" runat="server" Text="查看投诉原因" />
                                <asp:Label ID="TxtReason" runat="server" Text='<%#Eval("reason") %>' Style="color: #000000;
                                    position: absolute;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="处理结果" ItemStyle-Width="100px">
                            <ItemTemplate>
                                <asp:Label ID="resultBar" runat="server" Text="查看处理结果" />
                                <asp:Label ID="TxtResult" runat="server" Text='<%#Eval("result") %>' Style="color: #000000;
                                    position: absolute;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="StartTime" HeaderText="日期" HeaderStyle-Width="100px" />
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:HiddenField ID="hfStatus" runat="server" Value='<%# Eval("status") %>' />
                                <asp:HyperLink ID="hlCheckInof" runat="server" NavigateUrl='<%# "Shop_Complain.aspx?ReviewComplainID="+Eval("ComplainID") %>'
                                    Text="查看"></asp:HyperLink>
                                <asp:HyperLink ID="hlEditResult" runat="server" NavigateUrl='<%# "Shop_Complain.aspx?Action=editinfo&ReviewComplainID="+Eval("ComplainID") %>'
                                    Text="处理"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <table style="width: 98%">
                            <tr>
                                <th>
                                    编号
                                </th>
                                <th>
                                    投诉人
                                </th>
                                <th>
                                    是否已处理
                                </th>
                                <th>
                                    投诉原因
                                </th>
                                <th>
                                    处理结果
                                </th>
                                <th>
                                    日期
                                </th>
                                <th>
                                    查看
                                </th>
                            </tr>
                            <tr>
                                <td colspan="7">
                                    没有符合查询条件的记录！
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>
            </asp:PlaceHolder>
            <asp:PlaceHolder ID="PlaceHolder3" runat="server" Visible="false">
                <table class="ShopOrderStyle">
                    <caption>
                        <asp:Literal ID="ltrTitle" runat="server" Text="信息处理"></asp:Literal></caption>
                    <tr>
                        <td class="OrderTitle">
                            类型：
                        </td>
                        <td>
                            <asp:RadioButtonList ID="RadioType" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="投诉" Selected="True">投诉</asp:ListItem>
                                <asp:ListItem Value="举报">举报</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            投诉/举报对象：
                        </td>
                        <td>
                            <asp:TextBox ID="TxtComplainUserName" runat="server" Width="250px" /><asp:RequiredFieldValidator
                                ID="Rq2" runat="server" ErrorMessage="投诉的对象不能为空" ControlToValidate="TxtComplainUserName" />
                        </td>
                    </tr>
                    <tr>
                        <td class="OrderTitle">
                            投诉原因/证据：
                        </td>
                        <td>
                            <asp:TextBox ID="TxtReason" runat="server" TextMode="MultiLine" Height="100px" Width="90%" /><asp:RequiredFieldValidator
                                ID="Rq1" runat="server" ErrorMessage="投诉的原因不能为空" ControlToValidate="TxtReason" />
                        </td>
                    </tr>
                    <tr id="tr_result" runat="server" visible="false">
                        <td class="OrderTitle">
                            处理结果：
                        </td>
                        <td>
                            <asp:TextBox ID="txtResult" runat="server" TextMode="MultiLine" Height="100px" Width="90%"></asp:TextBox><asp:RequiredFieldValidator
                                ID="rfvResult" runat="server" ErrorMessage="处理不能为空" ControlToValidate="txtResult" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center">
                            <asp:Button ID="ButAdd" runat="server" OnClick="ButAdd_Click" Text="添加" />
                            <%--<input type="button" id="btnBack" onclick="history.back();" value="返回" />--%>
                        </td>
                    </tr>
                </table>
            </asp:PlaceHolder>
            <br />
        </div>
    </div>
    <script type="text/javascript">        setButtonActive("<%=m_flag %>");</script>
</asp:Content>
