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.2KB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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' => 'Statistiques', 'url' => ['/stats/index'], 'visible'=> !Yii::$app->user->isGuest],
  38. ];
  39. if (Yii::$app->user->isGuest) {
  40. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  41. } else {
  42. $menuItems[] = [
  43. 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
  44. 'url' => ['/site/logout'],
  45. 'linkOptions' => ['data-method' => 'post']
  46. ];
  47. $menuItems[] = [
  48. 'label' => '<span class="retour-site">Retour sur le site</span>',
  49. 'url' => '../../frontend/web/',
  50. ];
  51. }
  52. echo Nav::widget([
  53. 'options' => ['class' => 'navbar-nav navbar-right'],
  54. 'items' => $menuItems,
  55. 'encodeLabels' => false
  56. ]);
  57. NavBar::end();
  58. ?>
  59. <div class="container">
  60. <?php if(!Yii::$app->user->isGuest): ?>
  61. <div class="nom-boulange">
  62. <span><?= Html::encode(Yii::$app->user->identity->nom_magasin) ; ?></span>
  63. </div>
  64. <?php endif; ?>
  65. <?= Breadcrumbs::widget([
  66. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  67. ]) ?>
  68. <?= $content ?>
  69. </div>
  70. </div>
  71. <footer class="footer">
  72. <div class="container">
  73. <p class="pull-left"></p>
  74. <p class="pull-right"><?= Yii::powered() ?></p>
  75. </div>
  76. </footer>
  77. <?php $this->endBody() ?>
  78. </body>
  79. </html>
  80. <?php $this->endPage() ?>