{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<P align="CENTER">
<FORM method="POST" action="?m=domainedit&id={$domain.id}" name="domain">
<INPUT type="submit" class="hiddenbtn">
<TABLE class="lmsbox">
    <THEAD>
	<TR>
		<TD width="1%">
			<img src="img/domain.gif" alt="">
		</TD>
		<TD width="1%">
			<B>{trans("Name:")}</B>
		</TD>
		<TD width="98%">
			<input name="domain[name]" value="{$domain.name}" size="30" readonly="readonly" required {tip text="Enter domain name" trigger="name" bold="1"}>
		</TD>
	</TR>
    </THEAD>
    <TBODY>
	<TR>
    		<TD width="1%">
            		<img src="img/customer.gif" alt="">
	        </TD>
		<TD width="1%">
			<B>{trans("Owner:")}</B>
		</TD>
		<TD width="98%"class="fright">
			<SELECT SIZE="1" NAME="domain[ownerid]" {tip text="Select owner or 'SYSTEM DOMAIN' if you don't want to assign it to any customer" trigger="ownerid"}>
				<OPTION VALUE="0"{if !$domain.ownerid} SELECTED{/if}>{trans("SYSTEM DOMAIN")}</OPTION>
				{foreach from=$customers item=customer}
					<OPTION VALUE="{$customer.id}"{if $domain.ownerid == $customer.id} SELECTED{/if}>{$customer.customername|truncate:40:"&hellip;":true} ({$customer.id|string_format:"%04d"})</OPTION>
				{/foreach}
			</SELECT>
		</TD>
	</TR>
        <TR>
                <TD width="1%"><img src="img/dns.gif" alt=""></TD>
                <TD width="1%" nowrap><B>{trans("Type:")}</B></TD>
                <TD width="98%">
            		<SELECT SIZE="1" NAME="domain[type]"{tip text="Select domain type" trigger="type"} id="domain[type]" style="float: left;" onchange="if (this.value=='SLAVE') document.getElementById('ipmaster').style.display='block'; else document.getElementById('ipmaster').style.display='none';">
                    		<OPTION VALUE="NATIVE" {if $domain.type == NATIVE} SELECTED{/if}>NATIVE</OPTION>
                                <OPTION VALUE="MASTER" {if $domain.type == MASTER} SELECTED{/if}>MASTER</OPTION>
                                <OPTION VALUE="SLAVE" {if $domain.type == SLAVE} SELECTED{/if}>SLAVE</OPTION>
            		</SELECT>
			<div id="ipmaster" style="display: none; float:left; margin-left:10px;">
		        {trans("IP address of master NS:")}
			<input type="text" name="domain[master]" value="{$domain.master}" {tip text="Enter IP address of master NS" trigger="master" bold="1"}>
			</div>
			<script type="text/javascript">
			if (document.getElementById('domain[type]').value=='SLAVE')
				document.getElementById('ipmaster').style.display='block';
			</script>
                </TD>
        </TR>
	<TR>
		<TD width="1%">
			<img src="img/mail.gif" alt="">
		</TD>
		<TD width="1%" nowrap>
			<B>{trans("Backup MX support:")}</B>
		</TD>
		<TD width="98%">
			<INPUT type="checkbox" name="domain[mxbackup]" value="1"{if $domain.mxbackup} checked{/if}>
		</TD>
	</TR>
	<TR>
		<TD width="1%">
			<img src="img/info.gif" alt="">
		</TD>
		<TD width="1%" nowrap>
		        <B>{trans("Description:")}</B>
		</TD>
		<TD width="98%">
			<TEXTAREA name="domain[description]" rows="5" cols="50" {tip text="Enter additional information (optional)"}>{$domain.description}</TEXTAREA>
	        </TD>
	</TR>
	<TR>
		<TD align="right" colspan="3">
			<A href="javascript:document.domain.submit();" accesskey="s">{trans("Submit")} <img src="img/save.gif" alt=""></A>
			<A href="?m=domainlist">{trans("Cancel")} <img src="img/cancel.gif" alt=""></A>
		</TD>
	</TR>
    </TBODY>
</TABLE>
</P>
<SCRIPT type="text/javascript">
<!--
$(function() {
	$('form[name="domain"] [name="domain[name]"]').focus();
});
//-->
</SCRIPT>
{/block}
