<?php defined('MW_INSTALLER_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
 */
 
?>

<form action="" method="post">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Database credentials and import</h3>
        </div>
        <div class="panel-body">
            
            <div class="form-group col-lg-6">
                <label class="required">Hostname <span class="required">*</span></label>
                <input class="form-control has-help-text<?php echo $context->getError('hostname') ? ' error':'';?>" name="hostname" type="text" value="<?php echo getPost('hostname', 'localhost');?>"/>
                <?php if ($error = $context->getError('hostname')) { ?>
                <div class="errorMessage" style="display: block;"><?php echo $error;?></div>
                <?php } ?>
            </div>

            <div class="form-group col-lg-6">
                <label class="required">Username <span class="required">*</span></label>
                <input class="form-control has-help-text<?php echo $context->getError('username') ? ' error':'';?>" name="username" type="text" value="<?php echo getPost('username');?>"/>
                <?php if ($error = $context->getError('username')) { ?>
                <div class="errorMessage" style="display: block;"><?php echo $error;?></div>
                <?php } ?>
            </div>
            
            <div class="form-group col-lg-6">
                <label>Password</label>
                <input class="form-control has-help-text" name="password" type="text" value="<?php echo getPost('password');?>"/>
            </div>
            
            <div class="form-group col-lg-6">
                <label class="required">Database name <span class="required">*</span></label>
                <input class="form-control has-help-text<?php echo $context->getError('dbname') ? ' error':'';?>" name="dbname" type="text" value="<?php echo getPost('dbname');?>"/>
                <?php if ($error = $context->getError('dbname')) { ?>
                <div class="errorMessage" style="display: block;"><?php echo $error;?></div>
                <?php } ?>
            </div>
            
            <div class="form-group col-lg-6">
                <label>Tables prefix</label>
                <input class="form-control has-help-text<?php echo $context->getError('prefix') ? ' error':'';?>" name="prefix" type="text" value="<?php echo getPost('prefix', 'mw_');?>"/>
                <?php if ($error = $context->getError('prefix')) { ?>
                <div class="errorMessage" style="display: block;"><?php echo $error;?></div>
                <?php } ?>
            </div>
            
        </div>
        <div class="panel-footer">
            <div class="pull-right">
                <button type="submit" name="next" value="1" class="btn btn-default btn-submit" data-loading-text="Please wait, processing...">Start importing</button>
            </div>
            <div class="clearfix"><!-- --></div>
        </div>
    </div>
</form>