<%@ page language="C#" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_member_ShopComplain, mallz" title="投诉管理" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True"/>  

<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" 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="DropStatus" runat="server" Height="20px" 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="startTime" runat="server" Width="70px"></asp:TextBox>&nbsp;&nbsp;结束时间：<asp:TextBox
                      ID="EndTime" runat="server" Width="70"></asp:TextBox>
                  <asp:Button ID="btn_search1" runat="server" Text="查 询" OnClick="btn_search1_Click" style="margin-left:20px" />
             </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="7">没有符合查询条件的记录！</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" 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:HyperLinkField DataNavigateUrlFields="ComplainID" DataNavigateUrlFormatString="Shop_Complain.aspx?ReviewComplainID={0}"
                            HeaderText="查看" Text="查看"  HeaderStyle-Width="50px"/>
                    </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="SearchTableStyle">
                  <tr>
                      <td>类型：</td>
                      <td>
                         <asp:RadioButtonList ID="RadioType" runat="server"  RepeatDirection="Horizontal" RepeatLayout="Flow" >   
                             <asp:ListItem Value="投诉" Selected="True">投诉</asp:ListItem>
                             <asp:ListItem Value="举报">举报</asp:ListItem>
                         </asp:RadioButtonList>
                      </td>
                  </tr>
                  <tr>
                      <td>投诉/举报对象：</td>
                      <td><asp:TextBox ID="TxtComplainUserName" runat="server" Width="250px"/><asp:RequiredFieldValidator ID="Rq2" runat="server" ErrorMessage="投诉的对象不能为空" ControlToValidate="TxtComplainUserName"/></td>
                  </tr>
                  <tr>
                      <td>投诉原因/证据：</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>
                      <td colspan="2" style="text-align:center"><asp:Button ID="ButAdd" runat="server" OnClick="ButAdd_Click" Text="添加" /></td>
                  </tr>
              </table> 
           </asp:PlaceHolder> 
        
       
            <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" /><asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" /><br />
 </div></div>  
  <script type="text/javascript">setButtonActive(<%=m_flag %>);</script>  
</asp:Content>

