<?php
/* @var $this SiteController */
?>
<div class="head">
    <?= CHtml::link('Меню', array('/registration/index'), array('class' => 'v')); ?>
    <?= CHtml::link('Герой', array('/hero/index'), array('class' => 'r'));
    ?>
    <div style="clear:both"></div></div>
<div class="telo">

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

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


<?php if (empty($models)): ?>
    <center>
        <strong>Ваша сумка пуста</strong>
        <hr>
        <?= CHtml::link('Вернуться', array('hero/index')) ?>
    </center>
<?php endif; ?>

<?php foreach ($models as $model): ?> 
    <?php $title_model = Clothes::findClothes($model->id_item) ?>
    <table>
        <tr>
            <td class="col-xs-6 col-sm-4">
                <img src="/images/eq/<?= $title_model->level ?>/<?= $title_model->type ?>.jpg" alt="">
            </td>

            <td>
                <?= CHtml::link($title_model->title, array('hero/info', 'id'=>$model->id)) ?>
                <br />
                <strong>
                    <?php if ($model->put == 0): ?>
                        <?= CHtml::link('Надеть', array('hero/put', 'id' => $model->id)) ?>
                    <?php else: ?>
                        <?= CHtml::link('Снять', array('hero/pull', 'id' => $model->id)) ?>
                    <?php endif; ?>
                        |
                        <?= CHtml::link('Выкинуть', array('hero/del', 'id' => $model->id)) ?>
                </strong>
            </td>
        </tr>
    </table>
<?php endforeach; ?>