{if $currentPageName == 'Home'}
    {if $modulecustombuttonresult}
        {if $modulecustombuttonresult == "success"}
            {include file="$template/includes/alert.tpl" type="success" msg=$LANG.moduleactionsuccess textcenter=true idname="alertModuleCustomButtonSuccess"}
        {else}
            {include file="$template/includes/alert.tpl" type="error" msg=$LANG.moduleactionfailed|cat:' ':$modulecustombuttonresult textcenter=true idname="alertModuleCustomButtonFailed"}
        {/if}
    {/if}
    {if $pendingcancellation}
        {include file="$template/includes/alert.tpl" type="error" msg=$LANG.cancellationrequestedexplanation textcenter=true idname="alertPendingCancellation"}
    {/if}
    {if $unpaidInvoice}
        <div class="alert alert-{if $unpaidInvoiceOverdue}danger{else}warning{/if}" id="alert{if $unpaidInvoiceOverdue}Overdue{else}Unpaid{/if}Invoice">
            <div class="pull-right">
                <a href="viewinvoice.php?id={$unpaidInvoice}" class="btn btn-xs btn-default">
                    {lang key='payInvoice'}
                </a>
            </div>
            {$unpaidInvoiceMessage}
        </div>
    {/if}
    <div class="tab-content margin-bottom">
        <div class="tab-pane fade show active" id="tabOverview">
            {if $tplOverviewTabOutput}
                {$tplOverviewTabOutput}
            {else}
            <div class="section">
                <div class="product-details">
                    <div class="row row-eq-height row-eq-height-sm">
                        <div class="col-md-6">
                            <div class="product-holder product-status-{$rawstatus|strtolower}" style="min-height: unset; height: 210px;">
                                <div class="product-content">
                                    <div class="product-image">
                                        <div class="feature-icon">
                                            <img src="/templates/croster/thurdata/logoVDC-color.svg" class="img-fluid" style="height:100px;">
                                        </div>
                                    </div>
                                    <h4>{$product}</h4>
                                    <div class="status-sticker-wrapper">
                                        <div class="status-sticker product-status-{$rawstatus|strtolower}">
                                            {$status}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="product-info" style="min-height: unset; height: 210px;">
                                <ul class="list-info list-v">
                                    <li>
                                        <span class="list-heading">{$LANG.clientareahostingregdate}</span>
                                        <span class="list-text">{$regdate}</span>
                                    </li>
                                    {if $billingcycle != 'Gratis-Account'}
                                        {if $firstpaymentamount neq $recurringamount}
                                            <li>
                                                <span class="list-heading">{$LANG.firstpaymentamount}</span>
                                                <span class="list-text">{$firstpaymentamount}</span>
                                            </li>
                                        {/if}
                                        {if $billingcycle != $LANG.orderpaymenttermonetime && $billingcycle != $LANG.orderfree}
                                            <li>
                                                <span class="list-heading">{$LANG.recurringamount}</span>
                                                <span class="list-text">{$recurringamount}</span>
                                            </li>
                                        {/if}
                                        <li>
                                                <span class="list-heading">{$LANG.orderbillingcycle}</span>
                                                <span class="list-text">{$billingcycle}</span>
                                        </li>
                                        {if $nextduedate == '-'}{else}
                                            <li>
                                                <span class="list-heading">{$LANG.clientareahostingnextduedate}</span>
                                                <span class="list-text">{$nextduedate}</span>
                                            </li>
                                        {/if}
                                        <li>
                                            <span class="list-heading">{$LANG.orderpaymentmethod}</span>
                                            <span class="list-text">{$paymentmethod}</span>
                                        </li>
                                    {else}
                                        <li>
                                        <span class="list-heading">Trial Account</span>
                                            {if ($smarty.now - ($regdate|@strtotime)) > 950400}
                                                <span class="list-text" style="color:orange;">Endet in {(14 - (($smarty.now - ($regdate|@strtotime)) / 86400)|round)} Tagen</span>
                                            {elseif ($smarty.now - ($regdate|@strtotime)) > 1123200}
                                                <span class="list-text" style="color:red;">Letzter Tag der Trial Periode</span>
                                            {else}
                                                <span class="list-text">Endet in {(14 - (($smarty.now - ($regdate|@strtotime)) / 86400)|round)} Tagen</span>
                                            {/if}                                                
                                        </li>
                                        <li>
                                            <a href="/upgrade.php?type=package&id={$id}" class="btn btn-block btn-primary">Jetzt upgraden</a>
                                        </li>
                                    {/if}
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {*
                {if $showcancelbutton || $packagesupgrade}
                    <div class="row">
                        {if $packagesupgrade}
                            <div class="col-xs-{if $showcancelbutton}6{else}12{/if}">
                                <a href="upgrade.php?type=package&amp;id={$id}" class="btn btn-block btn-primary">{$LANG.upgrade}</a>
                            </div>
                        {/if}
                        {if $showcancelbutton}
                            <div class="col-xs-{if $packagesupgrade}6{else}12{/if}">
                                <a href="clientarea.php?action=cancel&amp;id={$id}" class="btn btn-block btn-danger {if $pendingcancellation}disabled{/if}">{if $pendingcancellation}{$LANG.cancellationrequested}{else}{$LANG.clientareacancelrequestbutton}{/if}</a>
                            </div>
                        {/if}
                    </div>
                {/if}
            *}
            {if $systemStatus == 'Active'}
                {foreach $hookOutput as $output}
                    <div class="section">
                        <div>
                            {$output}
                        </div>
                        <div class=" clearfix"></div>
                    </div>
                {/foreach}
                {if $domain || $moduleclientarea || $configurableoptions || $customfields || $lastupdate}
                    <div class="section">
                        <div class="card panel panel-tabs">
                            <div class="card-header">
                                <ul class="nav nav-pills card-header-pills flex-column flex-md-row">
                                    {if $domain}
                                        <li class="nav-item">
                                            <a href="#domain" data-toggle="tab" class="nav-link active"><i class="fas fa-globe fa-fw"></i> {lang key='manage'}</a>
                                        </li>
                                    {elseif $content}
                                        <li class="nav-item">
                                            <a href="#manage" data-toggle="tab" class="nav-link active"><i class="fas fa-globe fa-fw"></i> {lang key='manage'}</a>
                                        </li>
                                    {/if}
                                    {if $moduleParams['configoptions']}
                                        <li class="nav-item">
                                            <a href="#configoptions" data-toggle="tab" class="nav-link{if !$domain && !$content} active{/if}"><i class="fas fa-cubes fa-fw"></i>Details</a>
                                        </li>
                                    {/if}
                                    {if $metricStats}
                                        <li class="nav-item">
                                            <a href="#metrics" data-toggle="tab" class="nav-link{if !$domain && !$content && !$configurableoptions} active{/if}"><i class="fas fa-chart-line fa-fw"></i> {lang key='metrics.title'}</a>
                                        </li>
                                    {/if}
                                    {if $customfields}
                                        <li class="nav-item">
                                            <a href="#additionalinfo" data-toggle="tab" class="nav-link{if !$domain && !$content && !$metricStats && !$configurableoptions} active{/if}"><i class="fas fa-info fa-fw"></i>Zugangsdaten</a>
                                        </li>
                                    {/if}
                                    {if $lastupdate}
                                	<!--
                                        <li class="nav-item">
                                            <a href="#resourceusage" data-toggle="tab" class="nav-link{if !$domain && !$content && !$configurableoptions && !$customfields} active{/if}"><i class="fas fa-inbox fa-fw"></i> {lang key='resourceUsage'}</a>
                                        </li>
                                        -->
                                    {/if}
                                </ul>
                            </div>
                            <div class="card-body">
                                <div class="tab-content">
                                    {if $moduleParams['configoptions']}
                                        <div class="tab-pane fade{if !$domain && !$content} show active{/if}" role="tabpanel" id="configoptions">
                                        <table width="100%" cellspacing="0" cellpadding="0" class="frame">
                                            <tr>
                                            <td>
                                                <table width="100%" border="0" cellpadding="10" cellspacing="0" class="table table-striped table-framed">
                                                <tr>
                                                    <td align='left'>CPU Cores</td>
                                                    <td align="left">{$moduleParams['configoptions']['vcpus']}</td>
                                                </tr>
                                                <tr>
                                                    <td align='left'>Hauptspeicher</td>
                                                    <td align="left">{$moduleParams['configoptions']['Memory Limit']} GB</td>
                                                </tr>
                                                <tr>
                                                    <td align='left'>Festplattenspeicher</td>
                                                    <td align="left">{$moduleParams['configoptions']['Storage Limit']} GB</td>
                                                </tr>
                                                <tr>
                                                    <td align='left'>IPv4 Adressen</td>
                                                    <td align="left">{$moduleParams['configoptions']['IP Addresses Limit']}</a></td>
                                                </tr>
                                                <tr>
                                                    <td align='left'>Backup Speicher</td>
                                                    <td align="left">{$moduleParams['configoptions']['Backups Size Limit']} GB</a></td>
                                                </tr>
                                                </table>
                                            </td>
                                            </tr>
                                        </table>
                                        {if $configoptionsupgrade}
                                            <div class="col-xs-{if $showcancelbutton}6{else}12{/if}">
                                                <a href="upgrade.php?type=configoptions&amp;id={$id}" class="btn btn-block btn-primary">Ressourcen erweitern</a>
                                            </div>
                                        {/if}
                                    </div>
                                    {/if}
                                    {if $metricStats}
                                        <div class="tab-pane fade{if !$domain && !$content && !$moduleParams['configoptions']} show active{/if}" role="tabpanel" id="metrics">
                                            <p>{lang key='metrics.explanation'}</p>
                                            <table class="table table-striped mb-1 table-solid-bottom-border-light-gray">
                                                <tr>
                                                    <th>{lang key='metrics.metric'}</th>
                                                    <th>{lang key='metrics.currentUsage'}</th>
                                                    <th>{lang key='metrics.pricing'}</th>
                                                    <th>{lang key='metrics.lastUpdated'}</th>
                                                </tr>
                                                {foreach $metricStats as $metric}
                                                    <tr>
                                                        <td>{$metric.displayName}</td>
                                                        <td>{$metric.currentValue|round:1}</td>
                                                        <td>
                                                            {if count($metric.pricing) > 1}
                                                                {lang key='metrics.startingFrom'} {$metric.lowestPrice} / {if $metric.unitName}{$metric.unitName}{else}{lang key='metrics.unit'}{/if}
                                                                <br>
                                                                <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#modalMetricPricing-{$metric.systemName}">
                                                                    {lang key='metrics.viewPricing'}
                                                                </button>
                                                            {elseif count($metric.pricing) == 1}
                                                                {$metric.lowestPrice} / {if $metric.unitName}{$metric.unitName}{else}{lang key='metrics.unit'}{/if}
                                                                {if $metric.includedQuantity > 0} ({$metric.includedQuantity|round:1} {lang key='metrics.includedNotCounted'}){/if}
                                                            {else}
                                                                &mdash;
                                                            {/if}
                                                            {include file="$template/usagebillingpricing.tpl"}
                                                        </td>
                                                        <td>{if is_string($metric.lastUpdated)}{$metric.lastUpdated}{else}{$metric.lastUpdated->diffForHumans()}{/if}</td>
                                                    </tr>
                                                {/foreach}
                                            </table>
                                        </div>
                                    {/if}
                                    {if $domain}
                                        <div class="tab-pane fade show active" role="tabpanel" id="domain">
                                            <table width="100%" cellspacing="0" cellpadding="0" class="frame">
                                                <tr>
                                                    <td align='left'>Maildomain</td>
                                                    <td align="left">{$domain}</td>
                                                </tr>
                                                <tr>
                                                    <td colspan=2 align='left'><hr></td>
                                                </tr>
                                                <tr>
                                                    <td colspan=2 align='center'>
                                                        <div class="mg-wrapper body" data-target=".body" data-spy="scroll" data-twttr-rendered="true">
                                                            <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
                                                            <link rel="stylesheet" href="{$assetsURL}/css/layers-ui.css">
                                                            <link rel="stylesheet" href="{$assetsURL}/css/mg_styles.css">
                                                            {if $isCustomModuleCss}
                                                                <link rel="stylesheet" href="{$customAssetsURL}/css/module_styles.css">
                                                            {/if}
                                                            <div class="full-screen-module-container" id="layers">
                                                                <div class="lu-app">
                                                                    {$content}
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    {elseif $content}
                                        <div class="tab-pane fade show active" role="tabpanel" id="manage">
                                            <div class="mg-wrapper body" data-target=".body" data-spy="scroll" data-twttr-rendered="true">
                                                <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
                                                <link rel="stylesheet" href="{$assetsURL}/css/layers-ui.css">
                                                <link rel="stylesheet" href="{$assetsURL}/css/mg_styles.css">
                                                {if $isCustomModuleCss}
                                                    <link rel="stylesheet" href="{$customAssetsURL}/css/module_styles.css">
                                                {/if}
                                                <div class="full-screen-module-container" id="layers">
                                                    <div class="lu-app">
                                                        {$content}
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    {/if}
                                    {if $customfields}
                                        <div class="tab-pane fade{if !$domain && !$content && !$moduleParams['configoptions'] && !$metricStats} show active{/if}" role="tabpanel" id="additionalinfo">
                                        </div>
                                    {/if}
                                    {if $lastupdate}
                                        <div class="tab-pane fade" role="tabpanel" id="resourceusage" align="center">
                                            <table width="100%" cellspacing="0" cellpadding="0" class="frame">
                                                <tr>
                                                    <td align="center">
                                                        <div class="col-sm-10">
                                                                <h4>WAN-Traffic %</h4>
                                                                <input type="text" value="{$bwpercent|substr:0:-1}" class="dial-usage" data-width="100" data-height="100" data-min="0" data-readOnly="true" />
                                                                <p>{$bwusage} / {$bwlimit}</p>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                        <p class="text-muted">{lang key='clientarealastupdated'}: {$lastupdate}</p>
                                                    </td>
                                                    <td align="center">
                                                        <div class="col-sm-10">
                                                                <h4>{lang key='diskSpace'} %</h4>
                                                                <input type="text" value="{$diskpercent|substr:0:-1}" class="dial-usage" data-width="100" data-height="100" data-min="0" data-readOnly="true" />
                                                                <p>{($diskusage / 1024)|round:1} GB / {($disklimit / 1024)|round:1} GB</p>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                        <p class="text-muted">{lang key='clientarealastupdated'}: {$lastupdate}</p>
                                                    </td>
                                                </tr>
                                            </table>
                                            <script src="{$BASE_PATH_JS}/jquery.knob.js"></script>
                                            <script>
                                                jQuery(function() {
                                                    jQuery(".dial-usage").knob({
                                                        'format': function(v) {
                                                            alert(v);
                                                        }
                                                    });
                                                });
                                            </script>
                                        </div>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                {/if}
            {else}
                <div class="alert-lg no-data">
                    <div class="icon">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <div class="text">
                        {if $suspendreason}
                            <strong>{$suspendreason}</strong><br />
                        {/if}
                        {$LANG.cPanel.packageNotActive} {$status}.<br />
                        {if $systemStatus eq "Pending"}
                            {$LANG.cPanel.statusPendingNotice}
                        {elseif $systemStatus eq "Suspended"}
                            {$LANG.cPanel.statusSuspendedNotice}
                        {/if}
                    </div>
                </div>
            {/if}
        {/if}
    </div>
