|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- $producer = $this->context->getProducer() ;
- $this->setPageTitle(Html::encode($producer->type.' à '.$producer->ville)) ;
- ?>
-
- <?php if(strlen($producer->description) || strlen($producer->photo)): ?>
- <?php
- if(strlen($producer->description) && strlen($producer->photo))
- $col_size = 'col-md-6' ;
- else
- $col_size = 'col-md-12' ;
- ?>
-
- <section id="commander">
- <a class="btn btn-primary btn-lg" href="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['commande/create','slug_producer' => $this->context->getProducer()->slug])]); else: echo Yii::$app->urlManager->createUrl(['commande/create']); endif; ?>"><span class="glyphicon glyphicon-plus"></span> Passer une commande</a>
- </section>
-
- <section id="presentation">
- <?php if(strlen($producer->photo)): ?>
- <div class="photo <?= $col_size ?>">
- <img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" />
- </div>
- <?php endif; ?>
- <?php if(strlen($producer->description)): ?>
- <div class="description <?= $col_size ?>">
- <?= nl2br(Html::encode($producer->description)); ?>
- </div>
- <?php endif; ?>
- <div class="clr"></div>
- </section>
- <?php endif; ?>
-
- <section id="points-vente">
- <h3><span>Points de vente</span></h3>
- <?= GridView::widget([
- 'dataProvider' => $data_provider_points_vente,
- 'summary' => '',
- 'columns' => [
- 'nom',
- 'localite',
- [
- 'label' => 'Jours de livraison',
- 'value' => function($model) {
- return $model->strJoursLivraison() ;
- }
- ]
- ],
- ]); ?>
- </section>
-
-
- <section id="produits">
- <h3><span>Produits</span></h3>
- <?= GridView::widget([
- 'dataProvider' => $data_provider_produits,
- 'summary' => '',
- 'columns' => [
- [
- 'attribute' => 'photo',
- 'format' => 'raw',
- 'headerOptions' => ['class' => 'td-photo'],
- 'value' => function($model) {
- if(strlen($model->photo)) {
- return '<img class="photo-produit" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ;
- }
- return '' ;
- }
- ],
- 'nom',
- 'description',
- [
- 'attribute' => 'poids',
- 'value' => function($model) {
- if(strlen($model->poids)) {
- return $model->poids.'g' ;
- }
- return '' ;
- }
- ],
- ],
- ]); ?>
- </section>
|