Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

93 lines
5.6KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\bootstrap\Nav;
  4. use yii\bootstrap\NavBar;
  5. use yii\widgets\Breadcrumbs;
  6. use frontend\assets\AppAsset;
  7. use frontend\widgets\Alert;
  8. /* @var $this \yii\web\View */
  9. /* @var $content string */
  10. $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
  11. AppAsset::register($this);
  12. ?>
  13. <?php $this->beginPage() ?>
  14. <!DOCTYPE html>
  15. <head>
  16. <title><?php if($is_home): ?>La boîte à pain &bull; <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> &bull; La boîte à pain<?php endif; ?></title>
  17. <meta charset="utf-8">
  18. <meta name="viewport" content="width=device-width, initial-scale=1">
  19. <?= Html::csrfMetaTags() ?>
  20. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
  21. <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /><![endif]-->
  22. <?php $this->head() ?>
  23. <!--[if lt IE 9]>
  24. <script src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
  25. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
  26. <![endif]-->
  27. <!--[if IE 7]>
  28. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
  29. <![endif]-->
  30. </head>
  31. <body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
  32. <?php $this->beginBody() ?>
  33. <div id="back"></div>
  34. <header id="header">
  35. <div class="container">
  36. <a id="link-home" href="<?= Yii::$app->urlManager->createUrl('site/index') ; ?>">
  37. <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
  38. <!--La boîte à pain-->
  39. </a>
  40. <nav class="">
  41. <ul class="nav nav-pills">
  42. <?php if(!Yii::$app->user->isGuest):?>
  43. <li><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'index'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/index') ; ?>"><span class="glyphicon glyphicon-th-list"></span> Tableau de bord</a></li>
  44. <li><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'create'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/create') ; ?>"><span class="glyphicon glyphicon-plus"></span> Commander</a></li>
  45. <li><a <?php if(Yii::$app->controller->id == 'user' && Yii::$app->controller->action->id == 'update'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('user/update') ; ?>"><span class="glyphicon glyphicon-user"></span> Profil</a></li>
  46. <li><a id="link-logout" href="<?php echo Yii::$app->urlManager->createUrl('site/logout') ; ?>"><span class="glyphicon glyphicon-off"></span> Déconnexion<br /><span class="nom"><?php echo Html::encode(Yii::$app->user->identity->prenom .' '. substr(strtoupper(Yii::$app->user->identity->nom), 0, 1).'.') ; ?></span></a></li>
  47. <?php if(Yii::$app->user->identity->isBoulanger()): ?><li><a class="" id="link-espace-boulanger" href="<?php if(Yii::$app->getRequest()->serverName == 'localhost'): ?>../../backend/web/<?php else: ?>http://boulanger.laboiteapain.net<?php endif; ?>"><span class="glyphicon glyphicon-grain"></span> Espace boulanger</a></li><?php endif; ?>
  48. <?php else: ?>
  49. <li><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'login'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/login') ; ?>"><span class="glyphicon glyphicon-log-in"></span> Connexion</a></li>
  50. <li><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'signup'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/signup') ; ?>"><span class="glyphicon glyphicon-user"></span> Inscription</a></li>
  51. <?php endif;?>
  52. </ul>
  53. </nav>
  54. </div>
  55. </header>
  56. <div id="main">
  57. <section class="<?php if(!$is_home): ?>container<?php endif;?>" id="content">
  58. <?= $content ?>
  59. </section>
  60. </div>
  61. <footer id="footer">
  62. <div class="container">
  63. <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a>
  64. <a href="<?php echo Yii::$app->urlManager->createUrl('site/contact') ; ?>">Contact</a>
  65. </div>
  66. </footer>
  67. <?php $this->endBody() ?>
  68. <!-- chat -->
  69. <script src="//code.tidio.co/gngxwpdobb64cpvhd8patajpurs5feom.js"></script>
  70. <!-- analytics -->
  71. <script>
  72. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  73. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  74. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  75. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  76. ga('create', 'UA-86917043-1', 'auto');
  77. ga('send', 'pageview');
  78. </script>
  79. </body>
  80. </html>
  81. <?php $this->endPage() ?>