<%@ Page Title="AddUser" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="AddUser.aspx.cs" Inherits="ZFJINV.Administration.AddUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="row">
        <div class="col-md-12 mySpace">
            <div class="caption">

                <span class="caption-subject font-blue sbold" style="font-size: 150%;">Users Management</span>

            </div>
            <asp:UpdatePanel runat="server">
                <ContentTemplate>
                    <div class="portlet-body">
                        <div class="tabbable-line">
                            <ul class="nav nav-tabs ">
                                <li class="active">
                                    <a href="#tab_addProduct" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Add User</a>
                                </li>
                                <li>
                                    <a href="#tab_productList" onclick="" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Users List </a>
                                </li>

                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active" id="tab_addProduct">
                                    <div class="ui segment">
                                        <div class="ui stackable form">

                                             <div class="col-md-6">
                                                <label class="lbStyle">User Department:</label>
                                                <asp:DropDownList ID="txtUserCategory"  AutoPostBack="True" runat="server" class="select2 form-control " required="required"
                                                    AppendDataBoundItems="true" OnSelectedIndexChanged="txtDepartment_OnSelectedIndexChanged" onchange="showLoader('City')">
                                                </asp:DropDownList>
                                            </div>

                                            <div class="col-md-6">
                                                <label class="lbStyle">User Designation:</label>
                                                <asp:DropDownList ID="txtDesignation" runat="server" class="select2 form-control " required="required"></asp:DropDownList>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Username:</label>
                                                <asp:TextBox ID="txtUsername" CssClass="myInput" runat="server" title="Username" required="required"></asp:TextBox>
                                            </div>
                                            <div class="col-md-3">
                                                <label class="lbStyle">First Name</label>
                                                <asp:TextBox ID="txtFirstName" runat="server" title="First Name" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">

                                                <label class="lbStyle">Last Name</label>
                                                <asp:TextBox ID="txtLastName" title="Last Name" runat="server" class="myInput" required="required"></asp:TextBox>

                                            </div>

                                            <div class="col-md-3">
                                                <label id="lblpassword" runat="server" class="lbStyle">Password:</label>
                                                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" title="Password" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>


                                            <div class="col-md-3">
                                                <label id="lblConfirmpassword" runat="server" class="lbStyle">Confirm Password:</label>
                                                <asp:TextBox ID="txtConfirmPassword" runat="server" TextMode="Password" title="Confirm Password" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Email:</label>
                                                <asp:TextBox ID="txtEmail" runat="server" title="Email" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Mobile:</label>
                                                <asp:TextBox ID="txtMobile" runat="server" TextMode="Number" title="Mobile" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Country:</label>
                                                <asp:DropDownList ID="txtCountry" runat="server" class="select2 form-control " required="required"></asp:DropDownList>
                                            </div>                                                                                      

                                            <img src="../assets/global/img/default.gif" style="display: none" id="loaderCity" />

                                            <div class="col-md-6">
                                                <label class="lbStyle"></label>

                                            </div>

                                            <div class="newButton">

                                                <img src="../assets/global/img/ripples.gif" style="display: none; padding: 0;" id="loaderButton" />

                                                <asp:Button ID="btnAdd" runat="server" OnClick="btnSignup_Click" CssClass="btn green-meadow" Text="Save" OnClientClick="showLoader('Button')" />

                                                <asp:Button ID="btnCancel" runat="server" formnovalidate="formnovalidate" CssClass="btn red-mint " Text="Cancel" OnClick="btnCancel_Click" />
                                            </div>

                                            <div class="row">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-8 ">
                                        <div class="messagealert" id="alert_container">
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane" id="tab_productList">
                                    <asp:TextBox ID="search_textbox" runat="server" Font-Size="20px" onkeyup="Search_Gridview(this, 'gvTest')"></asp:TextBox><br />
                                    <div class="rounded-corners">
                                        <div style="width: 100%; overflow: auto;">
                                            <asp:GridView ID="grdUsers" runat="server" AllowPaging="True" AllowSorting="False"
                                                AutoGenerateColumns="False"
                                                DataKeyNames="UserID"
                                                GridLines="Horizontal"
                                                BorderColor="#ECF0F1"
                                                BorderRadius="15px"
                                                PageSize="20"
                                                AlternatingRowStyle-BackColor="#F2F3F4"
                                                RowStyle-Wrap="false"
                                                HeaderStyle-Wrap="false"
                                                RowStyle-BorderColor="#e8e8ec"
                                                CssClass="gridviewdesign "
                                                RowStyle-CssClass="GV"
                                                OnSelectedIndexChanged="grdUsers_SelectedIndexChanged"
                                                OnRowCommand="grdUsers_RowCommand"
                                                OnRowDeleting="grdUsers_RowDeleting"
                                                OnPageIndexChanging="grdUsers_PageIndexChanging"
                                                EmptyDataText="No users to display">
                                                <Columns>
                                                    <asp:CommandField
                                                        HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody"
                                                        ButtonType="Image"
                                                        HeaderText="Actions"
                                                        DeleteImageUrl="~/assets/global/img/deletee.png"
                                                        SelectImageUrl="~/assets/global/img/edit.png"
                                                        ShowDeleteButton="True"
                                                        ShowHeader="True"
                                                        ShowSelectButton="True" />
                                                    <asp:BoundField DataField="UserID" HtmlEncode="False" Visible="false" HeaderText="User ID" ReadOnly="True" SortExpression="User ID" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Username" HtmlEncode="False" HeaderText="Username" SortExpression="Username" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="FirstName" HtmlEncode="False" HeaderText="First Name" SortExpression="First Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="LastName" HtmlEncode="False" HeaderText="Last Name" SortExpression="Last Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Email" HtmlEncode="False" HeaderText="Email" SortExpression="Email" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Category" HtmlEncode="False" HeaderText="Category" SortExpression="Category" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Mobile" HtmlEncode="False" HeaderText="Mobile" SortExpression="Mobile" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Country" HtmlEncode="False" HeaderText="Country" SortExpression="Mobile" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                </Columns>
                                                <PagerStyle CssClass="pagination-ys" />
                                            </asp:GridView>
                                        </div>
                                    </div>
                                    <br />

                                </div>
                            </div>
                        </div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="grdUsers" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>

    <script type="text/javascript">
        function Search_Gridview(strKey, strGV) {
            var strGV = '<%= grdUsers.ClientID %>';
            var strData = strKey.value.toLowerCase().split(" ");
            var tblData = document.getElementById(strGV);
            var rowData;
            for (var i = 1; i < tblData.rows.length; i++) {
                rowData = tblData.rows[i].innerHTML;
                var styleDisplay = 'me';
                for (var j = 0; j < strData.length; j++) {
                    if (rowData.toLowerCase().indexOf(strData[j].toLowerCase()) != -1)
                        styleDisplay = '';
                    else {
                        styleDisplay = 'none';
                        break;
                    }
                }
                tblData.rows[i].style.display = styleDisplay;
            }
        }
    </script>
    <%--  <script type="text/javascript">
        $(function () {
            $('.search_textbox').each(function (i) {
                $(this).quicksearch("[id*=GridView1] tr:not(:has(th))", {
                    'testQuery': function (query, txt, row) {
                        return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(query[0].toLowerCase()) != -1;
                    }
                });
            });
        });
</script>--%>
</asp:Content>
