<?php
$this->pageTitle = 'Магазин';
?>
<div class="npc-view_block">
    <div class="npc-view_img">
        <img src="/images/abilities/preview/<?php echo $model->id_ability; ?>.jpg">
    </div>
    <div class="npc-view_info">
        <?php echo $model->descr_ability; ?>
    </div>
</div>
<?php foreach ($model->abilitiesTypes as $type): ?>
	<?php if (empty($ability) || $ability->idType->type < $type->type): ?>
		<div class="item-view">
			<div class="item-view_img">
				<img src="/images/abilities/<?php echo $model->id_ability; ?>/<?php echo $type->type; ?>.jpg">
			</div>
			<div class="item-view_info">
				<img src="/images/icons/quality/6.png" alt="*"/> <?php echo $model->name_ability; ?>, <?php echo FuncHelper::getQuality($type->type); ?><br />
				<img src="/images/icons/quality/6.png" alt="*"/> <?php echo $model->info; ?>: <span class="percent"><?php echo FuncHelper::abilityShopInfo($type); ?></span><br /> 
				<?php echo CHtml::link('Купить '.FuncHelper::money($type->money), ['/shop/viewAbility', 'id' => $model->id_ability, 'type' => $type->id_type], ['class' => 'btn btn-default btn-sm']); ?>
			</div>
		</div>
		<hr>
	<?php endif; ?>
<?php endforeach; ?>