<%@ page language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Reports_TA_UI_LeavePermissionDailyReportGrid, App_Web_sye2rvl2" %>

<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" type="text/javascript"></script>

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

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

    <div class="content-header" id="conHeader" runat="server">
        <h1 style="background-image: url(../dist/img/swipe-icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblShiftReport" runat="server" Text="Leave Details"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div id="myModal" class="modal modal-default fade" role="dialog">
            <div class="modal-dialog" style="min-width: 85%;">
                <!-- Modal content-->
                <div class="modal-content" style="margin-top: 50px">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" style="border-radius: 50px;">
                            &times;</button>
                        <h4 class="modal-title" style="padding-bottom: 10px">
                            <asp:Label ID="lblSelectEmployee" runat="server" Text="Select Employee"></asp:Label>
                        </h4>
                    </div>
                    <div class="modal-body" style="padding-top: 0px">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="650px"
                            style="border-style: none"></iframe>
                    </div>
                    <div class="modal-footer" style="display: none">
                        <button type="button" class="btn btn-primary pull-right" data-dismiss="modal">
                            Close</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filters"></asp:Label>
                        <input id="Hidden1" type="hidden" value='<% Response.Write(Session["IDateFormat"].ToString()); %>' />
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="collapseOne">
            <div class="emp-filter">
                <div class="form-horizontal">
                    <%-- <tr>
                        <td class="ModuleTitle" colspan="5" style="height: 24px" valign="top">
                            <table>
                                <tr>
                                    <td style="width: 20%" class="td">
                                        </td>
                                    <td width="68%">
                                        <asp:TextBox ID="txtApprovalTO" runat="server" OnKeyPress="return false" CssClass="textbox_4"
                                            Width="500px" Height="40px" TextMode="MultiLine"></asp:TextBox>
                                        <asp:Button ID="btnApprovalTO" runat="server" CssClass="but" Text="To..." Width="28px"
                                            OnClientClick="javascript:return openPopupMailTo();" /></td>
                                </tr>
                                <tr>
                                    <td style="width: 20%" class="td">
                                        <asp:Label ID="lblApprovalCC" runat="server" Font-Bold="true" Text="Cc Mail Ids"></asp:Label></td>
                                    <td width="68%">
                                        <asp:TextBox ID="txtApprovalCC" runat="server" CssClass="textbox_4" OnKeyPress="return false"
                                            Width="500px" Height="40px" TextMode="MultiLine"></asp:TextBox>
                                        <asp:Button ID="btnApprovalCC" runat="server" CssClass="but" Text="Cc..." Width="28px"
                                            OnClientClick="javascript:return openPopupMailCc();" /></td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="5" style="height: 65px" valign="bottom">
                                        <table align="center" border="0" cellpadding="5" cellspacing="0">
                                            <tr>
                                                <td align="center" style="height: 32px;" valign="middle">
                                                    
                                                </td>
                                                <td align="center" style="height: 32px" valign="middle">
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>--%>
                    <div class="row form-group">
                        <div id="divToMail" runat="server">
                            <div class="col-md-2">
                                <asp:Label ID="lblApprovalTO" runat="server" Text="To Mail Ids"></asp:Label>
                            </div>
                            <div class="col-md-9">
                                <div class="input-group input-group-sm">
                                    <asp:TextBox ID="txtApprovalTO" runat="server" CssClass="form-control man-dat" Height="70px"
                                        TextMode="MultiLine" OnKeyPress="return false" placeholder="Use Semicolon(;) to separate Email Ids"
                                        Style="resize: none"></asp:TextBox>
                                    <span class="input-group-btn">
                                        <asp:Button ID="btnApprovalTO" runat="server" CssClass="btn save-btn" Text="To..."
                                            Style="min-width: 45px" Height="70px" OnClientClick="javascript:return openPopupMailTo();"
                                            data-toggle="modal" data-target="#myModal" />
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-2">
                            <asp:Label ID="lblApprovalCC" runat="server" Text="Cc Mail Ids"></asp:Label>
                        </div>
                        <div class="col-md-9">
                            <div class="input-group input-group-sm">
                                <asp:TextBox ID="txtApprovalCC" runat="server" CssClass="form-control" TextMode="MultiLine"
                                    placeholder="Use Semicolon(;) to separate Email Ids" Style="resize: none" Height="70px"></asp:TextBox>
                                <span class="input-group-btn">
                                    <asp:Button ID="btnApprovalCC" runat="server" CssClass="btn save-btn" Text="Cc..."
                                        Style="min-width: 45px" OnClientClick="javascript:return openPopupMailCc();"
                                        data-toggle="modal" data-target="#myModal" Height="70px" />
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-5"></div>
                        <div class="col-md-6">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btnSendMail" runat="server" CssClass="btn save-btn fa-envelope-o" OnClick="Button1_Click"
                                    Text="  Send Mail" />
                                <asp:LinkButton ID="btn_Back" Text="  Back" CssClass="btn save-btn fa-angle-left" runat="server" OnClick="btn_Back_Click" />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-11" style="overflow: auto; padding-bottom: 10px;">
                            <div id="divLeave" runat="SERVER">
                                <asp:GridView ID="grv_DailyLeave" runat="server" AutoGenerateColumns="False" AllowPaging="False"
                                    Style="font-family: Arial; font-size: 11px" AllowSorting="False" CssClass="table das-table1"
                                    OnRowDataBound="grv_DailyLeave_RowDataBound" BorderWidth="1px">
                                    <RowStyle Height="30px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="S.No" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <%#Container.DataItemIndex+1 %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name of the Executive" SortExpression="Executive Name">
                                            <ItemTemplate>
                                                <asp:Label ID="lblEmployeename" Text='<%# Eval("Executive Name") %>' runat="server">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Department" ItemStyle-HorizontalAlign="Center" SortExpression="Department"
                                            HeaderStyle-BorderStyle="Solid">
                                            <ItemTemplate>
                                                <asp:Label ID="lblLevelName" Text='<%# Eval("Department") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From" SortExpression="FromDate" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFrom" Text='<%# Eval("FromDate") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To" SortExpression="ToDate" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTo" Text='<%# Eval("ToDate") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From Session" SortExpression="Leave_SessionFrom" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFromSession" Text='<%# Eval("Leave_SessionFrom") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To Session" SortExpression="Leave_SessionTo" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblToSession" Text='<%# Eval("Leave_SessionTo") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total Days" SortExpression="NumberOfDays" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTotalDays" runat="server" Text='<%# Eval("NumberOfDays") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Status" SortExpression="Status" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <HeaderStyle CssClass="empheader" />
                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                        PreviousPageText="<" />
                                    <AlternatingRowStyle BackColor="white" />
                                </asp:GridView>
                                <br />
                                <br />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-11" style="overflow: auto; padding-bottom: 10px;">
                            <div id="divPermission" runat="SERVER">
                                <asp:GridView ID="grv_Permission" runat="server" AutoGenerateColumns="False" AllowPaging="False"
                                    CssClass="table das-table1" Style="font-family: Arial; font-size: 11px" AllowSorting="False"
                                    OnRowDataBound="grv_Permission_RowDataBound" BorderColor="white" BorderWidth="1px">
                                    <RowStyle Height="30px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="S.No" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <%#Container.DataItemIndex+1 %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name of the Executive" SortExpression="empName">
                                            <ItemTemplate>
                                                <asp:Label ID="lblEmployeename" Text='<%# Eval("empName") %>' runat="server">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Department" SortExpression="BranchName" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblLevelName" Text='<%# Eval("BranchName") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Date" SortExpression="Permission_Date" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPermissionDate" Text='<%# Eval("Permission_Date") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From" SortExpression="Permission_FromTime" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFrom" Text='<%# Eval("Permission_FromTime") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To" SortExpression="Permission_ToTime" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTo" Text='<%# Eval("Permission_ToTime") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total Hours" SortExpression="TotalHours" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTotalHrs" runat="server" Text='<%# Eval("TotalHours") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Status" SortExpression="Permission_Status" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Permission_Status") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <HeaderStyle CssClass="empheader" />
                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                        PreviousPageText="<" />
                                    <AlternatingRowStyle BackColor="white" />
                                </asp:GridView>
                                <br />
                                <br />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-11" style="overflow: auto; padding-bottom: 10px;">
                            <div id="divLeaveUnPlanned" runat="server">
                                <asp:GridView ID="grdUnPlannedLeave" runat="server" AutoGenerateColumns="False" AllowPaging="False"
                                    CssClass="table das-table1" Style="font-family: Arial; font-size: 11px" AllowSorting="False"
                                    OnRowDataBound="grdUnPlannedLeave_RowDataBound" BorderColor="white" BorderWidth="1px">
                                    <RowStyle Height="30px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="S.No" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <%#Container.DataItemIndex+1 %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name of the Executive" SortExpression="Executive Name">
                                            <ItemTemplate>
                                                <asp:Label ID="lblEmployeename" Text='<%# Eval("Executive Name") %>' runat="server">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Department" ItemStyle-HorizontalAlign="Center" SortExpression="Department">
                                            <ItemTemplate>
                                                <asp:Label ID="lblLevelName" Text='<%# Eval("Department") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From" SortExpression="FromDate" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFrom" Text='<%# Eval("FromDate") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To" SortExpression="ToDate" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTo" Text='<%# Eval("ToDate") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From Session" SortExpression="Leave_SessionFrom" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFromSession" Text='<%# Eval("Leave_SessionFrom") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To Session" SortExpression="Leave_SessionTo" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblToSession" Text='<%# Eval("Leave_SessionTo") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total Days" SortExpression="NumberOfDays" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTotalDays" runat="server" Text='<%# Eval("NumberOfDays") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Status" SortExpression="Status" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <HeaderStyle CssClass="empheader" />
                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                        PreviousPageText="<" />
                                    <AlternatingRowStyle BackColor="white" />
                                </asp:GridView>
                                <br />
                                <br />
                            </div>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-md-11" style="overflow: auto; padding-bottom: 10px;">
                            <div id="divPermissionUnPlanned" runat="server">
                                <asp:GridView ID="grdUnplannedPermission" runat="server" AutoGenerateColumns="False"
                                    CssClass="table das-table1" AllowPaging="False" Style="font-family: Arial; font-size: 11px"
                                    AllowSorting="False" OnRowDataBound="grdUnplannedPermission_RowDataBound" BorderColor="white"
                                    BorderWidth="1px">
                                    <RowStyle Height="30px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="S.No" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <%#Container.DataItemIndex+1 %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name of the Executive" SortExpression="empName">
                                            <ItemTemplate>
                                                <asp:Label ID="lblEmployeename" Text='<%# Eval("empName") %>' runat="server">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Department" SortExpression="BranchName" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblLevelName" Text='<%# Eval("BranchName") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Date" SortExpression="Permission_Date" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPermissionDate" Text='<%# Eval("Permission_Date") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="From" SortExpression="Permission_FromTime" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFrom" Text='<%# Eval("Permission_FromTime") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="To" SortExpression="Permission_ToTime" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTo" Text='<%# Eval("Permission_ToTime") %>' runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total Hours" SortExpression="TotalHours" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblTotalHrs" runat="server" Text='<%# Eval("TotalHours") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Status" SortExpression="Permission_Status" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Permission_Status") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <HeaderStyle CssClass="empheader" />
                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />
                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                        PreviousPageText="<" />
                                    <AlternatingRowStyle BackColor="white" />
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script language="javascript" type="text/javascript">
        //function openPopupMailTo()
        //   {
        //        var MailType="TO";
        //        window.open('GetEmailIdsPopup.aspx?MailType=' + MailType + '','Test','height=610,top=200,left=250,width=620');
        //        return false;
        //   }
        //    function openPopupMailCc()
        //   {
        //        var MailType="CC";
        //        window.open('GetEmailIdsPopup.aspx?MailType=' + MailType + '','Test','height=610,top=200,left=250,width=620');
        //        return false;
        //   } 
        //   
        function openPopupMailTo() {
            var MailType = "TO";
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = 'GetEmailIdsPopup.aspx?MailType=' + MailType + '', '';
            // window.open('GetEmailIdsPopup.aspx?MailType=' + MailType + '', '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no,height=700,top=200,left=250,width=800;scrollbars=yes');
            return false;
        }
        function openPopupMailCc() {
            var MailType = "CC";
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = 'GetEmailIdsPopup.aspx?MailType=' + MailType + '', '';
            // window.open('GetEmailIdsPopup.aspx?MailType=' + MailType + '', '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no,height=700,top=200,left=250,width=800;scrollbars=yes');
            return false;
        }
    </script>

</asp:Content>
