Ejemplo n.º 1
0
<?php

use app\models\Event;
use app\models\Cart;
$_event = Event::findOne(2);
$carts = Cart::findAll(['status' => Cart::CART_SOLD]);
$sold_tickets = [];
foreach ($carts as $cart) {
    $items = $cart->items;
    foreach ($items as $i) {
        if (!isset($sold_tickets[$i->ticket_id])) {
            $sold_tickets[$i->ticket_id] = 0;
        }
        $sold_tickets[$i->ticket_id] += $i->quantity;
    }
}
$sold_total = 0;
$total_tickets_sold = 0;
$this->title = Yii::t('app', 'Event Summary');
?>
<div class="foxden-default-index">
    <h1><?php 
echo $this->title;
?>
</h1>
    <?php 
foreach ($_event->ticketGroups as $group) {
    if (sizeof($_event->ticketGroups) > 1) {
        ?>
<h2><?php 
        echo $group->name;