<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Driver2/Application/Application2.master" CodeBehind="Licenses.aspx.vb" Inherits="Web.Licenses" %>
<%@ MasterType VirtualPath="Application2.Master" %>
<%@ Register TagPrefix="ctrl" Namespace="Web" Assembly="Web" %>
<%@ Register Src="~/_include/controls/StatePicker.ascx" TagPrefix="ctrl" TagName="StatePicker" %>
<%@ Register Src="~/_include/controls/YesNoPicker.ascx" TagPrefix="ctrl" TagName="YesNoPicker" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" runat="server">

    <h1>Licenses</h1>


    <h3>Driving Licenses for Past (3) Years Prior to Application Date</h3>

    <ctrl:FormList ID="rptLicenses" runat="server" AddText="Add License"><ItemTemplate>
        <asp:HiddenField ID="hidLicenseId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveLicense" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveLicense_Click" 
                    Text="Remove" />
            </div>
            <h1><%# If(Container.ItemIndex = 0,
                "Current Driver's License",
                "License " & CStr(Container.ItemIndex + 1)) %></h1>

            <ul class="formFields">
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtLicenseNumber"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtLicenseNumber"
                        Text="License Number" />
                    <asp:TextBox ID="txtLicenseNumber" runat="server" MaxLength="128" />
                </li>
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlLicenseState"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ddlLicenseState"
                        Text="State of Issue" />
                    <ctrl:StatePicker ID="ddlLicenseState" runat="server" />
                </li>
                <li class="left">
                    <asp:Label runat="server" AssociatedControlID="txtLicenseType"
                        Text="Class" />
                    <asp:TextBox ID="txtLicenseType" runat="server" MaxLength="50" />
                </li>
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtLicenseExpires"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtLicenseExpires"
                        Text="Expiration Date" />
                    <asp:TextBox ID="txtLicenseExpires" runat="server" MaxLength="50" TextMode="Date" />
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ynCDL"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ynCDL"
                        Text="Is this a Commercial Driver's License (CDL)?" />
                    <ctrl:YesNoPicker ID="ynCDL" runat="server" />
                </li>
                <li class="small">
                    <label>Endorsements</label>
                    <asp:CheckBox ID="chkN" runat="server" Text="N" />
                    <asp:CheckBox ID="chkS" runat="server" Text="S" />
                    <asp:CheckBox ID="chkH" runat="server" Text="H" />
                    <asp:CheckBox ID="chkX" runat="server" Text="X" />
                    <asp:CheckBox ID="chkT" runat="server" Text="T" />
                    <asp:CheckBox ID="chkP" runat="server" Text="P" />
                </li>
                <li class="right">
                    <asp:Label runat="server" AssociatedControlID="txtLicenseRestrictions" 
                        Text="Restrictions" />
                    <asp:TextBox ID="txtLicenseRestrictions" runat="server" MaxLength="50" />
                </li>
            </ul>

        </section>
    </ItemTemplate></ctrl:FormList>


    <section>
        <h3>General</h3>

        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynLicenseDenied"
                    Text="required" Display="Dynamic" CssClass="required" />
                Have you ever been denied a license, permit, or privilege to operate a motor vehicle?
                    
                <ctrl:YesNoPicker ID="ynLicenseDenied" runat="server" />
                <ul class="dependent"
                    data-dependency="<%= ynLicenseDenied.ClientID %>"
                    data-value="true">
                    <li>
                    <ctrl:RequiredDependentFieldValidator runat="server" ControlToValidate="txtLicenseDeniedExplanation"
                        DependencyControl="ynLicenseDenied" WhenValue="true"
                        Text="required" Display="Dynamic" CssClass="required" />
                        <asp:Label runat="server" AssociatedControlID="txtLicenseDeniedExplanation"
                            Text="If yes, please explain" />
                        <asp:TextBox ID="txtLicenseDeniedExplanation" runat="server"
                            TextMode="MultiLine" MaxLength="256" />
                    </li>
                </ul>
            </li>
        </ul>

        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynLicenseRevoked"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynLicenseRevoked"
                    Text="Have you ever had any license, permit, or privilege to operate ever suspended or revoked?" />
                <ctrl:YesNOPicker ID="ynLicenseRevoked" runat="server" />
                <ul class="dependent"
                    data-dependency="<%= ynLicenseRevoked.ClientID %>"
                    data-value="true">
                    <li>
                    <ctrl:RequiredDependentFieldValidator runat="server" ControlToValidate="txtLicenseRevokedExplanation"
                        DependencyControl="ynLicenseRevoked" WhenValue="true"
                        Text="required" Display="Dynamic" CssClass="required" />
                        <asp:Label runat="server" AssociatedControlID="txtLicenseRevokedExplanation"
                            Text="If yes, please explain" />
                        <asp:TextBox ID="txtLicenseRevokedExplanation" runat="server"
                            TextMode="MultiLine" MaxLength="256" />
                    </li>
                </ul>
            </li>
        </ul>
        <ul class="formFields">
            <p>A copy of a current, valid license is required per §383.23(a), §391.11(b)(5), and §391.33 of the Federal
            Motor Carrier Safety Regulations. Please make copies of the front and back of your current driver’s
            license and attach below.</p>
        </ul>
        <ul class="formFields">
            <li class="big">
                <asp:RegularExpressionValidator runat="server" ControlToValidate="uplFront"
                    Text="must be in gif, jpeg, or png format" Display="Dynamic" CssClass="required no-hide"
                    ValidationExpression="^.*?\.([Gg][Ii][Ff]|[Jj][Pp][Ee]?[Gg]|[Pp][Nn][Gg])$" />
                <asp:Label runat="server" AssociatedControlID="uplFront"
                    Text="Front" />
                <asp:FileUpload ID="uplFront" runat="server" accept=".png,.jpg,.jpeg,.gif" />
            </li>
            <li>
                <label>Preview</label>
                <asp:Image ID="imgFront" runat="server" CssClass="upload-image-preview" ImageUrl="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMCIgaGVpZ2h0PSIwIj48L3N2Zz4=" />
            </li>
        </ul>
        <ul class="formFields">
            <li class="big">
                <asp:RegularExpressionValidator runat="server" ControlToValidate="uplBack"
                    Text="must be in gif, jpeg, or png format" Display="Dynamic" CssClass="required no-hide"
                    ValidationExpression="^.*?\.([Gg][Ii][Ff]|[Jj][Pp][Ee]?[Gg]|[Pp][Nn][Gg])$" />
                <asp:Label runat="server" AssociatedControlID="uplBack"
                    Text="Back" />
                <asp:FileUpload ID="uplBack" runat="server" accept=".png,.jpg,.jpeg,.gif" />
            </li>
            <li>
                <label>Preview</label>
                <asp:Image ID="imgBack" runat="server" CssClass="upload-image-preview" ImageUrl="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMCIgaGVpZ2h0PSIwIj48L3N2Zz4=" />
            </li>
        </ul>
    </section>

</asp:Content>
