@{
    ViewData["Title"] = "Edit Profile";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@model EForT.Models.Legacy.EditUserProfileModel

@using (Html.BeginForm("EditUserProfile", "RegisteredUser", FormMethod.Post, Model.EditProfile))
{
    @Html.HiddenFor(m => m.EditProfile.UserID, new { id = "hdnUserID" })
    @Html.HiddenFor(m => m.EditProfile.UserEmailAddress, new { id = "hdnUserEmailAddress" })
    @Html.HiddenFor(m => m.EditProfile.UserName, new { id = "hdnUserName" })

    <div>
        <div class="app-content container center-layout py-3">
            <div class="content-header row">
                <div class="content-header-left col-12 mb-2">
                    <h1 class="content-header-title mb-0">Edit User Profile</h1>
                    <div class="row breadcrumbs-top">
                        <div class="breadcrumb-wrapper col-12">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item">
                                    <a href="@Url.Action("Index", "RegisteredUser")">Home</a>
                                </li>
                                <li class="breadcrumb-item">
                                    <a href="#">Edit Profile</a>
                                </li>
                                <li class="breadcrumb-item active">
                                    Standard Account
                                </li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content-wrapper">
                <div class="content-body">
                    <div class="row pb-2">
                        <div class="col-lg-4 col-md-12 col-sm-12 col-12 pb-md-2 pb-sm-2 pb-lg-0 pb-xl-0 pb-2">
                            <div class="card h-100">
                                <div class="card-header">
                                    <div class="font-medium-2 bottom-border">
                                        <p>Personal Information</p>
                                    </div>
                                </div>
                                <div class="card-body">
                                    <fieldset class="form-group">
                                        <label for="TitleID">Title <i class="warning">*</i></label>
                                        <select class="form-control" asp-for="EditProfile.TitleID" id="TitleID" required>
                                            <option value="" selected disabled>Select</option>
                                            @if (Model.ListTitles != null)
                                            {
                                                if (Model.ListTitles.Count > 0)
                                                {
                                                    for (int i = 0; i < Model.ListTitles.Count; i++)
                                                    {
                                                        <option value="@Model.ListTitles[i].TitleID">@Model.ListTitles[i].TitleDescription</option>
                                                    }
                                                }
                                            }
                                        </select>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserFirstName">First Name <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserFirstName" id="UserFirstName" maxlength="50" required>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserMiddleInitial">Middle Initial</label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserMiddleInitial" id="UserMiddleInitial" maxlength="1">
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserLastName">Last Name <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserLastName" id="UserLastName" maxlength="50" required>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="pickerUserDOB">Date of Birth <i class="warning">*</i></label>
                                        <input type='text' class="form-control" asp-for="EditProfile.UserDOB" id="pickerUserDOB" required />
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserPhone">Primary Phone <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserPhone" id="UserPhone" maxlength="50" required>
                                    </fieldset>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-12 col-sm-12 col-12 pb-md-2 pb-sm-2 pb-lg-0 pb-xl-0 pb-2">
                            <div class="card h-100">
                                <div class="card-header">
                                    <div class="font-medium-2 bottom-border">
                                        <p>Residential Information</p>
                                    </div>
                                </div>
                                <div class="card-body">
                                    <fieldset class="form-group">
                                        <label for="CountryID">Country of Residence <i class="warning">*</i></label>
                                        <select class="form-control" asp-for="EditProfile.CountryID" id="CountryID" required>
                                            <option value="" selected disabled>Select</option>
                                            @if (Model.ListCountries != null)
                                            {
                                                if (Model.ListCountries.Count > 0)
                                                {
                                                    for (int i = 0; i < Model.ListCountries.Count; i++)
                                                    {
                                                        <option value="@Model.ListCountries[i].CountryID">@Model.ListCountries[i].CountryDescription</option>
                                                    }
                                                }
                                            }
                                        </select>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserAddress1">Address <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserAddress1" id="UserAddress1" maxlength="50" required>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserAddress2">Address Cont.</label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserAddress2" id="UserAddress2" maxlength="50">
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserCity">City <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserCity" id="UserCity" maxlength="50" required>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="StateID">State <i class="warning">*</i></label>
                                        <select class="form-control" asp-for="EditProfile.StateID" id="StateID" required>
                                            <option value="" selected disabled>Select</option>
                                            @if (Model.ListStates != null)
                                            {
                                                if (Model.ListStates.Count > 0)
                                                {
                                                    for (int i = 0; i < Model.ListStates.Count; i++)
                                                    {
                                                        <option value="@Model.ListStates[i].StateID">@Model.ListStates[i].StateDescription</option>
                                                    }
                                                }
                                            }
                                        </select>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserZipCode">Zip Code <i class="warning">*</i></label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserZipCode" id="UserZipCode" maxlength="10" required>
                                    </fieldset>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-12 col-sm-12 col-12">
                            <div class="card h-100">
                                <div class="card-header">
                                    <div class="font-medium-2 bottom-border">
                                        <p>EForT Account Information</p>
                                    </div>
                                </div>
                                <div class="card-body">
                                    <fieldset class="form-group">
                                        <label for="RoleID">Role</label>
                                        <select class="form-control" asp-for="EditProfile.RoleID" id="RoleID" disabled>
                                            @if (Model.ListRoles != null)
                                            {
                                                if (Model.ListRoles.Count > 0)
                                                {
                                                    <option value="@Model.ListRoles[0].RoleID">@Model.ListRoles[0].RoleDescription</option>
                                                }
                                            }
                                        </select>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserEmailAddress">Email Address</label>
                                        <input type="email" class="form-control" asp-for="EditProfile.UserEmailAddress" id="UserEmailAddress" maxlength="100" disabled>
                                    </fieldset>
                                    <fieldset class="form-group">
                                        <label for="UserName">Username</label>
                                        <input type="text" class="form-control" asp-for="EditProfile.UserName" id="UserName" placeholder="Username must be 8-15 characters" maxlength="15" disabled>
                                    </fieldset>
                                    <button type="submit" class="btn btn-primary my-1 mr-1">Submit</button>
                                    <a href="@Url.Action("Index", "RegisteredUser")" class="btn btn-secondary my-1">Cancel </a>
                                </div>
                            </div>
                        </div>
                    </div>                
                </div>
            </div>
        </div>
    </div>
}
