|
|
|
|
|
|
|
|
/* @var $this \yii\web\View */ |
|
|
/* @var $this \yii\web\View */ |
|
|
/* @var $content string */ |
|
|
/* @var $content string */ |
|
|
|
|
|
|
|
|
$is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ; |
|
|
|
|
|
|
|
|
$isHome = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ; |
|
|
|
|
|
|
|
|
\common\assets\CommonAsset::register($this); |
|
|
\common\assets\CommonAsset::register($this); |
|
|
\frontend\assets\AppAsset::register($this); |
|
|
\frontend\assets\AppAsset::register($this); |
|
|
|
|
|
|
|
|
<?php $this->beginPage() ?> |
|
|
<?php $this->beginPage() ?> |
|
|
<!DOCTYPE html> |
|
|
<!DOCTYPE html> |
|
|
<head> |
|
|
<head> |
|
|
<title><?php if($is_home): ?>La boîte à pain • <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> • La boîte à pain<?php endif; ?></title> |
|
|
|
|
|
|
|
|
<title><?php if($isHome): ?>La boîte à pain • <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> • La boîte à pain<?php endif; ?></title> |
|
|
<meta charset="utf-8"> |
|
|
<meta charset="utf-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
|
<?= Html::csrfMetaTags() ?> |
|
|
<?= Html::csrfMetaTags() ?> |
|
|
|
|
|
|
|
|
<link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet"> |
|
|
<link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet"> |
|
|
<![endif]--> |
|
|
<![endif]--> |
|
|
</head> |
|
|
</head> |
|
|
<body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>"> |
|
|
|
|
|
|
|
|
<body class="<?php if($isHome): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>"> |
|
|
<?php $this->beginBody() ?> |
|
|
<?php $this->beginBody() ?> |
|
|
<div id="back"></div> |
|
|
<div id="back"></div> |
|
|
<?php if(YII_ENV == 'demo'): ?> |
|
|
<?php if(YII_ENV == 'demo'): ?> |
|
|
|
|
|
|
|
|
'active' => $this->getControllerAction() == 'site/signup' |
|
|
'active' => $this->getControllerAction() == 'site/signup' |
|
|
], |
|
|
], |
|
|
[ |
|
|
[ |
|
|
'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))) : '').'. ', |
|
|
|
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name .' '.strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1))) : '').'. ', |
|
|
'options' => ['id' => 'label1'], |
|
|
'options' => ['id' => 'label1'], |
|
|
'url' => '#', |
|
|
'url' => '#', |
|
|
'items' => [ |
|
|
'items' => [ |
|
|
|
|
|
|
|
|
</header> |
|
|
</header> |
|
|
|
|
|
|
|
|
<?php if(!Yii::$app->user->isGuest): ?> |
|
|
<?php if(!Yii::$app->user->isGuest): ?> |
|
|
<section id="favorite-producers"> |
|
|
|
|
|
|
|
|
<section id="bookmarked-producers"> |
|
|
<div class="container"> |
|
|
<div class="container"> |
|
|
<?php |
|
|
<?php |
|
|
$producers = Etablissement::find() |
|
|
|
|
|
->joinWith(['userEtablissement user_etablissement']) |
|
|
|
|
|
|
|
|
$producersArray = Producer::find() |
|
|
|
|
|
->joinWith(['userProducer user_producer']) |
|
|
->where([ |
|
|
->where([ |
|
|
'user_etablissement.id_user' => Yii::$app->user->id, |
|
|
|
|
|
'user_etablissement.favoris' => 1, |
|
|
|
|
|
'etablissement.actif' => 1 |
|
|
|
|
|
|
|
|
'user_producer.id_user' => User::getId(), |
|
|
|
|
|
'user_producer.bookmark' => 1, |
|
|
|
|
|
'producer.active' => 1 |
|
|
]) |
|
|
]) |
|
|
->all() ; |
|
|
->all() ; |
|
|
?> |
|
|
?> |
|
|
<?php if(count($producers)): ?> |
|
|
|
|
|
|
|
|
<?php if(count($producersArray)): ?> |
|
|
<h2>Mes producteurs</h2> |
|
|
<h2>Mes producteurs</h2> |
|
|
<?php foreach($producers as $producer): ?> |
|
|
|
|
|
<div class="col-md-<?php if(count($producers) == 1): ?>6<?php elseif(count($producers) == 2): ?>6<?php else: ?>3<?php endif; ?>"> |
|
|
|
|
|
|
|
|
<?php foreach($producersArray as $producer): ?> |
|
|
|
|
|
<div class="col-md-<?php if(count($producers) == 1): ?>6<?php elseif(count($producersArray) == 2): ?>6<?php else: ?>3<?php endif; ?>"> |
|
|
<div class="producer" style="background-image:url('<?= Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ; ?>/uploads/<?= $producer->photo ?>');"> |
|
|
<div class="producer" style="background-image:url('<?= Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ; ?>/uploads/<?= $producer->photo ?>');"> |
|
|
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]); ?>"><?= Html::encode($producer->nom); ?></a> |
|
|
|
|
|
|
|
|
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]); ?>"><?= Html::encode($producer->name); ?></a> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<?php endforeach;?> |
|
|
<?php endforeach;?> |