Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

historique.php 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. use yii\bootstrap\ActiveForm;
  3. $this->setTitle('Historique de mes commandes') ;
  4. ?>
  5. <div id="index-commande">
  6. <?php if($commande_ok): ?>
  7. <div class="alert alert-success">
  8. <div class="icon"></div>
  9. Votre commande a bien été prise en compte.
  10. </div>
  11. <?php endif; ?>
  12. <?php if($annule_ok): ?>
  13. <div class="alert alert-success"><div class="icon"></div>Votre commande a bien été annulée.</div>
  14. <?php endif; ?>
  15. <h2 class="first">Historique</h2>
  16. <?=
  17. GridView::widget([
  18. 'dataProvider' => $data_provider_commandes,
  19. 'summary' => '',
  20. 'beforeRow' => function($model) {
  21. $model->init() ;
  22. },
  23. 'columns' => [
  24. [
  25. 'attribute' => 'production.date',
  26. 'label' => 'Date de livraison',
  27. 'value' => function($model) {
  28. return date('d/m/Y', strtotime($model->production->date)) ;
  29. }
  30. ],
  31. [
  32. 'label' => 'Résumé',
  33. 'format' => 'raw',
  34. 'value' => function($model) {
  35. return $model->getResumePanier();
  36. }
  37. ],
  38. [
  39. 'label' => 'Point de vente',
  40. 'format' => 'raw',
  41. 'value' => function($model) {
  42. return $model->getResumePointVente();
  43. }
  44. ],
  45. [
  46. 'label' => 'Montant',
  47. 'format' => 'raw',
  48. 'value' => function($model) {
  49. return $model->getResumeMontant();
  50. }
  51. ],
  52. [
  53. 'label' => 'Statut',
  54. 'format' => 'raw',
  55. 'value' => function($c) {
  56. if($c->getEtat() == Commande::ETAT_LIVREE) {
  57. return 'Livrée' ;
  58. }
  59. elseif($c->getEtat() == Commande::ETAT_PREPARATION) {
  60. return 'En préparation' ;
  61. }
  62. elseif($c->getEtat() == Commande::ETAT_MODIFIABLE) {
  63. return '<div class="btn-group">
  64. <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>
  65. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
  66. <span class="caret"></span>
  67. <span class="sr-only">Toggle Dropdown</span>
  68. </button>
  69. <ul class="dropdown-menu" role="menu">
  70. <li><a href="'.Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]).'"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
  71. </ul>
  72. </div>' ;
  73. }
  74. }
  75. ],
  76. ]
  77. ]);
  78. ?>