- <?php
-
-
-
- use yii\grid\GridView;
- use yii\helpers\Html;
-
- $userManager = $this->getUserManager();
- $orderManager = $this->getOrderManager();
-
- $this->setTitle('Commandes <small>' . Html::encode($userManager->getUsername($user)) . '</small>', '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');
-
- ?>
-
- <div class="user-orders">
- <?= 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('<span class="glyphicon glyphicon-pencil"></span>', $url, [
- 'title' => 'Modifier', 'class' => 'btn btn-default'
- ]);
- },
- ],
- ]
- ],
- ]); ?>
- </div>
|