<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Client/ClientMaster.master" CodeBehind="ReviewDriver.aspx.vb" Inherits="Web.ReviewDriver" %>
<%@ MasterType VirtualPath="ClientMaster.Master" %>
<%@ Register Src="~/_include/controls/SocialBox.ascx" TagPrefix="ctrl" TagName="SocialBox" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" runat="server">

    <asp:HiddenField ID="hidAgencyId" runat="server" />

    <div class="container">
        <asp:Button ID="btnGet" runat="server" Text="Get Driver" CssClass="btn btn-primary float-right" />
        <h1>Review Driver</h1>
        
        <div class="row">
            <div class="form-group col-4">
                <asp:Label runat="server" AssociatedControlID="txtFirstName" Text="First Name" />
                <asp:TextBox ID="txtFirstName" runat="server" MaxLength="50" ValidationGroup="AccountInfo" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ValidationGroup="AccountInfo" ControlToValidate="txtFirstName"
                    Text="required" Display="Dynamic" CssClass="text-danger" />
            </div>
            <div class="form-group col-3">
                <asp:Label runat="server" AssociatedControlID="txtMiddleName" Text="Middle Name" />
                <asp:TextBox ID="txtMiddleName" runat="server" MaxLength="50" ValidationGroup="AccountInfo" CssClass="form-control" />
            </div>
            <div class="form-group col-4">
                <asp:Label runat="server" AssociatedControlID="txtLastName" Text="Last Name" />
                <asp:TextBox ID="txtLastName" runat="server" MaxLength="50" ValidationGroup="AccountInfo" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ValidationGroup="AccountInfo" ControlToValidate="txtLastName"
                    Text="required" Display="Dynamic" CssClass="text-danger" />
            </div>
            <div class="form-group col-1">
                <asp:Label runat="server" AssociatedControlID="txtNameSuffix" Text="Suffix" />
                <asp:TextBox ID="txtNameSuffix" runat="server" MaxLength="50" ValidationGroup="AccountInfo" CssClass="form-control" />
            </div>
        </div>
        <div class="form-group w-25">
            <asp:Label runat="server" AssociatedControlID="txtSocial" Text="SSN" />
            <ctrl:SocialBox ID="txtSocial" runat="server" />
        </div>
        <div class="form-group w-25">
            <asp:Label runat="server" AssociatedControlID="dtBirth" Text="Date of Birth" />
            <asp:TextBox ID="dtBirth" runat="server" MaxLength="50" TextMode="Date" CssClass="form-control" />
        </div>

        <h2>Application</h2>
        <div class="table-responsive">
            <asp:GridView ID="gvDocs" runat="server" DataSourceID="dsDocs" AutoGenerateColumns="false" AllowSorting="true"
                CssClass="table floating-hscroll" CellSpacing="-1" GridLines="None">
                <HeaderStyle CssClass="thead-light clickable-rows table-hover" />
                <Columns>
                    <asp:BoundField HeaderText="File Name" SortExpression="pageFileName" DataField="pageFileName" />
                    <asp:BoundField HeaderText="Title" SortExpression="pageTitle" DataField="pageTitle" />
                    <asp:HyperLinkField DataNavigateUrlFields="pageUrl" DataNavigateUrlFormatString="{0}" Target="_blank" Text="view" />
                </Columns>
                <EmptyDataTemplate>
                    There are no documents.
                </EmptyDataTemplate>
            </asp:GridView>
            <asp:SqlDataSource ID="dsDocs" runat="server"
                SelectCommand="
                    SELECT 0 id, 'application/*' pageFileName, 'All application documents' pageTitle, CONCAT('/_assets/Document.aspx?context=FullApplication&id=', @appId) pageUrl
                    UNION
                    SELECT id, pageFileName, pageTitle, CONCAT('/_assets/Document.aspx?context=Application&id=', id) pageUrl
                    FROM web_DriverApplicationPdf WHERE appId=@appId
                    ORDER BY id">
                <SelectParameters>
                    <asp:Parameter Name="appId" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>

    </div>

</asp:Content>
