@model EForT.Models.Legacy.AdminModel

<div class="modal fade text-left" id="editTerminalModal" tabindex="-1" role="dialog" aria-labelledby="editTerminalModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="editTerminalModalLabel">Manage MT4 Terminal</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <form id="editTerminalForm" asp-action="ManageTerminal" asp-controller="RegisteredUser" method="post">
                <input type="hidden" asp-for="EditTerminal.TerminalID" id="hdnTerminalID" />
                <input type="hidden" asp-for="EditTerminal.ExpertAdvisorInstanceID" id="hdnExpertAdvisorInstanceID" />
                <div class="modal-body">
                    <fieldset class="form-group floating-label-form-group">
                        <label for="UserID">User: <i class="warning">*</i></label>
                        <select class="form-control" asp-for="EditTerminal.UserID" id="UserID" onchange="getForexCombo(this)" required>
                            <option value="" selected disabled>Select</option>
                            @if (Model.ListBasicTraders != null)
                            {
                                if (Model.ListBasicTraders.Count > 0)
                                {
                                    for (int i = 0; i < Model.ListBasicTraders.Count; i++)
                                    {
                                        <option value="@Model.ListBasicTraders[i].UserID">@Model.ListBasicTraders[i].UserName</option>
                                    }
                                }
                            }
                        </select>
                    </fieldset>
                    <fieldset class="form-group floating-label-form-group">
                        <label for="ForexID">Forex Account: <i class="warning">*</i></label>
                        <select class="form-control" asp-for="EditTerminal.ForexID" id="ForexID" required>
                            <option value="" selected disabled>Select a user first</option>
                            @if (Model.ListForexAccounts != null)
                            {
                                if (Model.ListForexAccounts.Count > 0)
                                {
                                    for (int i = 0; i < Model.ListForexAccounts.Count; i++)
                                    {
                                        <option value="@Model.ListForexAccounts[i].ForexId">@Model.ListForexAccounts[i].Login</option>
                                    }
                                }
                            }
                        </select>
                    </fieldset>
                    <fieldset class="form-group floating-label-form-group">
                        <label for="ExpertAdvisorID">Expert Advisor: <i class="warning">*</i></label>
                        <select class="form-control" asp-for="EditTerminal.ExpertAdvisorID" id="ExpertAdvisorID" required>
                            <option value="" selected disabled>Select</option>
                            @if (Model.ListExpertAdvisors != null)
                            {
                                if (Model.ListExpertAdvisors.Count > 0)
                                {
                                    for (int i = 0; i < Model.ListExpertAdvisors.Count; i++)
                                    {
                                        <option value="@Model.ListExpertAdvisors[i].ExpertId">@Model.ListExpertAdvisors[i].Name ( @Model.ListExpertAdvisors[i].Parameters )</option>
                                    }
                                }
                            }
                        </select>
                    </fieldset>
                </div>
                <div class="modal-footer">
                    <input id="btn-edit-terminal" type="submit" class="btn btn-primary" value="Save Changes">
                    <input type="reset" class="btn btn-secondary" data-dismiss="modal" value="Close">
                </div>
            </form>
        </div>
    </div>
</div>