<?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 
$this->renderPartial('_confirm-form');
$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-send"></span> <?php echo $pageHeading;?></h3>
        </div>
        <div class="pull-right">
            <?php echo CHtml::link(Yii::t('app', 'Cancel'), array('delivery_servers/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-3">
            <?php echo $form->labelEx($server, 'hostname');?>
            <?php echo $form->textField($server, 'hostname', $server->getHtmlOptions('hostname')); ?>
            <?php echo $form->error($server, 'hostname');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'username');?>
            <?php echo $form->textField($server, 'username', $server->getHtmlOptions('username')); ?>
            <?php echo $form->error($server, 'username');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'password');?>
            <?php echo $form->textField($server, 'password', $server->getHtmlOptions('password', array('value' => ''))); ?>
            <?php echo $form->error($server, 'password');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'port');?>
            <?php echo $form->textField($server, 'port', $server->getHtmlOptions('port')); ?>
            <?php echo $form->error($server, 'port');?>
        </div>

        <div class="clearfix"><!-- --></div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'protocol');?>
            <?php echo $form->dropDownList($server, 'protocol', $server->getProtocolsArray(), $server->getHtmlOptions('protocol')); ?>
            <?php echo $form->error($server, 'protocol');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'timeout');?>
            <?php echo $form->textField($server, 'timeout', $server->getHtmlOptions('timeout')); ?>
            <?php echo $form->error($server, 'timeout');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'probability');?>
            <?php echo $form->dropDownList($server, 'probability', $server->getProbabilityArray(), $server->getHtmlOptions('probability', array('data-placement' => 'left'))); ?>
            <?php echo $form->error($server, 'probability');?>
        </div>
        
        <div class="form-group col-lg-3">
            <?php echo $form->labelEx($server, 'hourly_quota');?>
            <?php echo $form->textField($server, 'hourly_quota', $server->getHtmlOptions('hourly_quota')); ?>
            <?php echo $form->error($server, 'hourly_quota');?>
        </div>
        
        <div class="clearfix"><!-- --></div>
        
        <div class="form-group col-lg-6">
            <?php echo $form->labelEx($server, 'bounce_server_id');?>
            <?php echo $form->dropDownList($server, 'bounce_server_id', $server->getBounceServersArray(), $server->getHtmlOptions('bounce_server_id')); ?>
            <?php echo $form->error($server, 'bounce_server_id');?>
        </div>
        
        <div class="form-group col-lg-3 custom-from-header">
            <?php echo $form->labelEx($server, 'custom_from_header');?>
            <?php echo $form->dropDownList($server, 'custom_from_header', $server->getCustomFromHeaderOptions(), $server->getHtmlOptions('custom_from_header')); ?>
            <?php echo $form->error($server, 'custom_from_header');?>
        </div>
            
        <div class="form-group col-lg-3 custom-from-header-test-email">
            <?php echo $form->labelEx($server, 'custom_from_header_test_email');?>
            <?php echo $form->textField($server, 'custom_from_header_test_email', $server->getHtmlOptions('custom_from_header_test_email')); ?>
            <?php echo $form->error($server, 'custom_from_header_test_email');?>
        </div>
        
        <div class="clearfix"><!-- --></div>
        
        <?php $this->renderPartial('_additional-headers');?>
                                                
    </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(); ?>