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.

main.php 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. 'options' => [
  29. 'class' => 'navbar-inverse navbar-fixed-top nav-header',
  30. ],
  31. ]);
  32. $menuItems = [
  33. ['label' => '<span class="glyphicon glyphicon-calendar"></span> Production', 'url' => ['/commande/index'], 'visible'=> !Yii::$app->user->isGuest],
  34. ['label' => '<span class="glyphicon glyphicon-grain"></span> Produits', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest],
  35. ['label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest],
  36. ['label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest],
  37. ['label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', 'url' => ['/etablissement/update'], 'visible'=> !Yii::$app->user->isGuest],
  38. //['label' => 'Statistiques', 'url' => ['/stats/index'], 'visible'=> !Yii::$app->user->isGuest],
  39. ];
  40. if (Yii::$app->user->isGuest) {
  41. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  42. } else {
  43. $menuItems[] = [
  44. 'label' => '<span class="glyphicon glyphicon-off"></span>',
  45. 'url' => ['/site/logout'],
  46. 'linkOptions' => ['data-method' => 'post']
  47. ];
  48. $menuItems[] = [
  49. 'label' => '<span class="retour-site">Retour sur le site</span>',
  50. 'url' => '../../frontend/web/',
  51. ];
  52. }
  53. echo Nav::widget([
  54. 'options' => ['class' => 'navbar-nav navbar-right'],
  55. 'items' => $menuItems,
  56. 'encodeLabels' => false
  57. ]);
  58. NavBar::end();
  59. ?>
  60. <div class="container">
  61. <?php if(!Yii::$app->user->isGuest): ?>
  62. <div class="nom-boulange">
  63. <span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
  64. </div>
  65. <?php endif; ?>
  66. <?= Breadcrumbs::widget([
  67. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  68. ]) ?>
  69. <?= $content ?>
  70. </div>
  71. </div>
  72. <footer class="footer">
  73. <div class="container">
  74. <p class="pull-left"></p>
  75. <p class="pull-right"><?= Yii::powered() ?></p>
  76. </div>
  77. </footer>
  78. <?php $this->endBody() ?>
  79. </body>
  80. </html>
  81. <?php $this->endPage() ?>