<?php
$this->pageTitle = 'Золото';
?>
<?php if (!isset($_SERVER['HTTP_X_HOST'])):?>
    <?php echo CHtml::link('Мобильный платеж', array('/payment/index'), array('class'=>'block '.($type == 'mobilePayment' ? 'active' : '')))?>
    <?php //echo CHtml::link('Через SMS', array('/payment/index', 'type'=>'sms'), array('class'=>'block '.($type == 'sms' ? 'active' : '')))?>
    <?php echo CHtml::link('Электронные деньги', array('/payment/index', 'type'=>'eMoney'), array('class'=>'block '.($type == 'eMoney' ? 'active' : '')))?>
    <?php echo CHtml::link('Банковские карты', array('/payment/index', 'type'=>'bank'), array('class'=>'block '.($type == 'bank' ? 'active' : '')))?>
    <?php echo CHtml::link('Терминал оплаты', array('/payment/index', 'type'=>'terminals'), array('class'=>'block '.($type == 'terminals' ? 'active' : '')))?>
    <?php echo CHtml::link('Прочие способы', array('/payment/index', 'type'=>'others'), array('class'=>'block '.($type == 'others' ? 'active' : '')))?>
    <?php echo CHtml::link('Бесплатное золото', array('/payment/index', 'type'=>'free'), array('class'=>'block '.($type == 'free' ? 'active' : '')))?>

    <?php $this->renderPartial('_'.$type, array(
                'type' => $type,
                'params' => $params
            ));?>
<?php else: ?>
    <?php echo CHtml::link('Перейти в кошелек', array('/payment/index', 'type'=>'wallet'), array('class'=>'block'))?>
    <hr>
    <?php foreach ($params as $value=>$price):?>
        <?php echo CHtml::beginForm(''); ?>
        <center>Купить <img src="/images/icons/money_gold.png" alt="*"><b><?php echo $value;?></b> золотых. Цена <b><?php echo $price;?></b> монет</center>
        <?php echo CHtml::hiddenField('value', $value); ?>
        <?php echo CHtml::submitButton(Yii::t('layout', 'Купить'), array('class' => 'btn-block form-control')); ?>
        <?php echo CHtml::endForm(); ?>
    <?php endforeach;?>
<?php endif; ?>
