|
- <?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->context->getProducer() ;
-
- ?>
- <?php $this->beginPage() ?>
- <!DOCTYPE html>
- <head>
- <title><?= Html::encode($producer->nom); ?> • <?= $this->getPageTitle(); ?></title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="base-url" content="<?= Yii::$app->urlManager->baseUrl ; ?>">
- <meta name="slug-producer" content="<?= $producer->slug ; ?>">
- <?= Html::csrfMetaTags() ?>
- <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
- <?php $this->head() ?>
- </head>
- <body class="<?= Yii::$app->controller->id.'-'.Yii::$app->controller->action->id ?>">
- <?php $this->beginBody() ?>
-
- <div id="header-bap">
- <div class="container">
- <a id="logo" href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/index']); ?>">
- <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->createAbsoluteUrl(['site/signup']),
- 'visible' => Yii::$app->user->isGuest
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
- 'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/login','return_url' => Yii::$app->urlManager->createAbsoluteUrl(['site/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' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']),
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
- 'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/logout']),
- ]
- ],
- 'visible' => !Yii::$app->user->isGuest
- ],
- ],
- 'options' => ['id' =>'nav-bap'],
- ]);
- ?>
- </div>
- </div>
-
- <header id="header">
- <div class="container">
- <h1><?= Html::encode($producer->nom); ?> <span>/ <?= Html::encode($producer->type) ?> à <?= Html::encode($producer->ville); ?> (<?= Html::encode($producer->code_postal); ?>)</span></h1>
- <?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 class="info"><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl('site/creditpain'); ?>"><span class="text">Crédit </span><span class="glyphicon glyphicon-info-sign"></span></a></span>
- <span id="the-credit"><?= number_format($user_etablissement->credit, 2); ?> €</span>
- </div>
- <?php endif; ?>
- <?php endif; ?>
-
- <div id="infos">
- <span data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande">
- <span class="glyphicon glyphicon-time"></span> Commande avant
- <strong><?php echo Html::encode($producer->heure_limite_commande) ?> h</strong></span>,
- <span data-toggle="tooltip" data-placement="bottom" title="Exemple : commande le lundi pour le <?php if($producer->delai_commande == 1): ?>mardi<?php elseif($producer->delai_commande == 2): ?>mercredi<?php elseif($producer->delai_commande == 3): ?>jeudi<?php elseif($producer->delai_commande == 4): ?>vendredi<?php elseif($producer->delai_commande == 5): ?>samedi<?php elseif($producer->delai_commande == 6): ?>dimanche<?php elseif($producer->delai_commande == 7): ?>lundi d'après<?php endif; ?>"><strong><?= Html::encode($producer->delai_commande) ?> jour<?php if($producer->delai_commande > 1): ?>s<?php endif; ?></strong> à l'avance</span>
- <?php if(!Yii::$app->user->isGuest): ?>
- <span class="favorite">
- <?php if($user_etablissement && $user_etablissement->favoris): ?>
- <span class="glyphicon glyphicon-star"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/favorite','action' => 'delete']); ?>" data-toggle="tooltip" data-placement="bottom" title="Supprimer de mes favoris">Favoris</a>
- <?php else: ?>
- <span class="glyphicon glyphicon glyphicon-star-empty"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/favorite','action' => 'add']); ?>" data-toggle="tooltip" data-placement="bottom" title="Ajouter à mes favoris">Favoris</a>
- <?php endif; ?>
- </span>
- <?php endif; ?>
- <div class="clr"></div>
- </div>
- </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(['site/index']),
- 'active' => $this->getControllerAction() == 'site/index',
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
- 'url' => Yii::$app->urlManager->createUrl(['commande/create']),
- 'visible' => !Yii::$app->user->isGuest,
- 'active' => $this->getControllerAction() == 'commande/create' || $this->getControllerAction() == 'commande/update',
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
- 'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['commande/create','slug_producer' => $this->context->getProducer()->slug])]),
- 'visible' => Yii::$app->user->isGuest,
- 'active' => $this->getControllerAction() == 'commande/create' || $this->getControllerAction() == 'commande/update',
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-folder-open"></span> Historique',
- 'url' => Yii::$app->urlManager->createUrl(['commande/historique']),
- 'visible' => !Yii::$app->user->isGuest,
- 'active' => $this->getControllerAction() == 'commande/historique',
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
- 'url' => Yii::$app->urlManager->createUrl(['site/contact']),
- 'active' => $this->getControllerAction() == 'site/contact',
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-cog"></span> Administration',
- 'url' => Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index']),
- 'visible' => isset(Yii::$app->user->identity) && Yii::$app->user->identity->isBoulanger(),
- 'options' => ['id' => 'btn-administration']
- ],
- ],
- ]);
- ?>
- </nav>
-
- <?php if(strlen($this->getTitle())): ?>
- <h2 id="page-title"><?= $this->getTitle(); ?></h2>
- <?php endif; ?>
-
- <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 Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/index']) ; ?>">La boîte à pain</a>
- <a href="<?php echo Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/mentions']) ; ?>">Mentions légales</a>
- <a href="<?php echo Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/cgv']) ; ?>">CGS</a>
- </div>
- </div>
- </footer>
-
- <?php $this->endBody() ?>
- </body>
- </html>
- <?php $this->endPage() ?>
|