<?php /* @var $this Controller */ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="language" content="en">

        <!-- blueprint CSS framework -->

        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap.min.css" media="screen, projection">
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" media="screen, projection">

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>

    <body>
        <?php if (Yii::app()->user->hasFlash('exp')): ?>
            <?php echo Yii::app()->user->getFlash('exp'); ?>
        <?php endif; ?>

        <?php if (Yii::app()->user->hasFlash('level')): ?>
            <?php echo Yii::app()->user->getFlash('level'); ?>
        <?php endif; ?>

        <div class="logo"><?= CHtml::link('<img src="/images/logo.png " alt="">', array('main/index')) ?></a></div>

        <?php if (!Yii::app()->user->isGuest): ?>
            <?php $strips = new Helper ?>
            <?php Users::regeneration() ?>
            <div id="strips" style="width:100%; height: 18px; background: #999999">
                <div id="strips" style="width:<?= $strips->stripsExp ?>%;background: #333333; ">
                    <font color="white"><?= $strips->stripsExp ?>%</font>
                </div>
            </div>
        <div id="strips" style="width:100%; height: 18px; background: #ccccff">
                <div id="strips" style="width:<?= $strips->stripsEnergy ?>%;background: #000066; ">
                    <img src="/images/energy.png" alt="energy">
                </div>  
            </div>
        <?php endif ?>

        <?php if (!Yii::app()->user->isGuest): ?>
            <div class="head">
                <?php echo CHtml::link('Меню', array('main/index'), array('class' => 'v')); ?>
                <?php echo CHtml::link('Герой', array('hero/index'), array('class' => 'r')); ?>
                <div style="clear:both"></div></div>
            <div class="telo">
            <?php endif ?>

            <?php if (Yii::app()->user->hasFlash('success')): ?>
                <p class="text-success">
                    <?php echo Yii::app()->user->getFlash('success'); ?>
                </p>
            <?php endif; ?>

            <?php if (Yii::app()->user->hasFlash('error')): ?>
                <p class="text-danger">
                    <?php echo Yii::app()->user->getFlash('error'); ?>
                </p>
            <?php endif; ?>


            <?php echo $content; ?>

        </div>
        <div class="niz">
            <?php
            if (!Yii::app()->user->isGuest) {
                echo CHtml::link('Чат', array('/chat/index'));
                echo ' ';
                echo CHtml::link('Новости', array('/news/index'));
                echo ' ';
                echo CHtml::link('<b>Выход</b>', array('/site/logout'));
                echo ' ';
                if (Yii::app()->user->role == 'administrator')
                    echo CHtml::link('<b>Админка</b>', array('/admin/index'));
            } else
                echo 'Вы не вошли';
            ?>
        </div>
    <center><div class="gen"><?= sprintf('%0.5f', Yii::getLogger()->getExecutionTime()) ?> с.</div></center>
</body>
</html>
