Exemplo n.º 1
0
echo Html::encode($this->title);
?>
</h1>
<?php 
$session = new Session();
$errors = $session->getErrors();
$session->clearErrors();
foreach ($errors as $e) {
    ?>
<div class="alert alert-danger"><h2><?php 
    echo $e;
    ?>
</h2></div><?php 
}
$successes = $session->getSuccesses();
$session->clearSuccesses();
foreach ($successes as $e) {
    ?>
<div class="alert alert-success"><h2><?php 
    echo $e;
    ?>
</h2></div><?php 
}
?>

<?php 
echo yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-striped'], 'columns' => [['attribute' => 'ticket_id', 'content' => function ($model, $index, $widget, $grid) {
    return $model->ticket->group->event->name . ': ' . $model->ticket->name;
}, 'label' => 'Ticket'], ['attribute' => 'quantity', 'content' => function ($model, $index, $widget, $grid) {
    return ($model->ticket->getAvailableQuantity() === false || $model->ticket->getAvailableQuantity() > $model->quantity ? '<a class="btn btn-xs btn-info" href="' . Url::to(['/cart/add/', 'id' => $model->ticket_id]) . '">+</a>' : '') . $model->quantity . ($model->quantity > 0 ? '<a class="btn btn-xs btn-info" href="' . Url::to(['/cart/reduce/', 'id' => $model->ticket_id]) . '">-</a>' : '');
}], ['content' => function ($model, $index, $widget, $grid) {