1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-03-09 15:39:59 +00:00
yii2-nomer/modules/admin/views/settings/_blocked_phones.php
2020-02-05 06:34:26 +03:00

31 lines
1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* @var $this \yii\web\View */
/* @var $phones array */
$count = array_reduce($phones, function($acc, $data) {
return [
'all' => $acc['all'] += $data['all'],
'unconfirmed' => $acc['unconfirmed'] += $data['confirmed'],
'confirmed' => $acc['confirmed'] += $data['confirmed'],
'vip' => $acc['vip'] += $data['vip']
];
}, ['all' => 0, 'unconfirmed' => 0, 'confirmed' => 0, 'vip' => 0]);
?>
<h3>Всего заблокировано <?= $count['all'] ?> номеров. Подтверждено: <?= $count['confirmed'] ?>. VIP <?= $count['vip'] ?></h3>
<table class="table table-striped table-bordered">
<tr>
<th>Дата</th>
<th>Количество заблокированных мномеров</th>
</tr>
<?php foreach ($phones as $date => $data): ?>
<tr>
<td><?= $date ?></td>
<td>Всего: <?= $data['all'] ?>, подтверждено: <?= $data['confirmed'] ?>, VIP: <?= $data['vip'] ?>.</td>
</tr>
<?php endforeach; ?>
</table>