<div class="message_block">
    <div class="message_block-user">
        <div class="pull-left user-login"><?php echo Users::getLoginWithLink($data->id_user); ?></div>:
        <div class="pull-right">
            <?php echo FuncHelper::time($data->time); ?>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="message_block-message">
        <?php if (RoleCategories::checkRoleForAdmins($data->idUser->idRole->id_cat_role)): ?>
            <span class="text-success"><?php echo FuncHelper::outputText($data->message); ?></span>
        <?php else: ?>
            <?php echo FuncHelper::outputText($data->message, true, true, true, false, false); ?>
        <?php endif; ?>
    </div>
    <?php if ($data->type > 0): ?>
        <hr>
        <div class="message_block-answer">
            <div class="pull-left">
                <?php if ($data->type == 1): ?>
                    <?php echo FuncHelper::money($data->money);?>
                <?php elseif ($data->type == 2): ?>
                    <?php if ($data->iron): ?>
                        <img src="/images/icons/iron.png"> <?php echo $data->iron; ?>
                    <?php elseif ($data->bottles): ?>
                        <img src="/images/icons/bottle.png"> <?php echo $data->bottles; ?>
                    <?php endif; ?>  
                <?php else: ?>
                    <?php echo UserItems::itemName($data->item);?>
                <?php endif; ?>
            </div>
            <div class="pull-right">
                <?php if ($data->status > 0 && $data->id_user != Yii::app()->user->id): ?>
                    <?php echo CHtml::link('Забрать', array('/mail/attachment', 'id'=>$data->id_message), array('class' => 'btn btn-default btn-sm take')); ?>        
                <?php endif; ?>
            </div>
            <div class="clearfix"></div>
            <div class="response-error"></div>
        </div>
    <?php endif; ?>
</div> 