|
- <?php
-
- use yii\bootstrap\ActiveForm;
-
- $this->setTitle('Historique de mes commandes') ;
-
- ?>
-
- <div id="index-commande">
-
- <?php if($commande_ok): ?>
- <div class="alert alert-success">
- <div class="icon"></div>
- Votre commande a bien été prise en compte.
- </div>
- <?php endif; ?>
-
- <?php if($annule_ok): ?>
- <div class="alert alert-success"><div class="icon"></div>Votre commande a bien été annulée.</div>
- <?php endif; ?>
-
- <?=
-
- GridView::widget([
- 'dataProvider' => $data_provider_commandes,
- 'summary' => '',
- 'beforeRow' => function($model) {
- $model->init() ;
- },
- 'columns' => [
- [
- 'attribute' => 'production.date',
- 'label' => 'Date de livraison',
- 'value' => function($model) {
- return date('d/m/Y', strtotime($model->production->date)) ;
- }
- ],
- [
- 'label' => 'Résumé',
- 'format' => 'raw',
- 'value' => function($model) {
- return $model->getResumePanier();
- }
- ],
- [
- 'label' => 'Point de vente',
- 'format' => 'raw',
- 'value' => function($model) {
- return $model->getResumePointVente();
- }
- ],
- [
- 'label' => 'Montant',
- 'format' => 'raw',
- 'value' => function($model) {
- return $model->getResumeMontant();
- }
- ],
- [
- 'label' => 'Statut',
- 'format' => 'raw',
- 'value' => function($c) {
- if($c->getEtat() == Commande::ETAT_LIVREE) {
- return 'Livrée' ;
- }
- elseif($c->getEtat() == Commande::ETAT_PREPARATION) {
- return 'En préparation' ;
- }
- elseif($c->getEtat() == Commande::ETAT_MODIFIABLE) {
- return '<div class="btn-group">
- <a href="'.Yii::$app->urlManager->createUrl(['commande/update','id'=>$c->id, 'id_etablissement'=>$c->production->etablissement->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Modifier</a>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
- <span class="caret"></span>
- <span class="sr-only">Toggle Dropdown</span>
- </button>
- <ul class="dropdown-menu" role="menu">
- <li><a href="'.Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]).'"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
- </ul>
- </div>' ;
- }
- }
- ],
- ]
- ]);
-
- ?>
|