Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

127 lines
5.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. use common\models\Etablissement ;
  8. /* @var $this \yii\web\View */
  9. /* @var $content string */
  10. AppAsset::register($this);
  11. ?>
  12. <?php $this->beginPage() ?>
  13. <!DOCTYPE html>
  14. <html lang="<?= Yii::$app->language ?>">
  15. <head>
  16. <meta charset="<?= Yii::$app->charset ?>">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon3.png" />
  19. <?= Html::csrfMetaTags() ?>
  20. <title><?= Html::encode($this->title) ?> - La boîte à pain</title>
  21. <?php $this->head() ?>
  22. </head>
  23. <body>
  24. <?php $this->beginBody() ?>
  25. <div class="wrap">
  26. <?php
  27. NavBar::begin([
  28. 'brandLabel' => '<img class="logo" src="'.Yii::$app->urlManager->getBaseUrl().'/img/laboulange3.png" />',
  29. 'brandUrl' => Yii::$app->homeUrl,
  30. 'innerContainerOptions' => ['class'=>'container-fluid'],
  31. 'options' => [
  32. 'class' => 'navbar-inverse navbar-fixed-top nav-header',
  33. ],
  34. ]);
  35. $menuItems = [
  36. ['label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', 'url' => ['/commande/index'], 'visible'=> !Yii::$app->user->isGuest],
  37. ['label' => '<span class="glyphicon glyphicon-grain"></span> Produits', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest],
  38. ['label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest],
  39. ['label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest],
  40. ['label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', 'url' => ['/etablissement/update'], 'visible'=> !Yii::$app->user->isGuest],
  41. ['label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer', 'url' => ['/communiquer/index'], 'visible'=> !Yii::$app->user->isGuest],
  42. ];
  43. if (Yii::$app->user->isGuest) {
  44. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  45. } else {
  46. $menuItems[] = [
  47. 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
  48. 'url' => ['/site/logout'],
  49. 'linkOptions' => ['data-method' => 'post']
  50. ];
  51. if(Yii::$app->getRequest()->serverName == 'localhost')
  52. $url = '../../frontend/web/' ;
  53. else
  54. $url = 'http://www.laboiteapain.net/' ;
  55. $menuItems[] = [
  56. 'label' => '<span class="retour-site">Retour sur le site</span>',
  57. 'url' => $url,
  58. ];
  59. }
  60. echo Nav::widget([
  61. 'options' => ['class' => 'navbar-nav navbar-right'],
  62. 'items' => $menuItems,
  63. 'encodeLabels' => false
  64. ]);
  65. NavBar::end();
  66. ?>
  67. <div class="container-fluid container-body">
  68. <?php if(!Yii::$app->user->isGuest): ?>
  69. <div class="nom-boulange">
  70. <span><?= Html::encode(Yii::$app->user->identity->getNomMagasin()) ; ?></span>
  71. <?php $etat_paiement_etablissement = Yii::$app->user->identity->etatPaiementEtablissement(); ?>
  72. <?php if($etat_paiement_etablissement == 'essai'): ?>
  73. <span id="etat-paiement-etablissement">Période d'essai gratuite
  74. <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>
  75. </span>
  76. <?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE || $etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>
  77. <span id="etat-paiement-etablissement">
  78. <span class="strong">
  79. <?php if($etat_paiement_etablissement == Etablissement::PAIEMENT_ESSAI_TERMINE): ?>Période d'essai gratuite terminée
  80. <?php elseif($etat_paiement_etablissement == Etablissement::PAIEMENT_RETARD): ?>Retard de paiement
  81. <?php endif; ?>
  82. </span>
  83. </span>
  84. <?php endif; ?>
  85. </div>
  86. <?php endif; ?>
  87. <?= Breadcrumbs::widget([
  88. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  89. ]) ?>
  90. <?= $content ?>
  91. </div>
  92. </div>
  93. <div id="alerts-fixed"></div>
  94. <footer class="footer">
  95. <div class="container">
  96. <p class="pull-left"></p>
  97. <p class="pull-right"><?= Yii::powered() ?></p>
  98. </div>
  99. </footer>
  100. <?php $this->endBody() ?>
  101. <!-- chat -->
  102. <script src="//code.tidio.co/gngxwpdobb64cpvhd8patajpurs5feom.js"></script>
  103. <!-- analytics -->
  104. <script>
  105. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  106. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  107. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  108. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  109. ga('create', 'UA-86917043-1', 'auto');
  110. ga('send', 'pageview');
  111. </script>
  112. </body>
  113. </html>
  114. <?php $this->endPage() ?>