<tmpl_if name="config_error_msg">
    <div class="alert alert-danger">
        <p>
            <tmpl_var name="configuration_error_txt">
                <div>
                    <div style="float:left;width:150px;">{tmpl_var name='config_error_tstamp'} :&nbsp;</div>
                    <div style="padding-left:150px;">{tmpl_var name='config_error_msg'}</div>
                </div>
        </p>
    </div>
</tmpl_if>
<div class="form-group">
    <label class="col-sm-3 control-label">{tmpl_var name='stats_user_txt'}</label>
    <div class="col-sm-9">
        <div class="checkbox">&nbsp; &nbsp;admin</div>
    </div>
</div>
<div class="form-group">
    <label for="stats_password" class="col-sm-3 control-label">{tmpl_var name='stats_password_txt'}</label>
    <div class="col-sm-9">
        <div class="input-group">
            <input type="password" name="stats_password" id="stats_password" value="{tmpl_var name='stats_password'}"
                class="form-control" autocomplete="off"
                onkeyup="pass_check(this.value);checkPassMatch('stats_password','repeat_password');" />
            <span class="input-group-btn">
                <button class="btn btn-default" type="button"
                    onclick="generatePassword('stats_password','repeat_password');">{tmpl_var
                    name='generate_password_txt'}</button>
            </span>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">{tmpl_var name='password_strength_txt'}</label>
    <div class="col-sm-9 checkbox">
        <div id="passBar"></div>
        <span id="passText">&nbsp;</span>
    </div>
</div>
<div class="form-group">
    <label for="repeat_password" class="col-sm-3 control-label">{tmpl_var name='repeat_password_txt'}</label>
    <div class="col-sm-9"><input type="password" name="repeat_password" id="repeat_password" value="" autocomplete="off"
            class="form-control" onkeyup="checkPassMatch('stats_password','repeat_password');" /></div>
</div>
<div class="form-group">
    <div class="col-sm-offset-3 col-sm-9">
        <div id="confirmpasswordError" style="display:none;" class="confirmpassworderror">{tmpl_var
            name='password_mismatch_txt'}</div>
        <div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}
        </div>
    </div>
</div>
<div class="form-group panel-default">
    <label for="stats_type" class="col-sm-3 control-label">{tmpl_var name='stats_type_txt'}</label>
    <div class="col-sm-9"><select name="stats_type" id="stats_type" class="form-control">
            {tmpl_var name='stats_type'}
        </select></div>
</div>
<div class="form-group goaccess">
    <div class="panel panel-default" style="margin:15px;">

    <div class="panel-heading" role="tab" id="statsdb_retention_option">
        <h4 class="panel-title">
            <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
                href="#collapse_statsdb_retention_option" aria-expanded="false"
                aria-controls="collapse_statsdb_retention_option">
                {tmpl_var name='statsdb_retention_option_txt'}
            </a>
        </h4>
    </div>
    <div id="collapse_statsdb_retention_option" class="panel-collapse collapse" style="margin-top:15px;" role="tabpanel"
        aria-labelledby="statsdb_retention_options">
        <label for="statsdb_retention" class="col-sm-3 control-label">{tmpl_var name='statsdb_retention_txt'}</label>
        <div class="col-sm-9"><input name="statsdb_retention" id="statsdb_retention"
                value="{tmpl_var name='statsdb_retention'}" type="text" class="form-control" /></div>
        <div class="panel-body">
            <div class="alert alert-info" style="margin-top:15px">
            {tmpl_var name='statsdb_retention_about_txt'}</div>
        </div>
    </div>


    <div class="panel-heading" role="tab" id="stats_anonymize_level_options">
        <h4 class="panel-title">
            <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
                href="#collapse_stats_anonymize_level_option" aria-expanded="false"
                aria-controls="collapse_stats_anonymize_level_option">
                {tmpl_var name='stats_anonymize_level_option_txt'}
            </a>
        </h4>
    </div>
    <div id="collapse_stats_anonymize_level_option" class="panel-collapse collapse" role="tabpanel"
        aria-labelledby="stats_anonymize_level">
        <div class="panel-body">
            <label for="stats_anonymize_level" class="col-sm-3 control-label">{tmpl_var
                name='stats_anonymize_level_txt'}</label>
            <div class="col-sm-9"><select name="stats_anonymize_level" id="stats_anonymize_level" class="form-control">
                    {tmpl_var name='stats_anonymize_level'}
                </select></div>
            <div class="panel-body">
                <div class="alert alert-info" style="margin-top:15px">
                {tmpl_var name='stats_anonymize_level_about_txt'}</div>
            </div>
        </div>
    </div>
</div>
</div>


<input type="hidden" name="id" value="{tmpl_var name='id'}">


<div class="right">
    <div class="col-sm-12" style="padding:0">
        <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}"
            data-submit-form="pageForm" data-form-action="sites/web_vhost_domain_edit.php">{tmpl_var
            name='btn_save_txt'}</button>
        <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}"
            data-load-content="sites/web_vhost_domain_list.php">{tmpl_var name='btn_cancel_txt'}</button>
    </div>
</div>

<div class="clear">


    <script language="JavaScript" type="text/javascript">

        var stats_type = jQuery('#stats_type').val();
        stats_settings(stats_type);
        jQuery('#stats_type').change(function () {
            stats_type = jQuery(this).val();
            stats_settings(stats_type);
        });

        function stats_settings(stats_type) {
            switch (stats_type) {
                case "goaccess":
                    jQuery('.goaccess').show();
                    break;
                default:
                    jQuery('.goaccess').hide();
                    break;
            }
        }

    </script>