您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

105 行
6.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="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManager->createUrl('site/index') ; else: echo Yii::$app->urlManager->createUrl('commande/index') ; endif; ?>">
  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. <?php if(Yii::$app->session->hasFlash('error')): ?>
  59. <div class="alert alert-danger" role="alert">
  60. <?= Yii::$app->session->getFlash('error') ?>
  61. </div>
  62. <?php endif; ?>
  63. <?php if(Yii::$app->session->hasFlash('success')): ?>
  64. <div class="alert alert-success" role="alert">
  65. <?= Yii::$app->session->getFlash('success') ?>
  66. </div>
  67. <?php endif; ?>
  68. <?= $content ?>
  69. </section>
  70. </div>
  71. <footer id="footer">
  72. <div class="container">
  73. <a href="<?php echo Yii::$app->urlManager->createUrl('site/contact') ; ?>">Contact</a>
  74. <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a>
  75. <a href="<?php echo Yii::$app->urlManager->createUrl('site/cgv') ; ?>">CGV</a>
  76. </div>
  77. </footer>
  78. <?php $this->endBody() ?>
  79. <!-- chat -->
  80. <?php if(!Yii::$app->user->isGuest && Yii::$app->user->identity->isBoulanger()): ?>
  81. <script src="//code.tidio.co/gngxwpdobb64cpvhd8patajpurs5feom.js"></script>
  82. <?php endif; ?>
  83. <!-- analytics -->
  84. <script>
  85. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  86. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  87. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  88. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  89. ga('create', 'UA-86917043-1', 'auto');
  90. ga('send', 'pageview');
  91. </script>
  92. </body>
  93. </html>
  94. <?php $this->endPage() ?>