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.

1 年之前
1 年之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. use common\helpers\Price;
  3. use yii\grid\GridView;
  4. $userModule = $this->getUserModule();
  5. $this->setTitle('Crédit');
  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 crédit</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 au crédit négatif (CSV)</a>
  24. <a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['credit/export-users', 'type' => 'positive']); ?>">Clients au crédit positif (CSV)</a>
  25. </span>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <h3>Clients avec un crédit 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' => 'Crédit',
  64. 'format' => 'raw',
  65. 'value' => function ($user) {
  66. return Price::format($user['credit']);
  67. }
  68. ]
  69. ]
  70. ]);
  71. ?>