</div>
{else}
<div class="mg-wrapper body" data-target=".body" data-spy="scroll" data-twttr-rendered="true">

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
    <link rel="stylesheet" href="{$assetsURL}/css/layers-ui.css">
    <link rel="stylesheet" href="{$assetsURL}/css/mg_styles.css">
    {if $isCustomModuleCss}
        <link rel="stylesheet" href="{$customAssetsURL}/css/module_styles.css">
    {/if}

    <div class="full-screen-module-container" id="layers">
        <div class="lu-app">
            {$content}
        </div>
    </div>
</div>
{/if}
{if $isDebug}
    <script type="text/javascript" src="https://unpkg.com/vue"></script>
    <script type="text/javascript" src="https://unpkg.com/vuex"></script>
{else}
    <script type="text/javascript" src="{$assetsURL}/js/vue.min.js"></script>
    <script type="text/javascript" src="{$assetsURL}/js/vuex.min.js"></script>
{/if}
<script type="text/javascript" src="{$assetsURL}/js/mgComponents.js"></script>
<script type="text/javascript" src="{$assetsURL}/js/jscolor.min.js"></script>
<script type="text/javascript" src="{$assetsURL}/js/layers-ui.js"></script>
<script type="text/javascript" src="{$assetsURL}/js/chart.min.js"></script>

<div class="clear"></div>
