Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

158 lines
6.6KB

  1. <?php
  2. use yii\bootstrap\Nav;
  3. use yii\bootstrap\NavBar;
  4. use yii\widgets\Breadcrumbs;
  5. use common\widgets\Alert;
  6. use common\helpers\Url;
  7. \common\assets\CommonAsset::register($this);
  8. \producer\assets\AppAsset::register($this);
  9. $producer = $this->getProducer() ;
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <head>
  14. <title><?= Html::encode($producer->nom); ?> &bull; <?= $this->getTitle(); ?></title>
  15. <meta charset="utf-8">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <?= Html::csrfMetaTags() ?>
  18. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
  19. <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /><![endif]-->
  20. <?php $this->head() ?>
  21. <!--[if lt IE 9]>
  22. <script src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
  23. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
  24. <![endif]-->
  25. <!--[if IE 7]>
  26. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
  27. <![endif]-->
  28. </head>
  29. <body class="">
  30. <?php $this->beginBody() ?>
  31. <div id="header-bap">
  32. <div class="container">
  33. <a id="logo" href="<?= Url::frontend(); ?>">
  34. <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
  35. <span class="text">La boîte à pain</span>
  36. </a>
  37. <?php
  38. echo Nav::widget([
  39. 'encodeLabels' => false,
  40. 'items' => [
  41. [
  42. 'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
  43. 'url' => Url::frontend('site/signup'),
  44. 'visible' => Yii::$app->user->isGuest
  45. ],
  46. [
  47. 'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
  48. 'url' => Url::frontend('site/login'),
  49. 'visible' => Yii::$app->user->isGuest
  50. ],
  51. [
  52. 'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->prenom .' '.strtoupper(substr(Yii::$app->user->identity->nom, 0, 1))) : '').'. ',
  53. 'options' => ['id' => 'label1'],
  54. 'url' => '#',
  55. 'items' => [
  56. [
  57. 'label' => 'Profil',
  58. 'url' => Url::frontend('user/update'),
  59. ],
  60. [
  61. 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
  62. 'url' => Url::frontend('site/logout'),
  63. ]
  64. ],
  65. 'visible' => !Yii::$app->user->isGuest
  66. ],
  67. ],
  68. 'options' => ['id' =>'nav-bap'],
  69. ]);
  70. ?>
  71. </div>
  72. </div>
  73. <header id="header">
  74. <div class="container">
  75. <h1><?= Html::encode($producer->nom); ?></h1>
  76. <h2>Boulangerie à <?= Html::encode($producer->ville); ?> (<?= Html::encode($producer->code_postal); ?>)</h2>
  77. <?php if(!Yii::$app->user->isGuest): ?>
  78. <?php
  79. $user_etablissement = UserEtablissement::findOne(['id_user' => Yii::$app->user->identity->id, 'id_etablissement' => $producer->id ]) ;
  80. if($user_etablissement):
  81. ?>
  82. <div id="credit"><span>Crédit :</span> <?= number_format($user_etablissement->credit, 2); ?> €</div>
  83. <?php endif; ?>
  84. <?php endif; ?>
  85. </div>
  86. </header>
  87. <div id="main">
  88. <div class="container">
  89. <nav id="main-nav">
  90. <?php
  91. echo Nav::widget([
  92. 'encodeLabels' => false,
  93. 'options' => ['class' =>'nav nav-pills'],
  94. 'items' => [
  95. [
  96. 'label' => '<span class="glyphicon glyphicon-th-large"></span> Accueil',
  97. 'url' => Yii::$app->urlManager->createUrl(['producer/index']),
  98. ],
  99. [
  100. 'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
  101. 'url' => Yii::$app->urlManager->createUrl(['commande/index']),
  102. 'visible' => !Yii::$app->user->isGuest
  103. ],
  104. [
  105. 'label' => '<span class="glyphicon glyphicon-folder-open"></span> Historique',
  106. 'url' => Yii::$app->urlManager->createUrl(['commande/historique']),
  107. 'visible' => !Yii::$app->user->isGuest
  108. ],
  109. [
  110. 'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
  111. 'url' => Yii::$app->urlManager->createUrl(['producer/contact']),
  112. ],
  113. ],
  114. ]);
  115. ?>
  116. </nav>
  117. <section id="content">
  118. <?php if (Yii::$app->session->hasFlash('error')): ?>
  119. <div class="alert alert-danger" role="alert">
  120. <?= Yii::$app->session->getFlash('error') ?>
  121. </div>
  122. <?php endif; ?>
  123. <?php if (Yii::$app->session->hasFlash('success')): ?>
  124. <div class="alert alert-success" role="alert">
  125. <?= Yii::$app->session->getFlash('success') ?>
  126. </div>
  127. <?php endif; ?>
  128. <?= $content ?>
  129. </section>
  130. </div>
  131. </div>
  132. <footer id="footer">
  133. <div class="container">
  134. <div class="overflow"></div>
  135. <div class="content">
  136. </div>
  137. </div>
  138. </footer>
  139. <?php $this->endBody() ?>
  140. </body>
  141. </html>
  142. <?php $this->endPage() ?>