<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_System_EmailLog, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="AjaxControls" Namespace="AjaxControls" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Assembly="obout_Editor" Namespace="OboutInc.Editor" TagPrefix="obout" %>



<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">

    <script type="text/javascript" language="javascript">
        //setTimeout(
        function hideformatting(myField) {
            var editPanel = oboutGetEditorByClientId(myField);
            //alert($('.ST_div').parent());
            $('.ST_div').parent().css("display", "none"); //addClass('hide');
        }
        //, 1000);
    </script>

    <ajax:UpdatePanel ID="UP_EmailDetail" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="Pnl_EmailDetail" CssClass="width-modal-popup-auto" runat="server" Style="display: none">
                <div class="col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <%= Resources.Content.strEmailDetail%>
                                <span>
                                    <button type="button" class="close" onclick="$find('<%=MPE_EmailDetail.ClientID%>').hide();">&times;</button>
                                </span>
                            </h3>
                        </div>
                        <div class="body">
                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Label9" runat="server" Text="<%$ Resources:Content,GN0000721 %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_Date" runat="server"></asp:Literal>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Label10" runat="server" Text="<%$ Resources:Content,strEmailType %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_EmailType" runat="server"></asp:Literal>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Label4" runat="server" Text="<%$ Resources:Content,GN0000371 %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_Subject" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Label5" runat="server" Text="<%$ Resources:Content,FromEmail %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_FromEmail" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Lb_SendTo" runat="server" Text="<%$ Resources:Content,strTO %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_To" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Lb_CC" runat="server" Text="<%$ Resources:Content,strCC %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_CC" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="LB_Bcc" runat="server" Text="<%$ Resources:Content,strBcc %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_Bcc" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="LC_Attachements" runat="server" Text="<%$ Resources:Content,DGN1110179 %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Literal ID="Ltr_Attachments" runat="server"></asp:Literal>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Label8" runat="server" Text="<%$ Resources:Content,Status %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:Label ID="Ltr_Status" runat="server"></asp:Label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-2 col-xs-12 row-label">
                                    <asp:Label ID="Lb_Body" runat="server" Text="<%$ Resources:Content,String321 %>" EnableViewState="false"></asp:Label>
                                </div>
                                <div class="col-sm-10 col-xs-12">
                                    <obout:Editor ID="Editor1" Submit="false" PreviewOnInit="true" ModeSwitch="false" ShowWaitMessage="false" AjaxWait="false" runat="server" Appearance="custom">
                                        
                                    </obout:Editor>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button CssClass="btn btn-primary" class="btn btn-primary waves-effect btnAction" ID="Btn_EmailSend" runat="server"
                                        Text='<%$ Resources:Content,strReSend%>' ValidationGroup="EmailDetail" CausesValidation="true" />
                                    <asp:Button CssClass="btn btn-primary" class="btn btn-primary waves-effect" ID="Btn_EmailCancel" runat="server"
                                        Text='<%$ Resources:Content,GN000150%>' ValidationGroup="EmailDetail" CausesValidation="false" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:Button CssClass="btn btn-primary" ID="Btn_Dummy" runat="server" Style="display: none" Text='<%$ Resources:Content,GN0000575%>' />
            <EM:ModalPopupExtender runat="server" ID="MPE_EmailDetail" BackgroundCssClass="modalBackground"
                DropShadow="false" CancelControlID="Btn_EmailCancel" PopupControlID="Pnl_EmailDetail"
                TargetControlID="Btn_Dummy" />

            <asp:Panel ID="Pnl_StatusDetail" CssClass="width-modal-popup-auto" runat="server" Style="display: none">
                <div class="col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <%= Resources.Content.String600%>
                                <span>
                                    <button type="button" class="close" onclick="$find('<%=MPE_StatusDetail.ClientID%>').hide();">&times;</button>
                                </span>
                            </h3>
                        </div>
                        <div class="body">

                            <div class="row">
                                <div class="col-xs-12">

                                    <asp:Label ID="Lbl_EmailComments" runat="server"></asp:Label>

                                </div>
                            </div>

                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button CssClass="btn btn-primary" class="btn btn-primary waves-effect" ID="Btn_StatusDetailCancel" runat="server"
                                        Text='<%$ Resources:Content,GN000150%>' />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:Button CssClass="btn btn-primary" ID="Btn_Dummy2" runat="server" Style="display: none" Text='<%$ Resources:Content,GN0000575%>' />
            <EM:ModalPopupExtender runat="server" ID="MPE_StatusDetail" BackgroundCssClass="modalBackground"
                DropShadow="false" CancelControlID="Btn_StatusDetailCancel" PopupControlID="Pnl_StatusDetail"
                TargetControlID="Btn_Dummy2" />
        </ContentTemplate>
        <Triggers>
            <ajax:AsyncPostBackTrigger ControlID="GV_AuditLogEmail" EventName="RowCommand" />
        </Triggers>
    </ajax:UpdatePanel>

    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h3><%= Resources.Content.strEmailLog%>  </h3>
            </div>
            <div class="body">
                <ajax:UpdatePanel ID="UP_Filter" runat="server" UpdateMode="Conditional" RenderMode="Block">
                    <ContentTemplate>
                        <asp:Panel ID="Pnl_Search" runat="server" DefaultButton="Btn_Search">
                            <div class="row">
                                <div class="panel-group search-panel" id="AS_EmailLogs" role="tablist" aria-multiselectable="true">
                                    <div class="col-xs-12" role="tab" id="SH_EmailLogs">
                                        <div class="card">
                                            <div class="header" role="button" data-toggle="collapse" data-parent="#AS_EmailLogs" href="#<%= CSB_EmailLogs.ClientID%>" aria-expanded="true" aria-controls="SH_EmailLogs">
                                                <h3>
                                                    <%= Resources.Content.GN0000395%>
                                                </h3>
                                            </div>
                                            <div id="CSB_EmailLogs" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_EmailLogs" aria-expanded="false">
                                                <div class="row">


                                                    <div class="col-md-3 col-sm-6 col-xs-12" id="TD_OwnerDDLDoc" runat="server">
                                                        <div class="form-group form-float">
                                                            <asp:DropDownList ID="DDL_OwnerDoc" runat="server" onchange="setOwnerCookie(this)"></asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12" id="Td_Login" runat="server">
                                                        <div class="form-group form-float">

                                                            <asp:DropDownList ID="DDL_EmailType" runat="server" />
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <asp:DropDownList ID="DDL_Status" runat="server" />
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <asp:DropDownList ID="DDL_HasAttachment" runat="server">
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_Subject" runat="server" />
                                                                <asp:Label CssClass="form-label" ID="Label2" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000371%>"></asp:Label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-sm-6 col-xs-12">
                                                        <div class="form-group form-float">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_ToCcBcc" runat="server">
                                                                </asp:TextBox>
                                                                <asp:Label CssClass="form-label" ID="Label3" runat="server" EnableViewState="false" Text="<%$ Resources:Content,strToCcBcc%>"></asp:Label>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="clearfix row"></div>
                                                    <div class="col-md-4 col-sm-6 col-xs-12">
                                                        <label class="row-label display-date-label">
                                                            <asp:Literal ID="Literal14" runat="server" Text="<%$ Resources:Content,GN0000687%>" EnableViewState="false" />:
                                                        </label>
                                                        <div class="form-group display-date-input">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_DateAfter" Enabled="false" runat="server"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <i runat="server" id="A_DRangeAfter" class="material-icons icon-calendar col-calendar"></i>
                                                        <EM:CalendarExtender ID="CE_DRangeAfter" runat="server" TargetControlID="TxBx_DateAfter"
                                                            Format="<%# System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern %>" PopupButtonID="A_DRangeAfter" CssClass="date__calendar">
                                                        </EM:CalendarExtender>
                                                    </div>
                                                    <div class="col-md-4 col-sm-6 col-xs-12">
                                                        <label class="row-label display-date-label">
                                                            <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,GN0000688%>" EnableViewState="false" />:
                                                        </label>
                                                        <div class="form-group display-date-input">
                                                            <div class="form-line">
                                                                <asp:TextBox ID="TxBx_DateBefore" Enabled="false" runat="server"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <i runat="server" id="A_DRangeBefore" class="material-icons icon-calendar col-calendar"></i>
                                                        <EM:CalendarExtender ID="CE_DRangeBefore" runat="server" TargetControlID="TxBx_DateBefore"
                                                            Format="<%# System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern %>" PopupButtonID="A_DRangeBefore" CssClass="date__calendar">
                                                        </EM:CalendarExtender>
                                                    </div>

                                                    <div class="col-xs-12">
                                                        <div class="form-group form-float">
                                                            <asp:Button CssClass="btn btn-primary" ID="Btn_Search" SkinID="searchButton" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                            <asp:Button CssClass="btn btn-primary" ID="Btn_Clear" SkinID="searchButton" Visible="false" runat="server" Text="<%$ Resources:Content,String289 %>" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                        <div class="row" id="Tbl_Ops" runat="server" custom1="Custom" style="display: none">
                            <div class="col-xs-12">
                                <div class="card">
                                    <div class="header">
                                        <h3><%= Resources.Content.GN0000360%>  </h3>
                                    </div>
                                    <div class="body">
                                        <asp:Button CssClass="btn btn-primary" ID="btnRemoveSelected" runat="server" Text="<%$ Resources:Content,strRemoveSelected%>"
                                            class="btn btn-primary waves-effect btnAction" Custom1="Custom" Style="display: none" />
                                        <%----%>
                                        <asp:Button CssClass="btn btn-primary" ID="btnResendSelected" runat="server" Text="<%$ Resources:Content,strResendSelected%>"
                                            class="btn btn-primary waves-effect btnAction" Custom1="Custom" Style="display: none" />
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-xs-12">
                                <div class="card">
                                    <div class="body">

                                        <h5><%= Resources.Content.StrEmailLogRemovalMsg%>  </h5>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <asp:Panel ID="Pnl_Listing" runat="server">
                            <EM:MPGridView ID="GV_AuditLogEmail" CurrentSortExpression="DateStamp" CurrentSortDirection="Desc"
                                CssClass="table table-bordered table-striped table-hover table-responsive" runat="server" AllowPaging="true" AllowSorting="true" DataKeyNames="EmailID"
                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' AutoGenerateColumns="false">
                                <Columns>
                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                                        <HeaderTemplate>
                                            <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox Text=" " class="option-menu" ID="ChkBx_Item" runat="server" onclick="SetCheckedHeader(this.checked, this,'1');" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField HeaderText="<%$ Resources:Content, Exh505 %>" DataField="CompanyName"
                                        SortExpression="CompanyName" HeaderStyle-CssClass="col-xs-2" />
                                    <asp:TemplateField HeaderText="<%$ Resources:Content, strEmailDetail %>" HeaderStyle-CssClass="col-xs-4 break-word-all" ItemStyle-CssClass="break-word-all">
                                        <ItemTemplate>
                                            <table class="table small">
                                                <tbody>
                                                    <tr>
                                                        <td class="col-xs-4 row-label">
                                                            <asp:Label ID="Label7" runat="server" Font-Bold="true" Text="<%$ Resources:Content,GN0000371%>" EnableViewState="false"></asp:Label>:
                                                        </td>
                                                        <td class="col-xs-8">
                                                            <asp:Label ID="Label12" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.EmailSubject")%>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-4 row-label">
                                                            <asp:Label ID="Label2" runat="server" Font-Bold="true" Text="<%$ Resources:Content,FromEmail%>" EnableViewState="false"></asp:Label>:                                                          
                                                        </td>
                                                        <td class="col-xs-8">
                                                            <asp:Label ID="LB_From" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.FromAddress")%>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="col-xs-4 row-label">
                                                            <asp:Label ID="Label6" runat="server" Font-Bold="true" Text="<%$ Resources:Content,strEmailTo%>" EnableViewState="false"></asp:Label>:                                                            
                                                        </td>
                                                        <td class="col-xs-8">
                                                            <asp:Label ID="Label1" runat="server" Text=' <%# DataBinder.Eval(Container, "DataItem.ToAddress")%> ' />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="<%$ Resources:Content, GN0000721 %>" HeaderStyle-CssClass="col-xs-2" SortExpression="EmailDate">
                                        <ItemTemplate>
                                            <asp:Label ID="Ltl_SDate" runat="server" Text=' <%# DataBinder.Eval(Container, "DataItem.EmailDate")%> ' />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <%--<asp:TemplateField HeaderText="<%$ Resources:Content, GN0000371 %>" HeaderStyle-CssClass="col-xs-2 break-word-all" ItemStyle-CssClass="break-word-all" SortExpression="EmailSubject">
                                        <ItemTemplate>
                                            <asp:Label ID="Ltl_Subject" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.EmailSubject").ToString()%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>--%>
                                    <asp:TemplateField HeaderText="<%$ Resources:Content,strEmailType%>" HeaderStyle-CssClass="col-xs-2" SortExpression="EmailType">
                                        <ItemTemplate>
                                            <asp:Label ID="Ltl_EmailType" runat="server" Text=' <%# [Enum].GetName(GetType(MachSol.MachPanel.Utility.Constants.EmailTypes), Convert.ToInt32(DataBinder.Eval(Container, "DataItem.EmailType").ToString())).Replace("_", " ")%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="<%$ Resources:Content,Status%>" HeaderStyle-CssClass="col-xs-2" SortExpression="EmailType">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LB_EmailStatus" CommandArgument='<%#DataBinder.Eval(Container, "DataItem.EmailId")%>' CommandName="StatusDetail" runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="<%$ Resources:Content, GN0000360 %>" HeaderStyle-CssClass="col-xs-1 RemoveWordBreak">
                                        <ItemTemplate>
                                            <ul class="option-menu">
                                                <li class="dropdown">
                                                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                                        <i class="material-icons">menu</i>
                                                    </a>
                                                    <ul class="dropdown-menu pull-right">
                                                        <li>
                                                            <asp:LinkButton ID="LB_Detail" Text="<%$ Resources:Content,GN0000843%>"
                                                                CommandArgument='<%#DataBinder.Eval(Container, "DataItem.EmailId")%>' CommandName="EmailDetail" runat="server" /></li>
                                                        <li>
                                                            <asp:LinkButton ID="LB_ReSend" CssClass="btnAction" Text="<%$ Resources:Content,strReSend%>"
                                                                CommandArgument='<%#DataBinder.Eval(Container, "DataItem.EmailId")%>' CommandName="ReSend" runat="server" /></li>
                                                        <li>
                                                            <asp:LinkButton ID="IB_Delete" CssClass="btnAction" Text="<%$ Resources:Content,GN0000377%>"
                                                                CommandArgument='<%#DataBinder.Eval(Container, "DataItem.EmailId")%>' CommandName="DeleteEmail" runat="server" />
                                                        </li>
                                                        <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" ConfirmText="<%$ Resources:Content, String1040 %>" TargetControlID="IB_Delete"></EM:ConfirmButtonExtender>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerTemplate>
                                    <EM:Pager ID="Pager" runat="server" />
                                </PagerTemplate>
                            </EM:MPGridView>
                        </asp:Panel>
                    </ContentTemplate>
                </ajax:UpdatePanel>

            </div>
        </div>
    </div>

</asp:Content>

