@{
    ViewData["Title"] = "Report";
}
@model EForT.Models.ViewModel
@if (string.IsNullOrEmpty(Model.publisherModel.LoggedUsername))
{
    Layout = "~/Views/Shared/_HomeLayout.cshtml";
}
else
{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<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">Report</h1>
            <div class="row breadcrumbs-top">
                <div class="breadcrumb-wrapper col-12">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            @if (string.IsNullOrEmpty(Model.publisherModel.LoggedUsername))
                            {
                                <a href="@Url.Action("Index", "Home")">Home</a>
                            }
                            else
                            {
                                <a href="@Url.Action("Trader", "Home")">Home</a>
                            }
                        </li>
                        <li class="breadcrumb-item active">
                            Report
                        </li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <div class="content-wrapper">
        <div class="content-body">
            <div class="card text-center">
                <div class="card-header bottom-border">
                    <h4 class="card-title">Performance Report For @Model.publisherModel.EditPublisher.UserName Forex Account @Model.forexAccountModel.ForexAccountList[0].ForexId</h4>
                </div>
                <div class="card-body text-center">

                                
                    <iframe srcdoc="@Model.publisherModel.EditPublisher.Report" style="width: 85%; height: 800px;" name="myFrame"></iframe>
                    <br/>

                    <br class="top-border" />
                    @if (string.IsNullOrEmpty(Model.publisherModel.LoggedUsername))
                    {
                        <a href="@Url.Action("OpenAccount", "Login")" style="font-size: 20px">New user? Sign up here.</a>
                    }
                    else
                    {
                        @if (Model.publisherModel.EditSubscriber != null && (Convert.ToInt32(Model.publisherModel.EditSubscriber.PublisherId) == Model.publisherModel.EditPublisher.Id))
                        {
                            <button class="btn btn-danger btn-lg" style="font-size: 16px; width: 30%;" onclick="location.href='@Url.Action("Unsubscribe", "Report", new { publisherId = Model.publisherModel.EditPublisher.Id })'">Unsubscribe From Publisher</button>

                        }
                        else
                        {
                            <button class="btn btn-primary btn-lg" style="font-size: 16px; width: 30%;" data-toggle="modal" data-target="#ChooseForexModal">Subscribe To Publisher</button>

                        }
                    }

                </div>
            </div>
        </div>
    </div>
</div>
<div id="choose-forex-account">
    <partial name="_ChooseForexAccount" model="Model.publisherModel"/>
</div>
