context->getProducer() ; $this->setTitle('Accueil'); $this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ; ?>
description)): ?>
description)); ?>

Points de vente

$dataProviderPointsSale, 'summary' => '', 'columns' => [ [ 'attribute' => 'name', 'format' => 'raw', 'contentOptions' => ['class' => 'name'], 'value' => function($model) { $html = ''.Html::encode($model->name).'' ; if(strlen($model->locality)) { $html .= '
à '.Html::encode($model->locality) ; } return $html ; } ], [ 'label' => 'Jours de livraison', 'format' => 'raw', 'contentOptions' => ['class' => 'days'], 'value' => function($model) { $producer = \Yii::$app->controller->getProducer() ; if($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) { $arrayDays = [ 'monday' => 'Lundi', 'tuesday' => 'Mardi', 'wednesday' => 'Mercredi', 'thursday' => 'Jeudi', 'friday' => 'Vendredi', 'saturday' => 'Samedi', 'sunday' => 'Dimanche' ] ; $html = '' ; foreach($arrayDays as $dayEn => $dayFr) { $fieldDelivery = 'delivery_'.$dayEn ; $fieldInfos = 'infos_'.$dayEn ; if ($model->$fieldDelivery) { $html .= ''.$dayFr.''; if(strlen($model->$fieldInfos)) { $html .= ' / '.nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)).'' ; } $html .= '
' ; } } return $html ; } elseif($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) { $html = '' ; $incomingDistributions = Distribution::getIncomingDistributions(); $cpt = 0 ; foreach($incomingDistributions as $distribution) { $countPointSaleDistribution = PointSaleDistribution::searchCount([ 'id_distribution' => $distribution->id, 'id_point_sale' => $model->id, 'delivery' => 1 ]); if($countPointSaleDistribution) { $html .= strftime('%A %d %B', strtotime($distribution->date)).'
'; } $cpt ++ ; } return $html ; } } ] ], ]); ?>

Produits

'photo', 'format' => 'raw', 'contentOptions' => ['class' => 'photo'], 'value' => function($model) { if(strlen($model->photo)) { return '' ; } return '' ; } ] ; } $columnsProducts[] = [ 'attribute' => 'name', 'format' => 'raw', 'contentOptions' => ['class' => 'name'], 'value' => function($model) { $html = ''.Html::encode($model->name).'' ; if(strlen($model->description)) { $html .= ' / '.Html::encode($model->description) ; } if(strlen($model->recipe)) { $html .= '
'.nl2br(Html::encode($model->recipe)) ; } return $html ; } ] ; if($hasProductWeight) { $columnsProducts[] = [ 'attribute' => 'weight', 'format' => 'raw', 'value' => function($model) { if(strlen($model->weight)) { return $model->weight.' g' ; } return '' ; } ] ; } $columnsProducts[] = [ 'attribute' => 'price', 'value' => function($model) { if($model->price) { return Price::format($model->getPriceWithTax()).' ('.Product::strUnit($model->unit, 'wording_unit', true).')' ; } return '' ; } ] ; ?> $dataProviderProducts, 'summary' => '', 'columns' => $columnsProducts ]); ?>