getUserManager();
$orderManager = $this->getOrderManager();
$this->setTitle('Commandes ' . Html::encode($userManager->getUsername($user)) . '', 'Commandes de ' . Html::encode($userManager->getUsername($user)));
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]);
$this->addBreadcrumb(['label' => Html::encode($user->lastname . ' ' . $user->name)]);
$this->addBreadcrumb('Commandes');
?>
= GridView::widget([
'filterModel' => $searchModel,
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'distribution.date',
'label' => 'Date de livraison',
'value' => function ($user) {
return date('d/m/Y',strtotime($user->distribution->date));
}
],
[
'label' => 'Historique',
'format' => 'raw',
'value' => function ($order) use ($orderManager) {
return $orderManager->getHistorySummary($order);
}
],
[
'label' => 'Résumé',
'format' => 'raw',
'value' => function ($order) use ($orderManager) {
return $orderManager->getCartSummary($order);
}
],
[
'label' => 'Point de vente',
'format' => 'raw',
'value' => function ($order) use ($orderManager) {
return $orderManager->getPointSaleSummary($order);
}
],
[
'label' => 'Montant',
'format' => 'raw',
'value' => function ($order) use ($orderManager) {
$orderManager->initOrder($order);
return $orderManager->getAmountSummary($order);
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update}',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
'update' => function ($url, $model) {
$url = Yii::$app->urlManager->createUrl(['distribution/index', 'idOrderUpdate' => $model->id]);
return Html::a('', $url, [
'title' => 'Modifier', 'class' => 'btn btn-default'
]);
},
],
]
],
]); ?>