Modal::end(); ?> <div class="row"> <?php echo extendedGridView::widget(['dataProvider' => $forecasters, 'options' => ['class' => 'col-xs-12 col-md-10 col-lg-10'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'header' => 'Место'], ['header' => 'Пользователь', 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-3 col-sm-2'], 'hAlign' => 'left', 'headerOptions' => ['style' => 'text-align:center'], 'content' => function ($model1) use($model) { return Html::button($model1['idUser']['username'], ['value' => Url::to(['tournaments/user', 'user' => $model1['id_user'], 'tournament' => $model->id_tournament]), 'class' => 'btn btn-link modalUser']); }], ['header' => 'Очки', 'attribute' => "points", 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-1'], 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center']], ['header' => 'Прогнозы по турам', 'attribute' => "tours", 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-7 col-sm-8'], 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center'], 'value' => function ($model1) use($model) { $string = ''; foreach ($model1['tours'] as $k => $one) { $options['value'] = Url::to(['tournaments/tour', 'tour' => $k, 'tournament' => $model->id_tournament, 'user' => $model1['id_user']]); switch ($one) { case 0: $options['class'] = 'btn btn-danger modalList'; break; case 1: $options['class'] = 'btn btn-warning modalList'; break; case 2: $options['class'] = 'btn btn-success modalList'; break; } $k = Html::button($k, $options); $string .= $k; } return $string; }, 'format' => 'raw']]]); ?> </div> <?php if ($model->is_active != Tournaments::FINISHED && $nextTour) {
foreach ($tourGames as $tour => $games) { ?> <br> <?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_INLINE, 'fieldConfig' => ['autoPlaceholder' => false]]); ?> <?php echo Html::input('hidden', 'tour', $tour); ?> <div class = 'row'> <?php echo extendedGridView::widget(['dataProvider' => $tourGames[$tour], 'caption' => "Тур {$tour}", 'hover' => true, 'options' => ['class' => 'col-xs-12 col-md-10 col-lg-8'], 'summary' => '', 'columns' => [['attribute' => "id_game", 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-1'], 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center'], 'footer' => '33'], ['header' => 'Участники', 'vAlign' => 'middle', 'content' => function ($model) use($form) { return "<row>" . "<div class = 'text-right col-xs-4'>" . $model->idTeamHome->idTeam->team_name . " " . "</div>" . "<div class = 'text-center col-xs-4'>" . Html::input('number', "Games[{$model->id_game}][score_home]", $model->score_home, ['class' => 'score']) . Html::input('number', "Games[{$model->id_game}][score_guest]", $model->score_guest, ['class' => 'score']) . "</div>" . "<div class = 'text-left col-xs-4'>" . " " . $model->idTeamGuest->idTeam->team_name . $form->field($model, "[{$model->id_game}]id_game")->hiddenInput() . "</div>" . "</row>" . "<row>" . "<div class = 'col-xs-12 text-center'>" . "</div>" . "</row>"; }, 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-8'], 'hAlign' => 'center'], ['headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center', 'vAlign' => 'middle', 'attribute' => 'date_time_game', 'options' => ['class' => 'col-xs-2'], 'content' => function ($model) use($form) { return $form->field($model, "[{$model->id_game}]date_time_game")->input('text', ['class' => 'datepicker', 'value' => date('d.m.y H:i', $model->date_time_game)]); }], ['class' => '\\kartik\\grid\\ActionColumn', 'deleteOptions' => ['label' => '<i class="glyphicon glyphicon-remove"></i>'], 'template' => '{delete}', 'header' => false, 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center']]]]); ?> </div> <div class = 'row'> <div class = 'col-sm-8 kv-align-center'> <?php echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary']); ?> </div> </div> <?php ActiveForm::end();
<div class="col-xs-12 col-xs-offset-0 col-sm-offset-1 col-sm-10 tournaments-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('app', 'Create', ['modelClass' => 'Tournaments']), ['create'], ['class' => 'btn btn-success']); ?> </p> <div class="row"> <?php echo extendedGridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['class' => 'col-xs-12 col-md-10 col-lg-8'], 'columns' => [['attribute' => 'id_tournament', 'filter' => false, 'options' => ['class' => 'col-xs-1'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center']], ['attribute' => 'tournament_name', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-3'], 'content' => function ($model) { return Html::a($model->tournament_name, ['tournaments/update', 'id' => $model->id_tournament]); }, 'format' => 'url'], ['header' => 'Игры', 'filter' => false, 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-2'], 'content' => function ($model) { return Html::a('Игры турнира', ['games/index', 'tournament' => $model->id_tournament]); }, 'format' => 'url'], ['attribute' => 'country', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'content' => function ($model) { return Html::a($model->country0->country, ["countries/update", 'id' => $model->country]); }, 'format' => 'url', 'filter' => ArrayHelper::map(Countries::find()->orderBy('country', 'asc')->all(), 'id', 'country'), 'filterInputOptions' => ['class' => 'form-control'], 'options' => ['class' => 'col-xs-2']], ['attribute' => 'num_tours', 'filter' => false, 'header' => 'Туры', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1']], ['attribute' => 'is_active', 'content' => function ($model) { return $model->status; }, 'options' => ['class' => 'col-xs-2'], 'headerOptions' => ['style' => 'text-align:center'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'filter' => ['0' => 'Не начался', '1' => 'Проходит', '2' => 'Закончен']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'options' => ['class' => 'hidden-xs'], 'headerOptions' => ['style' => 'text-align:center'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle']]]]); ?> </div> </div> </div>
echo Html::endTag('h5'); } ?> <?php if ($isFinished && !empty($winnersForecast->allModels)) { ?> <p><?php echo $winnersForecastDetails; ?> </p> <p><b>Общее количество дополнительных очков: <?php echo $totalAdditionalPoints; ?> </b></p> <?php } ?> <hr> <?php echo Html::beginTag('h4', ['class' => 'text-center']); ?> Очки по турам <?php echo Html::endTag('h4'); ?> <?php echo extendedGridView::widget(['dataProvider' => $forecast, 'showPageSummary' => true, 'summary' => false, 'condensed' => true, 'columns' => [['attribute' => 'tour', 'header' => 'Тур', 'headerOptions' => ['class' => 'text-center'], 'options' => ['class' => 'col-xs-6'], 'hAlign' => 'center', 'vAlign' => 'middle', 'pageSummary' => 'Всего'], ['attribute' => 'points', 'header' => 'Очки', 'headerOptions' => ['class' => 'text-center'], 'options' => ['class' => 'col-xs-6'], 'hAlign' => 'center', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryOptions' => ['align' => 'center']]]]);
?> <?php $content .= "<p class = 'text-right'>" . Html::a("<i class = 'fa fa-list-alt'></i> Все игры", ['tournaments/details', 'id' => $tournament['id_tournament']]) . "</p>"; ?> <?php foreach ($tournament['games'] as $k => $tour) { ?> <?php $form = ActiveForm::begin(['action' => ['site/forecast-save']]); ?> <?php $content .= extendedGridView::widget(['dataProvider' => $tour, 'summary' => '', 'bordered' => false, 'showHeader' => false, 'caption' => "Тур {$k}. Ваш прогноз", 'captionOptions' => ['colspan' => 4, 'class' => 'text-center normal'], 'columns' => [['content' => function ($model) { return '<strong>' . date('d.m.y H:i', $model['date_time_game']) . '</strong>'; }, 'options' => ['class' => 'col-xs-1'], 'contentOptions' => ['class' => 'reduceDateFont'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ExpandRowColumn', 'value' => function ($model, $key, $index, $column) { return extendedGridView::ROW_COLLAPSED; }, 'detail' => function ($model, $key, $index, $column) { return Yii::$app->controller->renderPartial('_five-last-games', ['details' => $model]); }, 'headerOptions' => ['class' => 'kartik-sheet-style'], 'expandOneOnly' => true, 'expandIcon' => "<i class='fa fa-plus-square'></i>", 'collapseIcon' => "<i class='fa fa-minus-square'></i>", 'enableRowClick' => true, 'detailOptions' => ['class' => 'expanded'], 'contentOptions' => ['class' => 'expand-icon']], ['content' => function ($model) use($form) { return "<row>" . "<div class = 'text-right col-xs-5'>" . Html::img(Teams::getPath() . '/' . $model['idTeamHome']['idTeam']['team_logo'], ['width' => 30]) . ' ' . Html::a($model['idTeamHome']['idTeam']['team_name'], ['tournaments/games', 'id' => $model['id_team_home']]) . " " . "</div>" . "<div class = 'text-center col-xs-2'>" . "-" . "</div>" . "<div class = 'text-left col-xs-5'>" . " " . Html::a($model['idTeamGuest']['idTeam']['team_name'], ['tournaments/games', 'id' => $model['id_team_guest']]) . ' ' . Html::img(Teams::getPath() . '/' . $model['idTeamGuest']['idTeam']['team_logo'], ['width' => 30]) . "</div>" . "</row>" . "<row>" . "<div class = 'col-xs-12 text-center'>" . Html::input('number', "forecasts[{$model['id_game']}][fscore_home]", isset($model['f_id']) ? $model['fscore_home'] : '', ['class' => 'forecast', 'form' => $form->getID(), 'maxlength' => 2, 'disabled' => $model['date_time_game'] - time() < 60 * 60 ? true : false]) . Html::input('number', "forecasts[{$model['id_game']}][fscore_guest]", isset($model['f_id']) ? $model['fscore_guest'] : '', ['class' => 'forecast', 'maxlength' => 2, 'form' => $form->getID(), 'disabled' => $model['date_time_game'] - time() < 60 * 60 ? true : false]) . "</div>" . "</row>"; }, 'options' => ['class' => 'col-xs-11'], 'contentOptions' => ['style' => 'font-size: 13px'], 'vAlign' => 'middle']]]); ?> <?php $content .= "<p class = 'text-right'>" . Html::submitButton('Сохранить', ['class' => 'btn btn-success', 'form' => $form->getId()]) . "</p>"; ?> <?php ActiveForm::end(); ?> <?php $content .= "</form>"; ?> <?php
<?php use yii\helpers\Html; use app\components\grid\extendedGridView; use app\models\forecasts\Forecasts; /* @var $this yii\web\View */ /* @var $searchModel app\models\tournaments\TournamentsSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Турниры'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="row"> <div class="col-xs-12 col-xs-offset-0 col-sm-offset-1 col-sm-10"> <h2>Статистика по всем турнирам</h2> <div class="row"> <?php echo extendedGridView::widget(['dataProvider' => $dataProvider, 'bordered' => false, 'options' => ['class' => 'col-xs-12 col-md-10 col-lg-8'], 'resizableColumns' => false, 'summary' => false, 'columns' => [['attribute' => 'tournament_name', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-lg-4'], 'content' => function ($model) { return Html::a($model->tournament_name, ['tournaments/details', 'id' => $model->id_tournament]); }, 'format' => 'url'], ['attribute' => 'country0.country', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'filterInputOptions' => ['class' => 'form-control'], 'options' => ['class' => 'col-lg-2']], ['attribute' => 'status', 'options' => ['class' => 'col-lg-2'], 'header' => 'Статус', 'headerOptions' => ['style' => 'text-align:center'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'filter' => ['0' => 'Не начался', '1' => 'Проходит', '2' => 'Закончен']], ['header' => 'Лидер прогноза', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-lg-2'], 'content' => function ($model) { return isset($model->usersTournaments[0]->idUser->username) ? $model->usersTournaments[0]->idUser->username : '******'; }], ['header' => 'Очки лидера', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-lg-2'], 'content' => function ($model) { return isset($model->usersTournaments[0]->idUser->username) ? $model->usersTournaments[0]->points : '-'; }], ['attribute' => 'startsOn', 'content' => function ($model) { return $model->startsOn == NULL ? '-' : date('d.m.Y', $model->startsOn); }, 'visible' => false, 'options' => ['class' => 'col-lg-1'], 'headerOptions' => ['style' => 'text-align:center'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle']]]]); ?> </div> </div> </div>
}], ['header' => 'Очки победителя', 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'content' => function ($model) { return isset($model->usersTournaments[0]->points) ? $model->usersTournaments[0]->points : '-'; }]]]); ?> </div> <hr> <h2>Турниры без вашего участия</h2> <h4>Кликните на название турнира, чтобы посмотреть результаты</h4> <div class="row"> <?php echo extendedGridView::widget(['dataProvider' => $notUserTournaments, 'bordered' => false, 'summary' => false, 'options' => ['class' => 'col-xs-12 col-sm-10 col-lg-8'], 'resizableColumns' => false, 'columns' => [['header' => 'Название турнира', 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-3'], 'content' => function ($model) { return Html::a($model->tournament_name, ['tournaments/details', 'id' => $model->id_tournament]); }, 'format' => 'url'], ['header' => 'Страна', 'attribute' => 'country0.country', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-2']], ['header' => 'Статус', 'content' => function ($model) { return $model->status; }, 'options' => ['class' => 'col-xs-2'], 'headerOptions' => ['style' => 'text-align:center'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle']], ['header' => 'Лидер прогноза', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-2'], 'content' => function ($model) { return isset($model->usersTournaments[0]->idUser->username) ? $model->usersTournaments[0]->idUser->username : '******'; }], ['header' => 'Очки лидера', 'filter' => false, 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'content' => function ($model) { return isset($model->usersTournaments[0]->points) ? $model->usersTournaments[0]->points : '-'; }], ['header' => 'Участвовать!', 'contentOptions' => ['style' => 'vertical-align:middle', 'align' => 'center'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'content' => function ($model) { if ($model->is_active == Tournaments::GOING || $model->is_active == Tournaments::NOT_STARTED) { return Html::a('Участвовать!', ['tournaments/participate', 'id' => $model->id_tournament], ['class' => 'btn btn-success btn-sm', 'data-method' => 'post']); } else { return '-'; } }]]]); ?> </div> </div> </div>
</h2> <?php if ($isFinished && !empty($winnersForecast->allModels)) { ?> <?php echo Html::beginTag('h4', ['class' => 'text-center']); ?> Прогноз - призеры турнира <?php echo Html::endTag('h4'); ?> <?php echo extendedGridView::widget(['dataProvider' => $winnersForecast, 'showPageSummary' => false, 'summary' => false, 'condensed' => true, 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'header' => 'Место'], ['attribute' => 'team.idTeam.team_name', 'header' => 'Команда', 'headerOptions' => ['class' => 'text-center'], 'options' => ['class' => 'col-xs-11'], 'hAlign' => 'center', 'vAlign' => 'middle', 'pageSummary' => 'Всего']]]); ?> <p><?php echo $winnersForecastDetails; ?> </p> <p><b>Общее количество дополнительных очков: <?php echo $totalAdditionalPoints; ?> </b></p> <?php } elseif ($isFinished && empty($winnersForecast->allModels)) { ?> <?php echo Html::beginTag('h5', ['class' => 'text-center']);
* User: achernys * Date: 4/28/2016 * Time: 5:58 PM */ use app\components\grid\extendedGridView; use yii\helpers\Html; use yii\helpers\Url; ?> <h4>Уважаемый <?php echo $user->idUser->username; ?> !</h4> <p><?php echo $message; ?> </p> <br> <h5>Полная таблица результатов прогноза</h5> <?php echo extendedGridView::widget(['dataProvider' => $standings, 'caption' => 'Победители прогноза', 'summary' => false, 'showHeader' => false, 'toggleData' => false, 'filterUrl' => false, 'options' => ['class' => 'col-xs-12 col-md-5 col-lg-5'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'header' => 'Место'], ['header' => 'Пользователь', 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-9'], 'hAlign' => 'left', 'headerOptions' => ['style' => 'text-align:center'], 'attribute' => 'idUser.username'], ['header' => 'Очки', 'content' => function ($model) { return $model->totalPoints; }, 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-1'], 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center']]]]); ?> <br> <p>Полная информация о турнире доступна на его <?php echo Html::a('странице', Url::to(Yii::$app->params['url'] . "/tournaments/{$tournament->id_tournament}", true)); ?> </p>
<?php $content = ''; ?> <?php $content .= "<p class = 'text-right'>" . Html::a("<i class = 'fa fa-list-alt'></i> Все игры", ['tournaments/details', 'id' => $tournament['id_tournament']]) . "</p>"; ?> <?php foreach ($tournament['games'] as $k => $tour) { ?> <?php $content .= extendedGridView::widget(['dataProvider' => $tour, 'summary' => '', 'showHeader' => false, 'bordered' => false, 'caption' => "Тур {$k}", 'captionOptions' => ['colspan' => 4, 'class' => 'text-center normal'], 'columns' => [['content' => function ($model) { return '<strong>' . date('d.m.y H:i', $model->date_time_game) . '</strong>'; }, 'options' => ['class' => 'col-xs-2'], 'contentOptions' => ['class' => 'reduceDateFont'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['content' => function ($model) { return Html::img($model->idTeamHome->idTeam->fileUrl, ['width' => 30]) . ' ' . $model->idTeamHome->idTeam->team_name; }, 'options' => ['class' => 'col-xs-4'], 'hAlign' => 'right', 'vAlign' => 'middle'], ['content' => function ($model) { return "<strong>" . $model->score_home . ' - ' . $model->score_guest . "</strong>"; }, 'options' => ['class' => 'col-xs-2'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['content' => function ($model) { return $model->idTeamGuest->idTeam->team_name . ' ' . Html::img($model->idTeamGuest->idTeam->fileUrl, ['width' => 30]); }, 'options' => ['class' => 'col-xs-4'], 'hAlign' => 'left', 'vAlign' => 'middle']]]); ?> <?php } ?> <?php echo Collapse::widget(['encodeLabels' => false, 'items' => [['label' => "<i class = 'fa fa-futbol-o fa-spin'></i>" . ' ' . $tournament['tournament'], 'content' => $content]]]); ?> <?php }
echo $trn->tournament_name; ?> , ознакомьтесь с его результатами</p> Подробную информацию о турнире можно посомотреть на его <?php echo Html::a('странице', ['/tournaments/details', 'id' => $trn->id_tournament]); ?> <div class = 'row'> <?php echo extendedGridView::widget(['dataProvider' => $games, 'caption' => 'Результаты тура', 'showHeader' => false, 'summary' => false, 'toggleData' => false, 'filterUrl' => false, 'options' => ['class' => 'col-xs-12'], 'columns' => [['contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'options' => ['class' => 'col-xs-2 reduceDateFont'], 'headerOptions' => ['style' => 'text-align:center'], 'content' => function ($model) { return date('d.m.y H:i', $model->date_time_game); }], ['content' => function ($model) { return Html::img($model->idTeamHome->idTeam->fileUrl, ['width' => 30]) . ' ' . $model->idTeamHome->idTeam->team_name; }, 'options' => ['class' => 'col-xs-4'], 'contentOptions' => ['align' => 'right', 'style' => 'vertical-align:middle']], ['content' => function ($model) { return "<strong>" . $model->score_home . ' - ' . $model->score_guest . "</strong>"; }, 'options' => ['class' => 'col-xs-2'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle']], ['content' => function ($model) { return $model->idTeamGuest->idTeam->team_name . ' ' . Html::img($model->idTeamGuest->idTeam->fileUrl, ['width' => 30]); }, 'options' => ['class' => 'col-xs-4'], 'contentOptions' => ['align' => 'left', 'style' => 'vertical-align:middle']]]]); ?> <?php echo extendedGridView::widget(['dataProvider' => $forecasters, 'caption' => 'Лучшие прогнозы тура', 'summary' => false, 'showHeader' => false, 'toggleData' => false, 'filterUrl' => false, 'options' => ['class' => 'col-xs-6'], 'columns' => [['header' => 'Пользователь', 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-sm-10'], 'contentOptions' => ['align' => 'left', 'style' => 'vertical-align:middle'], 'content' => function ($model) { return $model->idUser->username; }], ['header' => 'Очки', 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-sm-2'], 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'content' => function ($model) { return $model->points; }]]]); ?> </div>
<p class = 'text-right'> <?php echo Html::a("<i class = 'fa fa-futbol-o'></i> Все турниры", ['tournaments/index']); ?> </p> </div> </div> <div class = "text-center"> <div class ="row"> <?php echo extendedGridView::widget(['dataProvider' => $finishedTournaments, 'showOnEmpty' => false, 'emptyText' => '', 'caption' => 'Законченные турниры', 'captionOptions' => ['bordered' => false, 'class' => 'text-center', 'style' => 'font-size: 1.5em;'], 'condensed' => true, 'bordered' => false, 'summary' => '', 'columns' => [['header' => 'Турнир', 'contentOptions' => ['class' => 'text-left', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-6'], 'content' => function ($model) { return Html::a($model->tournament_name, ['tournaments/details', 'id' => $model->id_tournament]); }, 'format' => 'url'], ['header' => 'Победитель', 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-4'], 'content' => function ($model) { return isset($model->usersTournaments[0]->idUser->username) ? $model->usersTournaments[0]->idUser->username : '******'; }], ['header' => 'Очки победителя', 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'content' => function ($model) { return isset($model->usersTournaments[0]->points) ? $model->usersTournaments[0]->points : '-'; }]]]); ?> <p class = 'text-right'> <?php echo Html::a("<i class = 'fa fa-futbol-o'></i> Все турниры", ['tournaments/index']); ?> </p> </div> </div> <div class="text-center">
?> <?php $content = ''; ?> <?php $content .= "<p class = 'text-right'>" . Html::a("<i class = 'fa fa-list-alt'></i> Все игры", ['tournaments/details', 'id' => $tournament['id_tournament']]) . "</p>"; ?> <?php foreach ($tournament['games'] as $k => $tour) { ?> <?php $content .= extendedGridView::widget(['dataProvider' => $tour, 'summary' => '', 'showHeader' => false, 'showPageSummary' => true, 'caption' => "Тур {$k}", 'captionOptions' => ['colspan' => 4, 'class' => 'text-center normal'], 'columns' => [['content' => function ($model) { return '<strong>' . date('d.m.y H:i', $model['date_time_game']) . '</strong>'; }, 'options' => ['class' => 'col-xs-1'], 'contentOptions' => ['class' => 'reduceDateFont'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['content' => function ($model) { return "<row>" . "<div class = 'text-right col-xs-4'>" . Html::img(Teams::getPath() . '/' . $model['idTeamHome']['idTeam']['team_logo'], ['width' => 30]) . ' ' . $model['idTeamHome']['idTeam']['team_name'] . " " . "</div>" . "<div class = 'text-center col-xs-4'>" . "<strong>" . $model['score_home'] . " - " . $model['score_guest'] . "</strong>" . "</div>" . "<div class = 'text-left col-xs-4'>" . " " . $model['idTeamGuest']['idTeam']['team_name'] . ' ' . Html::img(Teams::getPath() . '/' . $model['idTeamGuest']['idTeam']['team_logo'], ['width' => 30]) . "</div>" . "</row>" . "<div class='clearfix visible-xs-block'></div>" . "<row>" . "<div class = 'col-xs-4 col-xs-offset-4 col-lg-2 col-lg-offset-5 text-center'>" . Html::tag('div', isset($model['f_id']) ? $model['fscore_home'] . ' - ' . $model['fscore_guest'] : " - ", ['class' => !isset($model['f_id']) ? '' : ($model['fpoints'] == 0 ? 'bg-danger' : ($model['fpoints'] == 1 ? 'bg-info' : ($model['fpoints'] == 3 ? 'bg-success' : ($model['fpoints'] == 2 ? 'bg-warning' : ''))))]) . "</div>" . "<div class = 'col-xs-3 col-xs-offset-1 col-lg-2 col-lg-offset-3 text-right'>" . Html::tag('span', isset($model['f_id']) ? "Очки: " . $model['fpoints'] : '', []) . "</div>" . "</row>"; }, 'attribute' => 'fpoints', 'pageSummary' => function ($summary, $data, $widget) { return "<div class = 'row'>" . "<div class = 'col-xs-10'>" . "<p class = 'pull-left'>Всего очков в туре:</p>" . "</div>" . "<div class = 'col-xs-2'>" . "<p class = 'pull-left'>{$summary}</p>" . "</div>" . "</div>"; }, 'options' => ['class' => 'col-xs-11'], 'contentOptions' => ['style' => 'font-size: 13px'], 'vAlign' => 'middle']]]); ?> <?php } ?> <?php echo Collapse::widget(['encodeLabels' => false, 'items' => [['label' => "<i class = 'fa fa-futbol-o fa-spin'></i>" . ' ' . $tournament['tournament'], 'content' => $content]]]); ?> <?php } ?> </div>
* Date: 11/11/2015 * Time: 4:10 PM */ use app\components\grid\extendedGridView; use yii\helpers\Html; echo Html::tag('p', "Закончился турнир {$trn->tournament_name}. Пожалуйста, ознакомьтесь с его результатами"); ?> <?php echo "Подробную информацию о турнире можно посомотреть на его " . Html::a('странице', ['/tournaments/details', 'id' => $trn->id_tournament]); ?> <br> <div class = 'row'> <?php echo extendedGridView::widget(['dataProvider' => $forecasters, 'caption' => 'Победители прогноза', 'summary' => false, 'showHeader' => false, 'toggleData' => false, 'filterUrl' => false, 'options' => ['class' => 'col-xs-12 col-md-5 col-lg-5'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-1'], 'header' => 'Место'], ['header' => 'Пользователь', 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-9'], 'hAlign' => 'left', 'headerOptions' => ['style' => 'text-align:center'], 'attribute' => 'idUser.username'], ['header' => 'Очки', 'attribute' => "points", 'vAlign' => 'middle', 'options' => ['class' => 'col-xs-1'], 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center']]]]); ?> <?php echo extendedGridView::widget(['dataProvider' => $standings, 'options' => ['class' => 'col-xs-12 col-md-5 col-md-offset-1 col-lg-6 col-lg-offset-1'], 'summary' => false, 'showHeader' => false, 'toggleData' => false, 'filterUrl' => false, 'caption' => 'Турнирная таблица', 'columns' => [['header' => 'Место', 'class' => 'yii\\grid\\SerialColumn', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'options' => ['class' => 'col-xs-1'], 'headerOptions' => ['style' => 'text-align:center']], ['header' => 'Команда', 'content' => function ($model) { return $model['team_name']; }, 'contentOptions' => ['style' => 'vertical-align:middle'], 'headerOptions' => ['style' => 'text-align:center'], 'options' => ['class' => 'col-xs-9']], ['header' => 'Игры', 'attribute' => 'games_played', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'options' => ['class' => 'col-xs-1'], 'headerOptions' => ['style' => 'text-align:center'], 'content' => function ($model) { return isset($model['games_played']) ? $model['games_played'] : 0; }], ['header' => 'Очки', 'contentOptions' => ['align' => 'center', 'style' => 'vertical-align:middle'], 'options' => ['class' => 'col-xs-1'], 'headerOptions' => ['style' => 'text-align:center'], 'content' => function ($model) { return isset($model['pts']) ? $model['pts'] : 0; }]]]); ?> </div>