|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?php
-
- use yii\bootstrap\Nav;
- use yii\bootstrap\NavBar;
- use yii\widgets\Breadcrumbs;
- use common\widgets\Alert;
- use common\helpers\Url;
-
- \common\assets\CommonAsset::register($this);
- \producer\assets\AppAsset::register($this);
-
- $producer = $this->getProducer() ;
-
- ?>
- <?php $this->beginPage() ?>
- <!DOCTYPE html>
- <head>
- <title><?= Html::encode($producer->nom); ?> • <?= $this->getTitle(); ?></title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <?= Html::csrfMetaTags() ?>
- <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
- <?php $this->head() ?>
- </head>
- <body class="">
- <?php $this->beginBody() ?>
-
- <div id="header-bap">
- <div class="container">
- <a id="logo" href="<?= Url::frontend(); ?>">
- <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
- <span class="text">La boîte à pain</span>
- </a>
- <?php
- echo Nav::widget([
- 'encodeLabels' => false,
- 'items' => [
- [
- 'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
- 'url' => Yii::$app->urlManagerFrontend->createUrl(['site/signup']),
- 'visible' => Yii::$app->user->isGuest
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
- 'url' => Yii::$app->urlManagerFrontend->createUrl(['site/login','return_url' => Yii::$app->urlManager->createUrl(['producer/index'])]),
- 'visible' => Yii::$app->user->isGuest
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->prenom .' '.strtoupper(substr(Yii::$app->user->identity->nom, 0, 1))) : '').'. ',
- 'options' => ['id' => 'label1'],
- 'url' => '#',
- 'items' => [
- [
- 'label' => 'Profil',
- 'url' => Url::frontend('user/update'),
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
- 'url' => Url::frontend('site/logout'),
- ]
- ],
- 'visible' => !Yii::$app->user->isGuest
- ],
- ],
- 'options' => ['id' =>'nav-bap'],
- ]);
- ?>
-
-
- </div>
- </div>
-
- <header id="header">
- <div class="container">
- <h1><?= Html::encode($producer->nom); ?></h1>
- <h2>Boulangerie à <?= Html::encode($producer->ville); ?> (<?= Html::encode($producer->code_postal); ?>)</h2>
- <?php if(!Yii::$app->user->isGuest): ?>
- <?php
- $user_etablissement = UserEtablissement::findOne(['id_user' => Yii::$app->user->identity->id, 'id_etablissement' => $producer->id ]) ;
- if($user_etablissement):
- ?>
- <div id="credit"><span>Crédit :</span> <?= number_format($user_etablissement->credit, 2); ?> €</div>
- <?php endif; ?>
- <?php endif; ?>
- </div>
- </header>
-
- <div id="main">
- <div class="container">
- <nav id="main-nav">
- <?php
- echo Nav::widget([
- 'encodeLabels' => false,
- 'options' => ['class' =>'nav nav-pills'],
- 'items' => [
- [
- 'label' => '<span class="glyphicon glyphicon-th-large"></span> Accueil',
- 'url' => Yii::$app->urlManager->createUrl(['producer/index']),
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
- 'url' => Yii::$app->urlManager->createUrl(['commande/index']),
- 'visible' => !Yii::$app->user->isGuest
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-folder-open"></span> Historique',
- 'url' => Yii::$app->urlManager->createUrl(['commande/historique']),
- 'visible' => !Yii::$app->user->isGuest
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
- 'url' => Yii::$app->urlManager->createUrl(['producer/contact']),
- ],
- ],
- ]);
- ?>
- </nav>
-
- <section id="content">
- <?php if (Yii::$app->session->hasFlash('error')): ?>
- <div class="alert alert-danger" role="alert">
- <?= Yii::$app->session->getFlash('error') ?>
- </div>
- <?php endif; ?>
- <?php if (Yii::$app->session->hasFlash('success')): ?>
- <div class="alert alert-success" role="alert">
- <?= Yii::$app->session->getFlash('success') ?>
- </div>
- <?php endif; ?>
-
- <?= $content ?>
- </section>
- </div>
- </div>
-
- <footer id="footer">
- <div class="container">
- <div class="overflow"></div>
- <div class="content">
- <a href="<?php echo Url::frontend('site/index') ; ?>">La boîte à pain</a>
- <a href="<?php echo Url::frontend('site/mentions') ; ?>">Mentions légales</a>
- <a href="<?php echo Url::frontend('site/cgv') ; ?>">CGS</a>
- </div>
- </div>
- </footer>
-
- <?php $this->endBody() ?>
-
- </body>
- </html>
- <?php $this->endPage() ?>
|