    <?php if(Yii::app()->user->hasFlash('succes')):?>
    <p class="text-success">
        <?php echo Yii::app()->user->getFlash('succes'); ?>
    </p>
    <?php endif; ?>
    
    <?php if(Yii::app()->user->hasFlash('error')):?>
    <p class="text-danger">
        <?php echo Yii::app()->user->getFlash('error'); ?>
    </p>
    <?php endif; ?>
    

    <?php foreach ($models as $model): ?>

        <table>
            <tr>
                <td class="col-xs-6 col-sm-4">
                    <img src="/images/shop/cat_<?= $model->type ?>/<?= $model->id ?>.png" alt="" class="img-rounded">
                </td>
                <td>
                    <?= CHtml::link($model['title'], array('shop/info', 'id' => $model->id)) ?>
                    <?php if ($model->level <= $level): ?>
                        <p class="text-success">Уровень персонажа: <?= $model->level ?>
                    <?php else: ?>
                        <p class="text-danger">Уровень персонажа: <?= $model->level ?>
                    <?php endif; ?>
                        <br />
                        <?= CHtml::link('Купить', array('shop/buy', 'id'=>$model->id)) ?> за
                        <?php if ($model->donate == 0): ?>
                        <?= $model->money ?> <img src="/images/money.png" alt="">
                        <?php else: ?>
                        <?= $model->donate ?> <img src="/images/diamond.png " alt="">
                        <?php endif; ?>                               
                        </p>
                </td>
            </tr>
        </table>

    <?php endforeach ?>





    <p>
        <?php
        $this->widget('CLinkPager', array(
            'pages' => $pages,
            'lastPageLabel' => false,
            'firstPageLabel' => false,
            'prevPageLabel' => 'Назад',
            'nextPageLabel' => 'Далее',
            'maxButtonCount' => '10',
            'header' => '</span>',
        ))
        ?>
    </p>
    <p><img src="/images/shop/cat_<?= $model->type ?>.png" alt="" width="24" height="24"> 
        <?= CHtml::link('Вернуться', array('shop/dearshop')) ?>
    </p>
</div>