<?php
/* @var $this UserController */
/* @var $model Users */

$this->pageTitle = 'Настройки';
?>
<?php if(!$model->diplomat): ?>
    <?php echo CHtml::link('<img src="/images/icons/arrow.png" alt="*"> Дипломатия <img src="/images/icons/money_gold.png" alt="*">50', array('/user/options/', 'change'=>'diplomat'), array('class' => 'block') )?>
    Позволяет вести переписку с другой стороной
<?php endif; ?>
<?php echo CHtml::link('<img src="/images/icons/arrow.png" alt="*"> Сменить класс <img src="/images/icons/money_gold.png" alt="*">10', array('/user/options/', 'change'=>'class'), array('class' => 'block') )?>
<?php echo CHtml::link('<img src="/images/icons/arrow.png" alt="*"> Сменить ник <img src="/images/icons/money_gold.png" alt="*">50', array('/user/options/', 'change'=>'login'), array('class' => 'block') )?>
<?php echo CHtml::link('<img src="/images/icons/arrow.png" alt="*"> Сменить сторону <img src="/images/icons/money_gold.png" alt="*">50', array('/user/options/', 'change'=>'side'), array('class' => 'block') )?>
<?php echo CHtml::link('<img src="/images/icons/arrow.png" alt="*"> Сменить пол <img src="/images/icons/money_gold.png" alt="*">5', array('/user/options/', 'change'=>'sex'), array('class' => 'block') )?>

<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'options-form',
    'htmlOptions'=>array(
      'role'=>'form',
    ),
));
?>
<?php if(Yii::app()->getRequest()->getParam('change')=='login'): ?>
    <div class="title">Cмена ника</div>
    <div class="form-group">
        <?php echo $form->labelEx($options, 'login'); ?>
        <?php echo $form->passwordField($options, 'login', array('class' => 'form-control', 'placeholder' => 'Введите новый ник')); ?>
        <?php echo $form->error($options, 'login'); ?>
    </div>
<?php else: ?>
    <?php if(!isset($_SERVER['HTTP_X_HOST'])): ?>
        <div class="title">Смена пароля</div>
        <div class="form-group">
            <?php echo $form->labelEx($options, 'password_now'); ?>
            <?php echo $form->passwordField($options, 'password_now', array('class' => 'form-control', 'placeholder' => 'Текущий пароль')); ?>
            <?php echo $form->error($options, 'password_now'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($options, 'password_new'); ?>
            <?php echo $form->passwordField($options, 'password_new', array('class' => 'form-control', 'placeholder' => 'Новый пароль')); ?>
            <?php echo $form->error($options, 'password_new'); ?>
        </div>
        <div class="form-group">
            <?php echo $form->labelEx($options, 'password_confirm'); ?>
            <?php echo $form->passwordField($options, 'password_confirm', array('class' => 'form-control', 'placeholder' => 'Повторите новый пароль')); ?>
            <?php echo $form->error($options, 'password_confirm'); ?>
        </div>
    <?php endif;?>
<?php endif;?>
<?php echo CHtml::submitButton(Yii::t('layout', 'Сменить'), array('class' => 'btn-block form-control')); ?>
<?php $this->endWidget(); ?>
