<%@ control language="VB" autoeventwireup="false" inherits="PCC_DC_CC_ADUserManageCert, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>


<asp:Panel ID="Pnl_UserCertList" runat="server">
    <%--Start Search Box--%>
    <asp:Panel ID="Pnl_Search" DefaultButton="Btn_Search" runat="server" CssClass="row">

        <div class="panel-group search-panel" id="AS_SearchCert" role="tablist" aria-multiselectable="true">
            <div class="col-xs-12" role="tab" id="SH_SearchCert">
                <div class="card">
                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_SearchCert" href="#<%= CSB_SearchCert.ClientID%>" aria-expanded="true" aria-controls="SH_SearchCert">
                        <h3>
                            <asp:Literal ID="Ltrl_SearchHeader" runat="server" Text="<% $Resources:Content, GN0000395%>"></asp:Literal>
                        </h3>
                    </div>
                    <div id="CSB_SearchCert" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_SearchCert" aria-expanded="false">
                        <div class="row">
                            <div class="col-md-3 col-sm-6 col-xs-12" runat="server" id="Td_SearchOwner">
                                <div class="form-group form-float">
                                    <asp:DropDownList ID="DDl_SearchOwner" runat="server" onchange="setOwnerCookie(this)"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_DC" runat="server">
                                <div class="form-group form-float">
                                    <asp:DropDownList ID="DDl_SearchDC" runat="server">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12" id="TR_SearchCustomerId" runat="server">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SearchCustId" runat="server"></asp:TextBox>
                                        <asp:Label ID="Lbl_SearchCustId" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>" class="form-label"></asp:Label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12" id="TR_SearchCustName" runat="server">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SearchCustName" runat="server"></asp:TextBox>
                                        <asp:Label ID="Lbl_SearchCustName" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0000268%>" class="form-label"></asp:Label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 col-sm-6 col-xs-12" id="Td_SearchOUName" runat="server">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SearchOUName" runat="server"></asp:TextBox>
                                        <asp:Label ID="Lbl_SearchOUName" runat="server" EnableViewState="false" Text="<%$ Resources:Content,DGN1110608%>" class="form-label"></asp:Label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12" id="Td_SearchUser" runat="server">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SearchUser" runat="server"></asp:TextBox>
                                        <asp:Label ID="Lbl_SearchUser" runat="server" EnableViewState="false" Text="<%$ Resources:Content,GN0001288%>" class="form-label"></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_SearchCertificate" runat="server"></asp:TextBox>
                                        <asp:Label ID="Lbl_SearchCertificate" runat="server" EnableViewState="false" Text="<%$ Resources:Content,StrCertificate%>" class="form-label"></asp:Label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <div class="form-group form-float">
                                    <asp:Button ID="Btn_Search" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,GN0000391%>" />
                                    <asp:Button ID="Btn_Clear" Visible="false" class="btn btn-primary waves-effect" runat="server"
                                        Text="<%$ Resources:Content,String289 %>" />
                                </div>
                            </div>

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

    </asp:Panel>

    <div class="row">
        <div class="col-xs-12 Div_OpsRow" id="Tbl_Operations" runat="server">
            <div class="card">
                <div class="header">
                    <div class="displayInlineBlock">
                        <h3>
                            <asp:Literal ID="Ltrl_OpsHeader" runat="server" Text="<% $Resources:Content, GN00001320%>"></asp:Literal>
                        </h3>
                    </div>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-sm-9 col-xs-12">
                            <asp:Button ID="Btn_AddUserCert" runat="server" class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,strADUserAssignCertificate%>" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%--Start GV_List--%>
        <div class="col-xs-12" id="Pnl_Listing" runat="server">
            <asp:GridView CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                ID="GV_List" DataKeyNames="UserCertificateId, CertificateId,CertThumbprint, ADUserId,DisplayName,ADDomainId,UserLDAP,HostedOrgId,CustomerId,CompanyId,PendingJobId"
                AllowPaging="True" AllowSorting="True" runat="server" AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField HeaderText="Certificate" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                        <ItemTemplate>
                            <asp:Label ID="LB_Certificate" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CertThumbprint")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Issued From" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3" SortExpression="CertIssuedBy">
                        <ItemTemplate>
                            <asp:Label ID="LB_IssuedFrom" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CertIssuedBy")%>'> </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Start Date" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1" SortExpression="CertStartDate">
                        <ItemTemplate>
                            <asp:Label ID="LB_StartDate" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CertStartDate")%>'> </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="End Date" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1" SortExpression="CertEndDate">
                        <ItemTemplate>
                            <asp:Label ID="LB_EndDate" runat="server"  Text='<%#DataBinder.Eval(Container, "DataItem.CertEndDate")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="Status" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                        <ItemTemplate>
                            <asp:Label ID="LB_Status" runat="server" ></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText="<%$ Resources:Content, UserDetails %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3" SortExpression="LogonName">
                        <ItemTemplate>
                            <table class="table small">
                                <tr id="TR_LogOnName" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.String436%>:</td>
                                    <td>
                                        <asp:Label ID="LB_LogonName" Text='<%#DataBinder.Eval(Container, "DataItem.LogonName")%>'
                                            runat="server">
                                        </asp:Label>
                                    </td>
                                </tr>
                                <tr id="TR_UPName" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.String336%>:</td>
                                    <td>
                                        <asp:Label ID="LB_UPName" Text='<%#DataBinder.Eval(Container, "DataItem.UPN")%>'
                                            runat="server">
                                        </asp:Label>
                                    </td>
                                </tr>
                                <tr id="TR_DisplayName" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.DisplayName%>:</td>
                                    <td>
                                        <asp:Label ID="LB_DisplayName" Text='<%#DataBinder.Eval(Container, "DataItem.DisplayName")%>'
                                            runat="server">
                                        </asp:Label>
                                    </td>
                                </tr>
                                <tr id="TR_OUName" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.DGN1110608%>:</td>
                                    <td>
                                        <asp:Label ID="LB_OUName" Text='<%#DataBinder.Eval(Container, "DataItem.OrganizationName")%>'
                                            runat="server">
                                        </asp:Label>
                                    </td>
                                </tr>
                                <tr id="TR_PreferredDC" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.DGN1110433%>:</td>
                                    <td>
                                        <asp:Label ID="LB_PreferredDC" Text='<%#DataBinder.Eval(Container, "DataItem.ADDomainName")%>'
                                            runat="server">
                                        </asp:Label>
                                    </td>
                                </tr>
                                <tr id="TR_ClientID" runat="server">
                                    <td class="row-label col-md-6"><%= Resources.Content.GN0000850%>:</td>
                                    <td>
                                        <asp:HyperLink ID="LB_ClientID" runat="server"></asp:HyperLink>
                                    </td>
                                </tr>

                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                        <ItemTemplate>
                            <ul class="option-menu" id="div_options" runat="server">
                                <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_RemoveUserCert" Text="<%$ Resources:Content,GN0000278%>" SkinID="linkButtonDel"
                                                CommandArgument='<%#DataBinder.Eval(Container, "DataItem.UserCertificateId")%>' runat="server"
                                                CommandName="RemoveUserCert" CssClass="btnAction">
                                            </asp:LinkButton></li>
                                        <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" TargetControlID="LB_RemoveUserCert" />
                                    </ul>
                                </li>
                            </ul>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerTemplate>
                    <EM:Pager ID="Pager1" runat="server" />
                </PagerTemplate>
            </asp:GridView>
        </div>
    </div>
