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.

94 lines
3.8KB

  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. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" />
  18. <?= Html::csrfMetaTags() ?>
  19. <title><?= Html::encode($this->title) ?> - Réservation de pain</title>
  20. <?php $this->head() ?>
  21. </head>
  22. <body>
  23. <?php $this->beginBody() ?>
  24. <div class="wrap">
  25. <?php
  26. NavBar::begin([
  27. 'brandLabel' => '<img class="logo" src="'.Yii::$app->urlManager->getBaseUrl().'/img/laboulange2.png" />',
  28. 'brandUrl' => Yii::$app->homeUrl,
  29. 'innerContainerOptions' => ['class'=>'container-fluid'],
  30. 'options' => [
  31. 'class' => 'navbar-inverse navbar-fixed-top nav-header',
  32. ],
  33. ]);
  34. $menuItems = [
  35. ['label' => '<span class="glyphicon glyphicon-calendar"></span> Production', 'url' => ['/commande/index'], 'visible'=> !Yii::$app->user->isGuest],
  36. ['label' => '<span class="glyphicon glyphicon-grain"></span> Produits', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest],
  37. ['label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest],
  38. ['label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest],
  39. ['label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', 'url' => ['/etablissement/update'], 'visible'=> !Yii::$app->user->isGuest],
  40. //['label' => 'Statistiques', 'url' => ['/stats/index'], 'visible'=> !Yii::$app->user->isGuest],
  41. ];
  42. if (Yii::$app->user->isGuest) {
  43. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  44. } else {
  45. $menuItems[] = [
  46. 'label' => '<span class="glyphicon glyphicon-off"></span>',
  47. 'url' => ['/site/logout'],
  48. 'linkOptions' => ['data-method' => 'post']
  49. ];
  50. $menuItems[] = [
  51. 'label' => '<span class="retour-site">Retour sur le site</span>',
  52. 'url' => '../../frontend/web/',
  53. ];
  54. }
  55. echo Nav::widget([
  56. 'options' => ['class' => 'navbar-nav navbar-right'],
  57. 'items' => $menuItems,
  58. 'encodeLabels' => false
  59. ]);
  60. NavBar::end();
  61. ?>
  62. <div class="container-fluid container-body">
  63. <?php if(!Yii::$app->user->isGuest): ?>
  64. <div class="nom-boulange">
  65. <span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
  66. </div>
  67. <?php endif; ?>
  68. <?= Breadcrumbs::widget([
  69. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  70. ]) ?>
  71. <?= $content ?>
  72. </div>
  73. </div>
  74. <footer class="footer">
  75. <div class="container">
  76. <p class="pull-left"></p>
  77. <p class="pull-right"><?= Yii::powered() ?></p>
  78. </div>
  79. </footer>
  80. <?php $this->endBody() ?>
  81. <!-- chat -->
  82. <script src="//code.tidio.co/gngxwpdobb64cpvhd8patajpurs5feom.js"></script>
  83. </body>
  84. </html>
  85. <?php $this->endPage() ?>