Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

historique.php 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <?=
  16. GridView::widget([
  17. 'dataProvider' => $data_provider_commandes,
  18. 'summary' => '',
  19. 'beforeRow' => function($model) {
  20. $model->init() ;
  21. },
  22. 'columns' => [
  23. [
  24. 'attribute' => 'production.date',
  25. 'label' => 'Date de livraison',
  26. 'value' => function($model) {
  27. return date('d/m/Y', strtotime($model->production->date)) ;
  28. }
  29. ],
  30. [
  31. 'label' => 'Résumé',
  32. 'format' => 'raw',
  33. 'value' => function($model) {
  34. return $model->getResumePanier();
  35. }
  36. ],
  37. [
  38. 'label' => 'Point de vente',
  39. 'format' => 'raw',
  40. 'value' => function($model) {
  41. return $model->getResumePointVente();
  42. }
  43. ],
  44. [
  45. 'label' => 'Montant',
  46. 'format' => 'raw',
  47. 'value' => function($model) {
  48. return $model->getResumeMontant();
  49. }
  50. ],
  51. [
  52. 'label' => 'Statut',
  53. 'format' => 'raw',
  54. 'value' => function($c) {
  55. if($c->getEtat() == Commande::ETAT_LIVREE) {
  56. return 'Livrée' ;
  57. }
  58. elseif($c->getEtat() == Commande::ETAT_PREPARATION) {
  59. return 'En préparation' ;
  60. }
  61. elseif($c->getEtat() == Commande::ETAT_MODIFIABLE) {
  62. return '<div class="btn-group">
  63. <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>
  64. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
  65. <span class="caret"></span>
  66. <span class="sr-only">Toggle Dropdown</span>
  67. </button>
  68. <ul class="dropdown-menu" role="menu">
  69. <li><a href="'.Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]).'"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
  70. </ul>
  71. </div>' ;
  72. }
  73. }
  74. ],
  75. ]
  76. ]);
  77. ?>