<?php

/* @var $this \yii\web\View */
/* @var $content string */

use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?php
    NavBar::begin([
        'brandLabel' => 'Cardiac Associates',
        'brandUrl' => Yii::$app->homeUrl,
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);
    $menuItems = [
        ['label' => 'Home', 'url' => ['/site/index']],
		[
            'label' => 'Home Editor',
            'items' => [
				['label' => 'Slider', 'url' => ['/home-slider/index']],
				['label' => 'Middle Content', 'url' => ['/middle-content/index']],
				['label' => 'Recent Causes', 'url' => ['/recent-causes/index']],
						],
		],
		[
            'label' => 'Services',
            'items' => [
                 ['label' => 'Left Column', 'url' => ['/services-left-column/index']],
                 '<li class="divider"></li>',
                 ['label' => 'Right Column', 'url' => ['/services-right-column/index']],
						],
		],
		['label' => 'Providers', 'url' => ['/providers/index']],
		['label' => 'Faq', 'url' => ['/faq/index']],
		['label' => 'Locations', 'url' => ['/locations/index']],
		[
            'label' => 'Affliations',
            'items' => [
                 ['label' => 'Right Column', 'url' => ['/affliations-right-column/index']],
                 '<li class="divider"></li>',
                 ],
		],
    ];
    if (Yii::$app->user->isGuest) {
        $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
    } else {
        $menuItems[] = [
            'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
            'url' => ['/site/logout'],
            'linkOptions' => ['data-method' => 'post']
        ];
    }
    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => $menuItems,
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; Cardiac Associates <?= date('Y') ?></p>

        <p class="pull-right">Web presence by <a href="http://www.appslabz.com" target="_blank"> Appslabz </a></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
