Browse Source

Lien section développement

master
keun 7 years ago
parent
commit
1929e72a37
1 changed files with 157 additions and 142 deletions
  1. +157
    -142
      backend/views/layouts/main.php

+ 157
- 142
backend/views/layouts/main.php View File

<?php <?php

use backend\assets\AppAsset; use backend\assets\AppAsset;
use yii\helpers\Html; use yii\helpers\Html;
use yii\bootstrap\Nav; use yii\bootstrap\Nav;
use yii\bootstrap\NavBar; use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs; use yii\widgets\Breadcrumbs;
use common\models\Etablissement ;
use common\models\User ;
use common\models\Etablissement;
use common\models\User;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper ;
use common\helpers\Url ;
use yii\helpers\ArrayHelper;
use common\helpers\Url;


/* @var $this \yii\web\View */ /* @var $this \yii\web\View */
/* @var $content string */ /* @var $content string */
<?php $this->beginPage() ?> <?php $this->beginPage() ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>"> <html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" />
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?> - La boîte à pain</title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<div class="wrap">
<?php
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" />
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?> - La boîte à pain</title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<div class="wrap">
<?php
NavBar::begin([ NavBar::begin([
'brandLabel' => '<img class="logo" src="'.Yii::$app->urlManager->getBaseUrl().'/img/laboulange3.png" />',
'brandLabel' => '<img class="logo" src="' . Yii::$app->urlManager->getBaseUrl() . '/img/laboulange3.png" />',
'brandUrl' => Yii::$app->homeUrl, 'brandUrl' => Yii::$app->homeUrl,
'innerContainerOptions' => ['class'=>'container-fluid'],
'innerContainerOptions' => ['class' => 'container-fluid'],
'options' => [ 'options' => [
'class' => 'navbar-inverse navbar-fixed-top nav-header', 'class' => 'navbar-inverse navbar-fixed-top nav-header',
], ],
]); ]);
$menuItems = [ $menuItems = [
[ [
'label' => '<span class="glyphicon glyphicon-home"></span> Tableau de bord',
'url' => ['/site/index'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-home"></span> Tableau de bord',
'url' => ['/site/index'],
'visible' => !Yii::$app->user->isGuest
], ],
[
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes',
'url' => ['/commande/index'],
'visible'=> !Yii::$app->user->isGuest,
[
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes',
'url' => ['/commande/index'],
'visible' => !Yii::$app->user->isGuest,
'items' => [ 'items' => [
[ [
'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes', 'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes',
] ]
], ],
[ [
'label' => '<span class="glyphicon glyphicon-grain"></span> Produits',
'url' => ['/produit/index'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-grain"></span> Produits',
'url' => ['/produit/index'],
'visible' => !Yii::$app->user->isGuest
], ],
[ [
'label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente',
'url' => ['/point-vente/index'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente',
'url' => ['/point-vente/index'],
'visible' => !Yii::$app->user->isGuest
], ],
[ [
'label' => '<span class="glyphicon glyphicon-user"></span> Clients',
'url' => ['/user/index'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-user"></span> Clients',
'url' => ['/user/index'],
'visible' => !Yii::$app->user->isGuest
], ],
[ [
'label' => '<span class="glyphicon glyphicon-plus"></span>', 'label' => '<span class="glyphicon glyphicon-plus"></span>',
'url' => ['/etablissement/update'],
'visible'=> !Yii::$app->user->isGuest,
'url' => ['/etablissement/update'],
'visible' => !Yii::$app->user->isGuest,
'items' => [ 'items' => [
[ [
'label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres',
'url' => ['/etablissement/update'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres',
'url' => ['/etablissement/update'],
'visible' => !Yii::$app->user->isGuest
], ],
[ [
'label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer',
'url' => ['/communiquer/index'],
'visible'=> !Yii::$app->user->isGuest
'label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer',
'url' => ['/communiquer/index'],
'visible' => !Yii::$app->user->isGuest
], ],
[ [
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', 'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation',
'url' => ['/etablissement/facturation'], 'url' => ['/etablissement/facturation'],
'visible'=> !Yii::$app->user->isGuest,
'visible' => !Yii::$app->user->isGuest,
], ],
[ [
'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques', 'label' => '<span class="glyphicon glyphicon-stats"></span> Statistiques',
'url' => ['/stats/index'], 'url' => ['/stats/index'],
'visible'=> !Yii::$app->user->isGuest,
]
'visible' => !Yii::$app->user->isGuest,
],
[
'label' => '<span class="glyphicon glyphicon-wrench"></span> Développement',
'url' => ['/developpement/index'],
'visible' => !Yii::$app->user->isGuest
],
], ],
] ]
]; ];
if (Yii::$app->user->isGuest) { if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
} else { } else {
if(Yii::$app->user->identity->status == USER::STATUS_ADMIN)
{

if (Yii::$app->user->identity->status == USER::STATUS_ADMIN) {
$menuItems[] = [ $menuItems[] = [
'label' => '<span class="glyphicon glyphicon-asterisk"></span>',
'label' => '<span class="glyphicon glyphicon-asterisk"></span>',
'url' => '#', 'url' => '#',
'items' => [ 'items' => [
[ [
'label' => '<span class="glyphicon glyphicon-th-list"></span> Producteurs', 'label' => '<span class="glyphicon glyphicon-th-list"></span> Producteurs',
'url' => ['etablissement-admin/index'], 'url' => ['etablissement-admin/index'],
'visible'=> !Yii::$app->user->isGuest,
'visible' => !Yii::$app->user->isGuest,
], ],
[ [
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', 'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation',
'url' => ['etablissement-admin/facturation'], 'url' => ['etablissement-admin/facturation'],
'visible'=> !Yii::$app->user->isGuest,
'visible' => !Yii::$app->user->isGuest,
], ],
] ]
] ;
];
} }
$menuItems[] = [ $menuItems[] = [
'label' => '<span class="glyphicon glyphicon-off"></span>', 'label' => '<span class="glyphicon glyphicon-off"></span>',
'url' => ['/site/logout'], 'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post','title' => 'Déconnexion']
'linkOptions' => ['data-method' => 'post', 'title' => 'Déconnexion']
]; ];
$menuItems[] = [ $menuItems[] = [
'label' => '<span class="retour-site">Retour sur le site</span>', 'label' => '<span class="retour-site">Retour sur le site</span>',
'url' => Url::frontend(), 'url' => Url::frontend(),
'encodeLabels' => false 'encodeLabels' => false
]); ]);
NavBar::end(); NavBar::end();
?>

<div class="container-fluid container-body">
<?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?>
<div id="env-dev"><?php if(YII_ENV == 'dev'): ?>Dév.<?php elseif(YII_ENV == 'demo'): ?>Démo<?php endif; ?></div>
<?php endif; ?>
<?php if(!Yii::$app->user->isGuest): ?>
<div class="nom-boulange">
<?php if(Yii::$app->user->identity->status == User::STATUS_BOULANGER): ?>
<span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
<?php elseif(Yii::$app->user->identity->status == User::STATUS_ADMIN): ?>
<?php $form = ActiveForm::begin(['id' => 'select-etablissement']) ; ?>
<?= Html::dropDownList('select_etablissement', Yii::$app->user->identity->id_etablissement, ArrayHelper::map(Etablissement::find()->orderBy('nom ASC')->all(), 'id', function($model, $defaultValue) {
return $model->nom ;
})) ; ?>
<?php ActiveForm::end(); ?>
<?php endif; ?>
<?php
$etablissement = Etablissement::findOne(Yii::$app->user->identity->id_etablissement) ;
if(!$etablissement->actif):
?>
<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Activez votre établissement quand vous le souhaitez afin de la rendre visible à vos clients.">
<?= Html::a('Hors-ligne',['etablissement/update']); ?>
</span>
?>

<div class="container-fluid container-body">
<?php if (YII_ENV == 'dev' || YII_ENV == 'demo'): ?>
<div id="env-dev"><?php if (YII_ENV == 'dev'): ?>Dév.<?php elseif (YII_ENV == 'demo'): ?>Démo<?php endif; ?></div>
<?php endif; ?>
<?php if (!Yii::$app->user->isGuest): ?>
<div class="nom-boulange">
<?php if (Yii::$app->user->identity->status == User::STATUS_BOULANGER): ?>
<span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()); ?></span>
<?php elseif (Yii::$app->user->identity->status == User::STATUS_ADMIN): ?>
<?php $form = ActiveForm::begin(['id' => 'select-etablissement']); ?>
<?=
Html::dropDownList('select_etablissement', Yii::$app->user->identity->id_etablissement, ArrayHelper::map(Etablissement::find()->orderBy('nom ASC')->all(), 'id', function($model, $defaultValue) {
return $model->nom;
}));
?>
<?php ActiveForm::end(); ?>
<?php endif; ?>

<?php
$etablissement = Etablissement::findOne(Yii::$app->user->identity->id_etablissement);
if (!$etablissement->actif):
?>
<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Activez votre établissement quand vous le souhaitez afin de la rendre visible à vos clients.">
<?= Html::a('Hors-ligne', ['etablissement/update']); ?>
</span>
<?php endif; ?>

<div class="clr"></div>

<?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
<?php if ($etat_paiement_etablissement == 'essai'): ?>
<span id="etat-paiement-etablissement">Période d'essai gratuite
<span class="strong"><?php echo Yii::$app->user->identity->periodeEssai(); ?> jours</span> <a class="btn btn-success" href="<?php echo Yii::$app->urlManager->createUrl(['paiement/index']) ?>">S'abonner</a>
</span>
<?php elseif ($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE || $etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>
<span id="etat-paiement-etablissement">
<span class="strong">
<?php if ($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE): ?>Période d'essai gratuite terminée
<?php elseif ($etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>Retard de paiement
<?php endif; ?>
</span>
</span>
<?php endif; ?>
</div>
<?php endif; ?> <?php endif; ?>
<div class="clr"></div>
<?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
<?php if($etat_paiement_etablissement == 'essai'): ?>
<span id="etat-paiement-etablissement">Période d'essai gratuite
<span class="strong"><?php echo Yii::$app->user->identity->periodeEssai(); ?> jours</span> <a class="btn btn-success" href="<?php echo Yii::$app->urlManager->createUrl(['paiement/index']) ?>">S'abonner</a>
</span>
<?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE || $etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>
<span id="etat-paiement-etablissement">
<span class="strong">
<?php if($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE): ?>Période d'essai gratuite terminée
<?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>Retard de paiement
<?php endif; ?>
</span>
</span>

<?php if (YII_ENV == 'demo'): ?>
<div id="block-demo">
<div class="container-fluid">
<span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> :
Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement &bull; <?= Html::a('Retour', Url::env('prod', 'frontend')) ?>
</div>
</div>
<?php endif; ?> <?php endif; ?>

<?=
Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
])
?>
<?= $content ?>
</div> </div>
<?php endif; ?>
<?php if(YII_ENV == 'demo'): ?>
<div id="block-demo">
<div class="container-fluid">
<span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> :
Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement &bull; <?= Html::a('Retour', Url::env('prod', 'frontend')) ?>
</div>
</div>
<?php endif; ?>
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= $content ?>
</div> </div>
</div>

<div id="alerts-fixed"></div>
<footer class="footer">
<div class="container-fluid">
<p class="pull-left">
<a href="<?php echo Url::frontend('site/contact') ; ?>">Contact</a> &bull;
<a href="<?php echo Url::frontend('site/mentions') ; ?>">Mentions légales</a> &bull;
<a href="<?php echo Url::frontend('site/cgv') ; ?>">CGS</a>
</p>
<p class="pull-right"><?= Yii::powered() ?></p>
</div>
</footer>

<?php $this->endBody() ?>
<!-- analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-86917043-1', 'auto');
ga('send', 'pageview');
</script>
</body>

<div id="alerts-fixed"></div>

<footer class="footer">
<div class="container-fluid">
<p class="pull-left">
<a href="<?php echo Url::frontend('site/contact'); ?>">Contact</a> &bull;
<a href="<?php echo Url::frontend('site/mentions'); ?>">Mentions légales</a> &bull;
<a href="<?php echo Url::frontend('site/cgv'); ?>">CGS</a>
</p>
<p class="pull-right"><?= Yii::powered() ?></p>
</div>
</footer>

<?php $this->endBody() ?>

<!-- analytics -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

ga('create', 'UA-86917043-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html> </html>
<?php $this->endPage() ?> <?php $this->endPage() ?>

Loading…
Cancel
Save