You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.5KB

  1. <?php
  2. use backend\assets\AppAsset;
  3. use yii\helpers\Html;
  4. use yii\bootstrap\Nav;
  5. use yii\bootstrap\NavBar;
  6. use yii\widgets\Breadcrumbs;
  7. /* @var $this \yii\web\View */
  8. /* @var $content string */
  9. AppAsset::register($this);
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <html lang="<?= Yii::$app->language ?>">
  14. <head>
  15. <meta charset="<?= Yii::$app->charset ?>">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <?= Html::csrfMetaTags() ?>
  18. <title><?= Html::encode($this->title) ?> - Réservation de pain</title>
  19. <?php $this->head() ?>
  20. </head>
  21. <body>
  22. <?php $this->beginBody() ?>
  23. <div class="wrap">
  24. <?php
  25. NavBar::begin([
  26. 'brandLabel' => '<span class="glyphicon glyphicon-home"></span>',
  27. 'brandUrl' => Yii::$app->homeUrl,
  28. 'innerContainerOptions' => ['class'=>'container-fluid'],
  29. 'options' => [
  30. 'class' => 'navbar-inverse navbar-fixed-top nav-header',
  31. ],
  32. ]);
  33. $menuItems = [
  34. ['label' => '<span class="glyphicon glyphicon-calendar"></span> Production', 'url' => ['/commande/index'], 'visible'=> !Yii::$app->user->isGuest],
  35. ['label' => '<span class="glyphicon glyphicon-grain"></span> Produits', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest],
  36. ['label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest],
  37. ['label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest],
  38. ['label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', 'url' => ['/etablissement/update'], 'visible'=> !Yii::$app->user->isGuest],
  39. //['label' => 'Statistiques', 'url' => ['/stats/index'], 'visible'=> !Yii::$app->user->isGuest],
  40. ];
  41. if (Yii::$app->user->isGuest) {
  42. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  43. } else {
  44. $menuItems[] = [
  45. 'label' => '<span class="glyphicon glyphicon-off"></span>',
  46. 'url' => ['/site/logout'],
  47. 'linkOptions' => ['data-method' => 'post']
  48. ];
  49. $menuItems[] = [
  50. 'label' => '<span class="retour-site">Retour sur le site</span>',
  51. 'url' => '../../frontend/web/',
  52. ];
  53. }
  54. echo Nav::widget([
  55. 'options' => ['class' => 'navbar-nav navbar-right'],
  56. 'items' => $menuItems,
  57. 'encodeLabels' => false
  58. ]);
  59. NavBar::end();
  60. ?>
  61. <div class="container-fluid container-body">
  62. <?php if(!Yii::$app->user->isGuest): ?>
  63. <div class="nom-boulange">
  64. <span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
  65. </div>
  66. <?php endif; ?>
  67. <?= Breadcrumbs::widget([
  68. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  69. ]) ?>
  70. <?= $content ?>
  71. </div>
  72. </div>
  73. <footer class="footer">
  74. <div class="container">
  75. <p class="pull-left"></p>
  76. <p class="pull-right"><?= Yii::powered() ?></p>
  77. </div>
  78. </footer>
  79. <?php $this->endBody() ?>
  80. </body>
  81. </html>
  82. <?php $this->endPage() ?>