|
- <?php
-
- use common\helpers\Price;
- use yii\grid\GridView;
-
- $userManager = $this->getUserManager();
-
- $this->setTitle('Crédit');
-
- ?>
-
- <div class="row">
- <div class="col-md-6">
- <div class="info-box">
- <span class="info-box-icon <?= $sumUserProducerCredits >= 0 ? 'bg-green' : 'bg-red' ?>"><i
- class="fa fa-euro"></i></span>
- <div class="info-box-content">
- <span class="info-box-text">Somme totale en crédit</span>
- <span class="info-box-number"><?= Price::format($sumUserProducerCredits); ?></span>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="info-box">
- <span class="info-box-icon bg-orange"><i class="fa fa-download"></i></span>
- <div class="info-box-content">
- <span class="info-box-text">Exports<br />
- <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>
- <a class="btn btn-default btn-sm" href="<?= Yii::$app->urlManager->createUrl(['credit/export-users', 'type' => 'positive']); ?>">Clients au crédit positif (CSV)</a>
- </span>
- </div>
- </div>
- </div>
- </div>
-
- <h3>Clients avec un crédit négatif</h3>
-
- <?=
-
- GridView::widget([
- 'dataProvider' => $dataProviderUsersWithNegativeCredit,
- 'summary' => '',
- 'columns' => [
- [
- 'label' => 'Client',
- 'value' => function ($user) use ($userManager) {
- return $userManager->getUsernameFromArray($user, true);
- }
- ],
- [
- 'label' => 'Email',
- 'format' => 'raw',
- 'headerOptions' => ['class' => 'column-hide-on-mobile'],
- 'filterOptions' => ['class' => 'column-hide-on-mobile'],
- 'contentOptions' => ['class' => 'column-hide-on-mobile'],
- 'value' => function ($user) {
- return $user['email'];
- }
- ],
- [
- 'label' => 'Téléphone',
- 'format' => 'raw',
- 'headerOptions' => ['class' => 'column-hide-on-mobile'],
- 'filterOptions' => ['class' => 'column-hide-on-mobile'],
- 'contentOptions' => ['class' => 'column-hide-on-mobile'],
- 'value' => function ($user) {
- return $user['phone'];
- }
- ],
- [
- 'label' => 'Crédit',
- 'format' => 'raw',
- 'value' => function ($user) {
- return Price::format($user['credit']);
- }
- ]
- ]
- ]);
- ?>
|