<%@ Page Language="C#" MasterPageFile="~/MasterFile/TimeCheck.master" AutoEventWireup="true"
    CodeFile="SMS_LogDetails.aspx.cs" Inherits="Masters_SMS_LogDetails" EnableEventValidation="false" %>


<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
  
    <script type="text/javascript" src="../bootstrap/js/1.4.3/jquery.min.js"></script>

    <script src="../bootstrap/js/1.8.5/jquery-ui.min.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script type="text/javascript">
        $(function () {
            $('#ctl00_BodyContentPH_txtFromdate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_hdnDateTime').value }
            );
            $('#ctl00_BodyContentPH_txtTodate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_hdnDateTime').value }
            );
        });
    </script>

    <script type="text/javascript">
        $(function () {
            $("#<%= txtReceivers.ClientID %>").autocomplete({
                source: function (request, response) {
                    $.getJSON("../AutoCompleteByName.ashx?EmpAutoid=" + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                        term: extractLast(request.term)
                    }, response);
                },
                search: function () {
                    // custom minLength
                    var term = extractLast(this.value);
                    if (term.length < 1) {
                        return false;
                    }
                },
                focus: function () {
                    // prevent value inserted on focus
                    return false;
                },
                select: function (event, ui) {

                    var terms = split(this.value);
                    // remove the current input
                    terms.pop();
                    // add the selected item
                    terms.push(ui.item.value);
                    // add placeholder to get the comma-and-space at the end
                    terms.push("");
                    this.value = terms.join(",");
                    return false;
                }
            });
            function split(val) {
                return val.split(/,\s*/);
            }
            function extractLast(term) {
                return split(term).pop();
            }
        });

            window.onload = function () {
                PageOnloadDate();
            };
    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/leave-type.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="form-horizontal">
            <asp:HiddenField ID="hdnDateTime" runat="server" />
            <div id="Search1" runat="server">
                <div class="emp-filter">
                    <%--<div class="row" id="trOrgLevel" runat="server">
                        <div class="col-md-12">
                            <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                                <contenttemplate>
                                    <asp:PlaceHolder ID="PlaceHolderLateEntry" runat="server">
                                        <%--<uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                                    </asp:PlaceHolder>
                                </contenttemplate>
                            </asp:UpdatePanel>
                        </div>
                    </div>--%>
                    <%-- <div class="clearfix">
                    </div>
                    <div class="row">
                        <div class="row">
                            <div class="line16">
                            </div>
                        </div>
                    </div>--%>
                    <div class="row form-group">
                        <div class="col-md-2">
                            <asp:Label ID="lblTemplate" runat="server"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:DropDownList ID="ddlTemplate" runat="server" CssClass="form-control select2"
                                AppendDataBoundItems="true">
                                <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="col-md-1">
                        </div>
                        <div class="col-md-2">
                            <asp:Label ID="lblReceivers" runat="server"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtReceivers" runat="server" CssClass="form-control input-sm"
                                TextMode="multiLine" Style="resize: none" onkeypress="return acceptChars_MaxLength(event,this,500);"></asp:TextBox>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-2">
                            <asp:Label ID="lblFromDate" runat="server"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtFromdate" runat="server" CssClass="form-control input-sm"
                                Style="resize: none" onkeypress="return acceptChars_MaxLength(event,this,500);"></asp:TextBox>
                        </div>
                        <div class="col-md-1">
                        </div>
                        <div class="col-md-2">
                            <asp:Label ID="lblToDate" runat="server"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:TextBox onpaste="return true" ID="txtTodate" runat="server" CssClass="form-control input-sm"
                                Style="resize: none" onkeypress="return acceptCharsNum_MaxLength(event,this,500,MaxLength);"></asp:TextBox>
                        </div>
                        <div class="col-md-1">
                        </div>
                    </div>
                    <div class="row form-group" id="Search3" runat="server">
                        <div class="col-md-2">
                            <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
                        </div>
                        <div class="col-md-3">
                            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="form-control select2">
                                <asp:ListItem Value="2" Text="All"></asp:ListItem>
                                <asp:ListItem Value="1" Text="Message Sent"></asp:ListItem>
                                <asp:ListItem Value="0" Text="Message Not Sent"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="col-md-1">
                        </div>
                        <div class="col-md-2">
                        </div>
                        <div class="col-md-3" align="right">
                            <asp:LinkButton ID="btn_Search" runat="server" CssClass="btn src-btn fa-search" OnClick="btn_Search_Click">
                            </asp:LinkButton>
                            <asp:LinkButton ID="btn_Clear" runat="server" CssClass="btn clr-btn fa-refresh">
                            </asp:LinkButton>
                        </div>
                        <div class="col-md-1">
                        </div>
                    </div>
                </div>
            </div>
            <div class="border-table new-space" style="margin-top: 0px">
                <div class="row">
                    <div class="col-md-12" style="padding-bottom: 10px;" align="right">
                        <asp:LinkButton ID="lnkbtnPdf" runat="server" CssClass="btn del-btn fa-file-pdf-o" Text="Export PDF" OnClick="btnExport_Click" CommandName="pdf">
                        </asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnExcel" runat="server" CssClass="btn del-btn fa-file-excel-o"
                            Text="Export Excel" OnClick="btnExport_Click" CommandName="excel" >
                        </asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnCSV" runat="server" CssClass="btn src-btn fa-search" Style="display:none;" Text="Export CSV" OnClick="btnExport_Click">
                        </asp:LinkButton>
                    </div>
                </div>
                <div class="row form-group">
                    <div class="col-md-12" style="overflow: auto; overflow-y: hidden; padding-bottom: 10px">
                        <dxGridview:ASPxGridView ID="grdSmslog" EnableCallBacks="false" runat="server" ClientInstanceName="grdSmslog"
                            AutoGenerateColumns="false" KeyFieldName="logid">
                            <Columns>
                                <dxGridview:GridViewDataTextColumn FieldName="logid" VisibleIndex="1" Visible="false">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblTemplateid" runat="server" Text=' <%# Eval("logid")%>' CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                                <dxGridview:GridViewDataTextColumn Caption="Template Name" FieldName="TemplateName"
                                    VisibleIndex="2" Width="100px">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblTemplateName" runat="server" Text='<%# Eval("TemplateName")%>'
                                            CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                                <dxGridview:GridViewDataTextColumn FieldName="receivers" VisibleIndex="3" Width="100px">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblreceivers" runat="server" Text=' <%# Eval("receivers")%>' CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                                <dxGridview:GridViewDataTextColumn FieldName="Message" VisibleIndex="4" Width="300px">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblMessage" runat="server" Text=' <%# Eval("Message")%>' CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                                <dxGridview:GridViewDataTextColumn FieldName="TriggeredTimings" VisibleIndex="5" Width="100px">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblModifiedDate" runat="server" Text=' <%# Eval("TriggeredTimings")%>' CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                                <dxGridview:GridViewDataTextColumn FieldName="Status" VisibleIndex="6" Width="100px">
                                    <DataItemTemplate>
                                        <asp:Label ID="lblStatus" runat="server" Text=' <%# Eval("Status")%>' CssClass="dxlabel"></asp:Label>
                                    </DataItemTemplate>
                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                </dxGridview:GridViewDataTextColumn>
                            </Columns>
                            <SettingsPager PageSize="10">
                            </SettingsPager>
                            <SettingsText EmptyDataRow="No Records Found" />
                            <Settings ShowFilterRow="true" />
                            <SettingsBehavior SortMode="Value" AllowSort="true" AllowDragDrop="true" />
                            <Styles CssFilePath="../bootstrap/css/GridView.css" AlternatingRow-CssClass="table-bg">
                            </Styles>
                        </dxGridview:ASPxGridView>
                          <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="grdSmslog">
                            <PageFooter Right="[Page # of Pages #]">
                            </PageFooter>
                        </dxGridview:ASPxGridViewExporter>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
