You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.6KB

  1. <?php
  2. use common\helpers\Price;
  3. use yii\grid\GridView;
  4. $userModule = $this->getUserModule();
  5. $this->setTitle('Cagnotte');
  6. ?>
  7. <div class="row">
  8. <div class="col-md-6">
  9. <div class="info-box">
  10. <span class="info-box-icon <?= $sumUserProducerCredits >= 0 ? 'bg-green' : 'bg-red' ?>"><i
  11. class="fa fa-euro"></i></span>
  12. <div class="info-box-content">
  13. <span class="info-box-text">Somme totale en cagnotte</span>
  14. <span class="info-box-number"><?= Price::format($sumUserProducerCredits); ?></span>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="col-md-6">
  19. <div class="info-box">
  20. <span class="info-box-icon bg-orange"><i class="fa fa-download"></i></span>
  21. <div class="info-box-content">
  22. <span class="info-box-text">Exports<br />
  23. <a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['credit/export-users', 'type' => 'negative']); ?>">Clients en négatif (CSV)</a>
  24. <a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['credit/export-users', 'type' => 'positive']); ?>">Clients en positif (CSV)</a>
  25. </span>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <h3>Clients avec une cagnotte en négatif</h3>
  31. <?=
  32. GridView::widget([
  33. 'dataProvider' => $dataProviderUsersWithNegativeCredit,
  34. 'summary' => '',
  35. 'columns' => [
  36. [
  37. 'label' => 'Client',
  38. 'value' => function ($user) use ($userModule) {
  39. return $userModule->getUsernameFromArray($user, true);
  40. }
  41. ],
  42. [
  43. 'label' => 'Email',
  44. 'format' => 'raw',
  45. 'headerOptions' => ['class' => 'column-hide-on-mobile'],
  46. 'filterOptions' => ['class' => 'column-hide-on-mobile'],
  47. 'contentOptions' => ['class' => 'column-hide-on-mobile'],
  48. 'value' => function ($user) {
  49. return $user['email'];
  50. }
  51. ],
  52. [
  53. 'label' => 'Téléphone',
  54. 'format' => 'raw',
  55. 'headerOptions' => ['class' => 'column-hide-on-mobile'],
  56. 'filterOptions' => ['class' => 'column-hide-on-mobile'],
  57. 'contentOptions' => ['class' => 'column-hide-on-mobile'],
  58. 'value' => function ($user) {
  59. return $user['phone'];
  60. }
  61. ],
  62. [
  63. 'label' => 'Cagnotte',
  64. 'format' => 'raw',
  65. 'value' => function ($user) {
  66. return Price::format($user['credit']);
  67. }
  68. ]
  69. ]
  70. ]);
  71. ?>