<?php 
$user_item = UserItems::findUserItem($data->idItem);
$sum = $data->idItem->health+$data->idItem->armor+$data->idItem->strength+$data->idItem->regeneration+$data->idItem->energy;
if ($user_item)
    $better = ($sum > $user_item->sum ? $sum-$user_item->sum : false);
else 
    $better = $sum;
?>
<div class="item-view">
    <div class="item-view_img">
        <img src="/images/items/<?php echo $data->idItem->img;?>.jpg">
    </div>
    <div class="item-view_info">
        <img src="/images/icons/quality/<?php echo $data->idItem->quality;?>.png"> 
        <?php echo CHtml::link($data->idItem->name, array('/auction/view', 'id' => $data->id_auction))?><br /> 
        <b><?php echo $data->idItem->level;?></b> ур.
        <?php if ($better > 0): ?> <span class="green">Лучше (+<?php echo $better; ?>)</span><?php endif; ?>
        <br /> 
        цена: <?php echo FuncHelper::Money($data->price)?>
    </div>
</div>