@model EzeScanWebApps.Models.LicenseDataModel
@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    ViewBag.Title = "License";
}

<h1 class="page-header">License</h1>

<p><strong>Server Hostname:</strong> @(LicenseLibrary.Models.LicenseModel.GetHostname())</p>

<p><strong>License Status:</strong> @(Model.Result.IsValid ? "License Valid" : "License Invalid")</p>

<p><strong>License Expiry Date:</strong> @Model.License.ExpiryDate.ToString("D")</p>

<p><strong>License Type:</strong> @(Model.License.LicenseType)</p>

@if (Model.License.LicensedModules.Count > 0)
{
    <p>
        <strong>Licensed Modules:</strong>
        <ul>
            @foreach (LicenseLibrary.Module module in Model.License.LicensedModules)
            {
                <li>
                    @module.Name (@module.Instances)
                    <span class="label @(module.Enabled ? "label-success" : "label-default")">@(module.Enabled ? "Enabled" : "Disabled")</span>

                </li>

            }
        </ul>

    </p>
}

<p>@Model.Result.ErrorMessage</p>

<p>@Model.Result.LicenseStatusMessage</p>

<div class="panel panel-default">
    <div class="panel-heading">License Upload</div>
    <div class="panel-body">

        @using (Html.BeginForm("License", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <div class="form-group">
                <label for="FileUpload">Select .xml license file to upload.</label>
                <input type="file" name="file" id="FileUpload">
                <p class="help-block">Choose the servername_domain_com.xml file that was sent to you by EzeScan Support.</p>
            </div>
            <button type="submit" class="btn btn-primary">Submit</button>
        }

    </div>
</div>
