<?php defined('MW_PATH') || exit('No direct script access allowed');

/**
 * This file is part of the MailWizz EMA application.
 * 
 * @package MailWizz EMA
 * @author Serban George Cristian <cristian.serban@mailwizz.com> 
 * @link http://www.mailwizz.com/
 * @copyright 2013-2014 MailWizz EMA (http://www.mailwizz.com)
 * @license http://www.mailwizz.com/license/
 * @since 1.0
 */
 
?>
    
<?php $form = $this->beginWidget('CActiveForm'); ?>
<div class="panel panel-default">
    
    <div class="panel-heading">
        <div class="pull-left">
            <h3 class="panel-title"><span class="glyphicon glyphicon-user"></span> <?php echo $pageHeading;?></h3>
        </div>
        <div class="pull-right">
            <?php if (!$user->isNewRecord) { ?>
            <?php echo CHtml::link(Yii::t('app', 'Create new'), array('users/create'), array('class' => 'btn btn-default btn-xs', 'title' => Yii::t('app', 'Create new')));?>
            <?php } ?>
            <?php echo CHtml::link(Yii::t('app', 'Cancel'), array('users/index'), array('class' => 'btn btn-default btn-xs', 'title' => Yii::t('app', 'Cancel')));?>
        </div>
        <div class="clearfix"><!-- --></div>
    </div>
    
    <div class="panel-body">
        
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'first_name');?>
            <?php echo $form->textField($user, 'first_name', $user->getHtmlOptions('first_name')); ?>
            <?php echo $form->error($user, 'first_name');?>
        </div>        

        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'last_name');?>
            <?php echo $form->textField($user, 'last_name', $user->getHtmlOptions('last_name')); ?>
            <?php echo $form->error($user, 'last_name');?>
        </div>    
    
        <div class="clearfix"><!-- --></div>

        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'email');?>
            <?php echo $form->textField($user, 'email', $user->getHtmlOptions('email')); ?>
            <?php echo $form->error($user, 'email');?>
        </div>        

        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'confirm_email');?>
            <?php echo $form->textField($user, 'confirm_email', $user->getHtmlOptions('confirm_email')); ?>
            <?php echo $form->error($user, 'confirm_email');?>
        </div>        
        
        <div class="clearfix"><!-- --></div>

        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'fake_password');?>
            <?php echo $form->textField($user, 'fake_password', $user->getHtmlOptions('password')); ?>
            <?php echo $form->error($user, 'fake_password');?>
        </div>
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'confirm_password');?>
            <?php echo $form->textField($user, 'confirm_password', $user->getHtmlOptions('confirm_password')); ?>
            <?php echo $form->error($user, 'confirm_password');?>
        </div>
        
        <div class="clearfix"><!-- --></div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($user, 'timezone');?>
            <?php echo $form->dropDownList($user, 'timezone', $user->getTimeZonesArray(), $user->getHtmlOptions('timezone')); ?>
            <?php echo $form->error($user, 'timezone');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($user, 'language_id');?>
            <?php echo $form->dropDownList($user, 'language_id', CMap::mergeArray(array('' => Yii::t('app', 'Application default')), Language::getLanguagesArray()), $user->getHtmlOptions('language_id')); ?>
            <?php echo $form->error($user, 'language_id');?>
        </div>
        
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($user, 'status');?>
            <?php echo $form->dropDownList($user, 'status', $user->getStatusesArray(), $user->getHtmlOptions('status')); ?>
            <?php echo $form->error($user, 'status');?>
        </div>        

    </div>
    
    <div class="panel-footer">
        <div class="pull-right">
            <button type="submit" class="btn btn-default btn-submit" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo Yii::t('app', 'Save changes');?></button>
        </div>
        <div class="clearfix"><!-- --></div>
    </div>
    
</div>
<?php $this->endWidget(); ?>