| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?php
- use dosamigos\chartjs\ChartJs;
- use yii\helpers\Html;
- use \yii\widgets\ActiveForm;
- use \kartik\date\DatePicker;
- ?>
- <div class="auctions-index">
- <div class="panel panel-primary">
- <div class="panel-heading"><span class="glyphicon glyphicon-th-large"></span><strong> <?= Html::encode($this->title) ?></strong></div>
- <div class="panel-body">
- <p>
- <?=Yii::t('app', 'Total count - {count}', ['count' => $total])?>
- </p>
- <?php $form = ActiveForm::begin([
- 'method' => 'get',
- ]); ?>
- <div class="row">
- <div class="col-xs-6">
- <?= $form->field($searchModel, 'month')->widget(DatePicker::className(),[
- 'removeButton' => false,
- 'pluginOptions' => [
- 'autoclose'=>true,
- 'format' => 'yyyy.mm',
- 'viewMode' => 'months',
- 'minViewMode' => "months",
- 'locale' => [ 'format' => 'yyyy.mm', 'dateFormat' => 'yy-mm-dd', ]
- ],
- ])->label(false); ?>
- </div>
- <div class="col-xs-6">
- <div class="form-group">
- <?= Html::submitButton(Yii::t('app', 'Confirm'), ['class' => 'btn btn-primary'])?>
- </div>
- </div>
- </div>
- <?php ActiveForm::end(); ?>
- <div class="row">
- <div class="col-xs-12">
- <h2><?= Yii::t('app', 'Registered users per month'); ?></h2>
- <?= ChartJs::widget([
- 'type' => 'line',
- 'options' => [
- 'height' => 70,
- ],
- 'clientOptions' => [
- 'scales' => [
- 'yAxes' => [[
- 'ticks' => [
- 'stepSize' => 1
- ]
- ]]
- ]
- ],
- 'data' => [
- 'labels' => fillCount(countDayInMonth($searchModel)),
- 'datasets' => [
- [
- 'label' => Yii::t('app', 'Selected month'),
- 'backgroundColor' => "rgba(179,181,198,0.2)",
- 'borderColor' => "rgba(179,181,198,1)",
- 'pointBackgroundColor' => "rgba(179,181,198,1)",
- 'pointBorderColor' => "#fff",
- 'pointHoverBackgroundColor' => "#fff",
- 'pointHoverBorderColor' => "rgba(179,181,198,1)",
- 'data' => $users
- ],
- ]
- ]
- ]); ?>
- <hr>
- </div>
- <div class="col-xs-12">
- <h2><?= Yii::t('app', 'Auctions by status per month'); ?></h2>
- <?= ChartJs::widget([
- 'type' => 'line',
- 'options' => [
- 'height' => 70,
- ],
- 'clientOptions' => [
- 'scales' => [
- 'yAxes' => [[
- 'ticks' => [
- 'stepSize' => 1
- ]
- ]]
- ]
- ],
- 'data' => [
- 'labels' => fillCount(countDayInMonth($searchModel)),
- 'datasets' => $auctions
- ]
- ]); ?>
- <hr>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <hr>
- </div>
- <div class="col-md-6">
- <h2><?= Yii::t('app', 'Auctions by category'); ?></h2>
- <?= ChartJs::widget([
- 'type' => 'pie',
- 'options' => [
- 'height' => 90,
- ],
- 'clientOptions' => [
- 'legend' => [
- 'position' => 'left'
- ]
- ],
- 'data' => [
- 'labels' => $categories['labels'],
- 'datasets' => [
- [
- 'data' => $categories['data'],
- 'backgroundColor' => $categories['backgroundColor'],
- ]
- ]
- ]
- ]); ?>
- </div>
- <div class="col-md-6">
- <h2><?= Yii::t('app', 'Subscriptions by category'); ?></h2>
- <?= ChartJs::widget([
- 'type' => 'pie',
- 'options' => [
- 'height' => 90,
- ],
- 'clientOptions' => [
- 'legend' => [
- 'position' => 'left'
- ]
- ],
- 'data' => [
- 'labels' => $subscriptions['labels'],
- 'datasets' => [
- [
- 'data' => $subscriptions['data'],
- 'backgroundColor' => $subscriptions['backgroundColor'],
- ]
- ]
- ]
- ]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
|