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 7.2KB

8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
8 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. use common\helpers\Url ;
  9. /* @var $this \yii\web\View */
  10. /* @var $content string */
  11. $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
  12. AppAsset::register($this);
  13. ?>
  14. <?php $this->beginPage() ?>
  15. <!DOCTYPE html>
  16. <head>
  17. <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>
  18. <meta charset="utf-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <?= Html::csrfMetaTags() ?>
  21. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
  22. <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /><![endif]-->
  23. <?php $this->head() ?>
  24. <!--[if lt IE 9]>
  25. <script src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
  26. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
  27. <![endif]-->
  28. <!--[if IE 7]>
  29. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
  30. <![endif]-->
  31. </head>
  32. <body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
  33. <?php $this->beginBody() ?>
  34. <div id="back"></div>
  35. <?php if(YII_ENV == 'demo'): ?>
  36. <div id="block-demo">
  37. <div class="container">
  38. <span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> :
  39. Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement &bull; <?= Html::a('Retour', Url::env('prod', 'frontend')) ?>
  40. </div>
  41. </div>
  42. <?php endif; ?>
  43. <header id="header">
  44. <div class="container">
  45. <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; ?>">
  46. <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
  47. <div class="text">
  48. <div class="bap">La boîte à pain</div>
  49. <div class="plateforme">Plateforme de réservation
  50. <?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?><?php if(YII_ENV == 'dev'): ?>(dév)<?php elseif(YII_ENV == 'demo'): ?>(démo)<?php endif; ?></div><?php endif; ?></div>
  51. </div>
  52. </a>
  53. <nav class="">
  54. <ul class="nav nav-pills">
  55. <?php if(!Yii::$app->user->isGuest):?>
  56. <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>
  57. <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>
  58. <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>
  59. <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>
  60. <?php if(Yii::$app->user->identity->isBoulanger()): ?><li><a class="" id="link-espace-boulanger" href="<?php echo Url::backend(); ?>"><span class="glyphicon glyphicon-grain"></span> Espace boulanger</a></li><?php endif; ?>
  61. <?php else: ?>
  62. <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>
  63. <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>
  64. <?php endif;?>
  65. </ul>
  66. </nav>
  67. </div>
  68. </header>
  69. <div id="main">
  70. <section class="<?php if(!$is_home): ?>container<?php endif;?>" id="content">
  71. <?php if(Yii::$app->session->hasFlash('error')): ?>
  72. <div class="alert alert-danger" role="alert">
  73. <?= Yii::$app->session->getFlash('error') ?>
  74. </div>
  75. <?php endif; ?>
  76. <?php if(Yii::$app->session->hasFlash('success')): ?>
  77. <div class="alert alert-success" role="alert">
  78. <?= Yii::$app->session->getFlash('success') ?>
  79. </div>
  80. <?php endif; ?>
  81. <?= $content ?>
  82. </section>
  83. </div>
  84. <footer id="footer">
  85. <div class="container">
  86. <a href="<?php echo Yii::$app->urlManager->createUrl('site/contact') ; ?>">Contact</a>
  87. <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a>
  88. <a href="<?php echo Yii::$app->urlManager->createUrl('site/cgv') ; ?>">CGS</a>
  89. </div>
  90. </footer>
  91. <?php $this->endBody() ?>
  92. <!-- analytics -->
  93. <script>
  94. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  95. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  96. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  97. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  98. ga('create', 'UA-86917043-1', 'auto');
  99. ga('send', 'pageview');
  100. </script>
  101. </body>
  102. </html>
  103. <?php $this->endPage() ?>