<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="csrf-token" content="<?= csrf_token() ?>">
        <?= seo($seo ?? []) ?>

        <title><?= config('site.title') ?></title>

        <link rel="icon" href="<?= asset_to('/favicon.ico') ?>" />
        <link href="<?= asset_to('/css/font-awesome.min.css') ?>" rel="stylesheet" />
        <link href="<?= resource_to('/css/morpheus.min.css') ?>" rel="stylesheet" />
        <link href="<?= asset_to('/css/style.min.css') ?>" rel="stylesheet" />

        <?= fetch('css') ?>

        <script type="text/javascript" src="<?= resource_to('/js/jquery.min.js') ?>"></script>
        <script type="text/javascript" src="<?= resource_to('/js/morpheus.min.js') ?>"></script>
        <script type="text/javascript" src="<?= asset_to('/js/default.js') ?>"></script>

        <script>
            $(function () {
                $.morpheus.base_path = '<?= url_to('/') ?>';
                $.morpheus.logo = '<?= util('Server')->logo() ?>';
                $.morpheus.server_name = '<?= config('server.name') ?>';
            });
        </script>

        <?= fetch('script') ?>
    </head>

    <body>
        <div class="wrap">
            <?php if (plugin_active('Countdown')): ?>
                <?php notify('countdowns') ?>
            <?php endif ?>

            <div class="language">
                <?php foreach ($languages as $key => $value): ?>
                    <a class="<?= $key === $locale ? 'active' : '' ?>" href="<?= url_to('/lang/' . $key) ?>"><img src="<?= asset_to('/images/flags/' . $key . '.png') ?>" height="15" /></a>
                <?php endforeach ?>
            </div>

            <div class="header">
                <?php
                    $max = array_sum(util('Hash')->extract(config('servers', []), '{s}.max'));
                    $total = count(server()->getCharactersOnline());
                ?>
                <div class="onlines">
                    <div class="progress-bar">
                        <div class="line" style="width:<?= util('Number')->percent($total, $max) ?>%"></div>
                    </div>
                    <img src="<?= asset_to('/images/online-background.png') ?>" />
                    <?php if (config('players-online.show_type', 'all') !== 'none'): ?>
                        <div class="status">
                            <?php if (config('players-online.show_type', 'all') === 'all'): ?>
                                <a data-ajax href="<?= url_to('/players-online') ?>"><?= $total ?></a>
                            <?php else: ?>
                                <?= $total ?>
                            <?php endif ?>
                        </div>
                    <?php endif ?>
                </div>

                <div class="logotipo">
                    <img src="<?= util('Server')->logo() ?>" width="350" />
                </div>
            </div>
            <div class="main">
                <div class="top"></div>
                <div class="sidebar left">
                    <div class="container">
                        <p class="title"><?= __('Menu') ?></p>
                        <div class="box">
                            <ul>
                                <li><a data-ajax href="<?= url_to('/') ?>"><?= __('Home') ?></a></li>
                                <li><a data-ajax href="<?= url_to('/register') ?>"><?= __('Register') ?></a></li>
                                <li><a data-ajax href="<?= url_to('/downloads') ?>"><?= __('Downloads') ?></a></li>
								<li><a data-ajax href="<?= url_to('/rankings') ?>"><?= __('Rankings') ?></a></li>
                                <li><a data-ajax href="<?= url_to('/info') ?>"><?= __('Game Information') ?></a></li>
                                <?php if (plugin_active('Video')): ?>
                                    <li><a data-ajax href="<?= url_to('/videos') ?>"><?= __('Videos') ?></a></li>
                                <?php endif ?>
                                <?php if (plugin_active('Packages') || plugin_active('AlternativePackages')): ?>
                                    <li><a data-ajax href="<?= url_to('/vip') ?>"><?= __('Buy Vip') ?></a></li>
                                    <li><a data-ajax href="<?= url_to('/packages') ?>"><?= __('Buy Coins') ?></a></li>
                                <?php endif ?>
                                <?php if (plugin_active('WebShop')): ?>
                                    <li><a data-ajax href="<?= url_to('/shops') ?>"><?= __('WebShop') ?></a></li>
                                <?php endif ?>
                                <?php if (plugin_active('Market')): ?>
                                    <li><a data-ajax href="<?= url_to('/market') ?>"><?= __('Market') ?></a></li>
                                <?php endif ?>
                                <?php if (plugin_active('Tracker')): ?>
                                    <li><a data-ajax href="<?= url_to('/trackers') ?>"><?= __('Trackers') ?></a></li>
                                <?php endif ?>
                                <?php if (plugin_active('Guides')): ?>
                                    <li><a data-ajax href="<?= url_to('/guides') ?>"><?= __('Guides') ?></a></li>
                                <?php endif ?>
                            </ul>
                        </div>
                        <div class="box-bottom"></div>

                        <?php notify('poll.last-active-poll') ?>

                        <?php notify('events.spotlight') ?>
                    </div>
                    <div class="sidebar-bottom"></div>
                </div>
                <div class="content">
                    <div class="container">
                        <div class="c">
                            <div class="ajax-container">
                                <?= $content ?>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                    <div class="content-middle"></div>
                </div>
                <div class="sidebar right">
                    <div class="container">
                        <div class="partial-login">
                            <?= partial('login') ?>
                        </div>
                        <div class="box-bottom"></div>
                        <div class="space"></div>
                        <p class="title"><?= __('Information') ?></p>
                        <div class="box">
                            <ul>
                                <li><?= __('Version') ?> <span class="text"><?= config('server.version_name') ?></span></li>
                                <li><?= __('Experience') ?> <span class="text"><?= config('server.experience') ?></span></li>
                                <li><?= __('Drop') ?> <span class="text"><?= config('server.drop') ?></span></li>
                                <li><?= __('Total of accounts') ?> <span class="text"><?= util('Number')->format(account()->count()) ?></span></li>
                                <li><?= __('Total of characters') ?> <span class="text"><?= util('Number')->format(character()->count()) ?></span></li>
                                <li><?= __('Total of guilds') ?> <span class="text"><?= util('Number')->format(guild()->count()) ?></span></li>
                            </ul>
                        </div>
                        <div class="box-bottom"></div>
                        <div class="space"></div>
                        <p class="title"><?= __('Team') ?></p>
                        <div class="box">
                            <ul>
                                <?php foreach (server()->getMembersTeam() as $char): ?>
                                    <li><?= $char['name'] ?> <?= util('Character')->status($char['status']) ?></span></li>
                                <?php endforeach ?>
                            </ul>
                        </div>
                        <div class="box-bottom"></div>
                    </div>
                    <div class="sidebar-bottom"></div>
                </div>
            </div>

            <div class="footer">
				<p><a href="http://morpheusmuweb.com" target="_blank">morpheusmuweb.com</a> v.<?= MORPHEUS_VERSION ?><br />© Copyright <?= date('Y') ?> | Morpheus MuWeb All rights reserved.</p>
            </div>
        </div>

        <?php notify('streamers.online') ?>
    </body>
</html>