選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

88 行
2.7KB

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