<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>

<div class="panel panel_client">

    <tmpl_if name="is_admin">
        <div class="pnl_toolsarea">
            <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
                <div class="buttons topbuttons">
                    <button class="positive iconstxt icoAdd" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="addAdditionalTemplate();"><span>{tmpl_var name='add_additional_template_txt'}</span></button>
                </div>
            </fieldset>
        </div>
    </tmpl_if>

    <div class="pnl_formsarea">
        <fieldset class="inlineLabels"><legend>Limits</legend>
            <tmpl_if name="is_admin">
                <div class="ctrlHolder">
                    <label for="template_master">{tmpl_var name='template_master_txt'}</label>
                    <select name="template_master" id="template_master" class="selectInput">
                        {tmpl_var name='template_master'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="template_additional">{tmpl_var name='template_additional_txt'}</label>
                    <select name="tpl_add_select" id="tpl_add_select" class="selectInput">
                        {tmpl_var name='tpl_add_select'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='active_template_additional_txt'}</p>
                    <div id="template_additional_list" class="multiField">
                        <ul>
                        {tmpl_var name='template_additional_list'}
                        </ul>
                    </div>
                    <input type="hidden" id="template_additional" name="template_additional" value="{tmpl_var name='template_additional'}">
                </div>
                <div class="ctrlHolder">
                    &nbsp;
                </div>
            </tmpl_if>
            <div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></div>
            <div>
                <div class="ctrlHolder">
                    <label for="default_webserver">{tmpl_var name='default_webserver_txt'}</label>
                    <select name="default_webserver" id="default_webserver" class="selectInput">
                        {tmpl_var name='default_webserver'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_web_domain">{tmpl_var name='limit_web_domain_txt'}</label>
                    <input name="limit_web_domain" id="limit_web_domain" value="{tmpl_var name='limit_web_domain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_web_quota">{tmpl_var name='limit_web_quota_txt'}</label>
                    <input name="limit_web_quota" id="limit_web_quota" value="{tmpl_var name='limit_web_quota'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />&nbsp;MB
                </div>
                <div class="ctrlHolder">
                    <label for="limit_traffic_quota">{tmpl_var name='limit_traffic_quota_txt'}</label>
                    <input name="limit_traffic_quota" id="limit_traffic_quota" value="{tmpl_var name='limit_traffic_quota'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />&nbsp;MB
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='web_php_options_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='web_php_options'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_cgi_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_cgi'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_ssi_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_ssi'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_perl_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_perl'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_ruby_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_ruby'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_python_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_python'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='force_suexec_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='force_suexec'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_hterror_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_hterror'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_wildcard_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_wildcard'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='limit_ssl_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='limit_ssl'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_web_aliasdomain">{tmpl_var name='limit_web_aliasdomain_txt'}</label>
                    <input name="limit_web_aliasdomain" id="limit_web_aliasdomain" value="{tmpl_var name='limit_web_aliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_web_subdomain">{tmpl_var name='limit_web_subdomain_txt'}</label>
                    <input name="limit_web_subdomain" id="limit_web_subdomain" value="{tmpl_var name='limit_web_subdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_ftp_user">{tmpl_var name='limit_ftp_user_txt'}</label>
                    <input name="limit_ftp_user" id="limit_ftp_user" value="{tmpl_var name='limit_ftp_user'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_shell_user">{tmpl_var name='limit_shell_user_txt'}</label>
                    <input name="limit_shell_user" id="limit_shell_user" value="{tmpl_var name='limit_shell_user'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='ssh_chroot_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='ssh_chroot'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_webdav_user">{tmpl_var name='limit_webdav_user_txt'}</label>
                    <input name="limit_webdav_user" id="limit_webdav_user" value="{tmpl_var name='limit_webdav_user'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
            <div class="subsectiontoggle"><span></span>{tmpl_var name='email_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="default_mailserver">{tmpl_var name='default_mailserver_txt'}</label>
                    <select name="default_mailserver" id="default_mailserver" class="selectInput">
                        {tmpl_var name='default_mailserver'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_maildomain">{tmpl_var name='limit_maildomain_txt'}</label>
                    <input name="limit_maildomain" id="limit_maildomain" value="{tmpl_var name='limit_maildomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailbox">{tmpl_var name='limit_mailbox_txt'}</label>
                    <input name="limit_mailbox" id="limit_mailbox" value="{tmpl_var name='limit_mailbox'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailalias">{tmpl_var name='limit_mailalias_txt'}</label>
                    <input name="limit_mailalias" id="limit_mailalias" value="{tmpl_var name='limit_mailalias'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailaliasdomain">{tmpl_var name='limit_mailaliasdomain_txt'}</label>
                    <input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailmailinglist">{tmpl_var name='limit_mailmailinglist_txt'}</label>
                    <input name="limit_mailmailinglist" id="limit_mailmailinglist" value="{tmpl_var name='limit_mailmailinglist'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label>
                    <input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailcatchall">{tmpl_var name='limit_mailcatchall_txt'}</label>
                    <input name="limit_mailcatchall" id="limit_mailcatchall" value="{tmpl_var name='limit_mailcatchall'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailrouting">{tmpl_var name='limit_mailrouting_txt'}</label>
                    <input name="limit_mailrouting" id="limit_mailrouting" value="{tmpl_var name='limit_mailrouting'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailfilter">{tmpl_var name='limit_mailfilter_txt'}</label>
                    <input name="limit_mailfilter" id="limit_mailfilter" value="{tmpl_var name='limit_mailfilter'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_fetchmail">{tmpl_var name='limit_fetchmail_txt'}</label>
                    <input name="limit_fetchmail" id="limit_fetchmail" value="{tmpl_var name='limit_fetchmail'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_mailquota">{tmpl_var name='limit_mailquota_txt'}</label>
                    <input name="limit_mailquota" id="limit_mailquota" value="{tmpl_var name='limit_mailquota'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />&nbsp;MB
                </div>
                <div class="ctrlHolder">
                    <label for="limit_spamfilter_wblist">{tmpl_var name='limit_spamfilter_wblist_txt'}</label>
                    <input name="limit_spamfilter_wblist" id="limit_spamfilter_wblist" value="{tmpl_var name='limit_spamfilter_wblist'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_spamfilter_user">{tmpl_var name='limit_spamfilter_user_txt'}</label>
                    <input name="limit_spamfilter_user" id="limit_spamfilter_user" value="{tmpl_var name='limit_spamfilter_user'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_spamfilter_policy">{tmpl_var name='limit_spamfilter_policy_txt'}</label>
                    <input name="limit_spamfilter_policy" id="limit_spamfilter_policy" value="{tmpl_var name='limit_spamfilter_policy'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
            <div class="subsectiontoggle"><span></span>{tmpl_var name='database_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="default_dbserver">{tmpl_var name='default_dbserver_txt'}</label>
                    <select name="default_dbserver" id="default_dbserver" class="selectInput">
                        {tmpl_var name='default_dbserver'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_database">{tmpl_var name='limit_database_txt'}</label>
                    <input name="limit_database" id="limit_database" value="{tmpl_var name='limit_database'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
            <div class="subsectiontoggle"><span></span>{tmpl_var name='cron_job_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="limit_cron">{tmpl_var name='limit_cron_txt'}</label>
                    <input name="limit_cron" id="limit_cron" value="{tmpl_var name='limit_cron'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_cron_type">{tmpl_var name='limit_cron_type_txt'}</label>
                    <select name="limit_cron_type" id="limit_cron_type" class="selectInput formLengthHalf">
                        {tmpl_var name='limit_cron_type'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_cron_frequency">{tmpl_var name='limit_cron_frequency_txt'}</label>
                    <input name="limit_cron_frequency" id="limit_cron_frequency" value="{tmpl_var name='limit_cron_frequency'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
            <div class="subsectiontoggle"><span></span>{tmpl_var name='dns_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="default_dnsserver">{tmpl_var name='default_dnsserver_txt'}</label>
                    <select name="default_dnsserver" id="default_dnsserver" class="selectInput">
                        {tmpl_var name='default_dnsserver'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_dns_zone">{tmpl_var name='limit_dns_zone_txt'}</label>
                    <input name="limit_dns_zone" id="limit_dns_zone" value="{tmpl_var name='limit_dns_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
				<div class="ctrlHolder">
                    <label for="default_slave_dnsserver">{tmpl_var name='default_slave_dnsserver_txt'}</label>
                    <select name="default_slave_dnsserver" id="default_slave_dnsserver" class="selectInput">
                        {tmpl_var name='default_slave_dnsserver'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="limit_dns_slave_zone">{tmpl_var name='limit_dns_slave_zone_txt'}</label>
                    <input name="limit_dns_slave_zone" id="limit_dns_slave_zone" value="{tmpl_var name='limit_dns_slave_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_dns_record">{tmpl_var name='limit_dns_record_txt'}</label>
                    <input name="limit_dns_record" id="limit_dns_record" value="{tmpl_var name='limit_dns_record'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
            <div class="subsectiontoggle"><span></span>{tmpl_var name='virtualization_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="limit_openvz_vm">{tmpl_var name='limit_openvz_vm_txt'}</label>
                    <input name="limit_openvz_vm" id="limit_openvz_vm" value="{tmpl_var name='limit_openvz_vm'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
                <div class="ctrlHolder">
                    <label for="limit_openvz_vm_template_id">{tmpl_var name='limit_openvz_vm_template_id_txt'}</label>
                    <select name="limit_openvz_vm_template_id" id="limit_openvz_vm_template_id" class="selectInput">
                        {tmpl_var name='limit_openvz_vm_template_id'}
                    </select>
                </div>
            </div>
			<div class="subsectiontoggle"><span></span>{tmpl_var name='aps_limits_txt'}<em></em></div>
            <div style="display:none;">
                <div class="ctrlHolder">
                    <label for="limit_aps">{tmpl_var name='limit_aps_txt'}</label>
                    <input name="limit_aps" id="limit_aps" value="{tmpl_var name='limit_aps'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
                </div>
            </div>
        </fieldset>

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

        <div class="buttonHolder buttons">
            <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','client/client_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('client/client_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>

</div>
<tmpl_if name="is_admin">
<script type="text/javascript">
<!--
function custom_template_selected() {
    return ($('#template_master').val() == '0' ? true : false);
}

jQuery('#template_additional_list').find('li > a').click(function(e) {
    e.preventDefault();
    delAdditionalTemplate($(this).parent().attr('rel'));
});

jQuery('div.panel_client')
        .find('div.pnl_formsarea')
        .find('fieldset')
        .find('input,select,button')
        .not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver')
        .click(function(e) {
            if(custom_template_selected()) return true;
            e.preventDefault();
            alert('{tmpl_var name="err_msg_master_tpl_set"}');
        })
        .focus(function() {
            if(custom_template_selected()) return true;
            $(this).blur();
        });

//-->
</script>
</tmpl_if>