</asp:Panel>

<asp:Panel ID="Pnl_AddUserCert" runat="server" Visible="false">
    <div class="row" id="Div_Select_Owner" runat="server">
        <div class="col-sm-3 col-xs-12 row-label">
            <label>
                <asp:Literal ID="Ltrl_SelectOwner" runat="server" Text="<%$ Resources:Content,Owner %>"></asp:Literal>:</label>
        </div>
        <div class="col-sm-4 col-xs-12">
            <div class="form-group">
                <asp:DropDownList ID="Ddl_SelectOwner" runat="server" AutoPostBack="true"></asp:DropDownList>
            </div>
        </div>
    </div>
    <div class="row" id="Div_DDl_Customer" runat="server">
        <div class="col-sm-3 col-xs-12 row-label">
            <label>
                <asp:Literal ID="Ltrl_SelectCustomer" runat="server" Text="<%$ Resources:Content,GN0000889 %>"></asp:Literal>:</label>
        </div>
        <div class="col-sm-4 col-xs-12">
            <div class="form-group">
                <asp:DropDownList ID="Ddl_SelectCustomer" runat="server" AutoPostBack="true"></asp:DropDownList>
            </div>
        </div>
    </div>
    <div class="row" id="Div_Ddl_SelectOU" runat="server">
        <div class="col-sm-3 col-xs-12 row-label">
            <label>
                *<asp:Literal ID="Ltrl_SelectOU" runat="server" Text='<%$Resources:Content, AD0000100%>'
                    EnableViewState="False">
                </asp:Literal>:</label>
        </div>
        <div class="col-sm-4 col-xs-12">
            <div class="form-group">
                <asp:DropDownList ID="DDL_SelectOU" runat="server" AutoPostBack="true">
                </asp:DropDownList>
            </div>
        </div>
    </div>
    <div class="row" id="Div_Ddl_SelectADUser" runat="server">
        <div class="col-sm-3 col-xs-12 row-label">
            <label>
                <asp:Literal ID="Ltrl_SelectADUser" runat="server" Text="<%$ Resources:Content,GN00001322 %>"></asp:Literal>:</label>
        </div>
        <div class="col-sm-4 col-xs-12">
            <div class="form-group">
                <asp:DropDownList ID="DDL_SelectADUser" AutoPostBack="true" runat="server"></asp:DropDownList>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-3 col-xs-12 row-label">
            <label>
                <asp:Literal ID="Ltrl_SelectUserCert" runat="server" Text="Select Certificate"></asp:Literal>:</label>
        </div>
        <div class="col-sm-4 col-xs-12">
            <div class="form-group">
                <div class="fileupload fileupload-new" data-provides="fileupload">
                    <span class="btn btn-primary btn-file"><span class="fileupload-new"><%= Resources.Content.strSelectFile%></span>
                        <span class="fileupload-exists"><%= Resources.Content.GN0000385%></span>
                        <asp:FileUpload ID="FU_UserCert" runat="server" />
                    </span>
                    <span class="fileupload-preview"></span>
                    <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                    <asp:RequiredFieldValidator ID="RFV_UserCert" runat="server" ControlToValidate="FU_UserCert"
                        Display="None" SetFocusOnError="True" ValidationGroup="AddUserCert" ErrorMessage='<%$Resources:Content,USM0077 %>'></asp:RequiredFieldValidator>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-xs-12">
            <asp:Button ID="Btn_UserCertSave" runat="server" ValidationGroup="AddUserCert" CausesValidation="True"
                class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,GN0000281%>" />

            <asp:Button ID="Btn_UserCertCancel" runat="server" CausesValidation="false" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,GN0000572%>" />
        </div>
    </div>
</asp:Panel>
