<form method="post" action="{$smarty.server.PHP_SELF}?action=bulkdomain">
<input type="hidden" name="update" value="{$update}">
<input type="hidden" name="save" value="1">
{foreach from=$domainids item=domainid}
<input type="hidden" name="domids[]" value="{$domainid}" />
{/foreach}

{if $update eq "nameservers"}

		<div class="bigheader">
			<h2>{$LANG.domainmanagens}</h2>
		</div><!-- .bigheader -->

{if $save}
    {if $errors}
        {foreach from=$errors item=error}
			<div class="notice notice-error">
				<div class="inside">
					<p>{$error}</p>
				</div>
			</div>
        {/foreach}
    {else}
			<div class="notice notice-success">
				<div class="inside">
					<p>{$LANG.changessavedsuccessfully}</p>
				</div>
			</div>
    {/if}
{/if}

<p>{$LANG.domainbulkmanagementchangesaffect}</p>

<ul class="checklist">
{foreach from=$domains item=domain}
<li>{$domain}</li>
{/foreach}
</ul>

{literal}<script language="javascript">
function usedefaultns() {
    jQuery(".domnsinputs").attr("disabled", true);
}
function usecustomns() {
    jQuery(".domnsinputs").removeAttr("disabled");
}
</script>{/literal}

	<div class="feildset">
		
			<div class="col1">
			
				<div>
					<label>
						<input type="radio" name="nschoice" value="default" id="nschoicedefault" onclick="usedefaultns()" checked /> <label for="nschoicedefault">{$LANG.nschoicedefault}</label>
					</label>
				</div>
				
				<div>
					<label>
						<input type="radio" name="nschoice" value="custom" id="nschoicecustom" onclick="usecustomns()" checked /> <label for="nschoicecustom">{$LANG.nschoicecustom}</label>
					</label>
				</div>		
			
			</div>
			
	</div>


		<div class="feildset">
		
			<div class="col1">
		
				<div>
					<label>
						<span>{$LANG.domainnameserver1}:</span>
						<input type="text" name="ns1" value="{$ns1}" class="domnsinputs" placeholder="{$LANG.domains_nameserver1}" />
					</label>
				</div>
				
				<div>
					<label>
						<span>{$LANG.domainnameserver2}:</span>
						<input type="text" name="ns2" value="{$ns2}" class="domnsinputs" placeholder="{$LANG.domains_nameserver2}" />
					</label>
				</div>
				
				<div>
					<label>
						<span>{$LANG.domainnameserver3}:</span>
						<input type="text" name="ns3" value="{$ns3}" class="domnsinputs" placeholder="{$LANG.domains_nameserver3}" />
					</label>
				</div>								
				
				<div>
					<label>
						<span>{$LANG.domainnameserver4}:</span>
						<input type="text" name="ns4" value="{$ns4}" size="40" class="domnsinputs" placeholder="{$LANG.domains_nameserver4}" />
					</label>
				</div>
				
				
				<div>
					<label>
						<span>{$LANG.domainnameserver5}:</span>
						<input type="text" name="ns5" value="{$ns5}" size="40" class="domnsinputs" placeholder="{$LANG.domains_nameserver5}" />
					</label>
				</div>				
				
			  
			  </div>
		
		</div>

<p class="center"><input type="submit" value="{$LANG.clientareasavechanges}" class="button1 color1" /></p>

{elseif $update eq "autorenew"}

		<div class="bigheader">
			<h2>{$LANG.domainautorenewstatus}</h2>
		</div><!-- .bigheader -->

{if $save}
			<div class="notice notice-success">
				<div class="inside">
					<p>{$LANG.changessavedsuccessfully}</p>
				</div>
			</div>
{/if}

<p>{$LANG.domainautorenewinfo}</p>

<p>{$LANG.domainautorenewrecommend}</p>

<p>{$LANG.domainbulkmanagementaffect}</p>

<ul class="checklist">
{foreach from=$domains item=domain}
<li>{$domain}</li>
{/foreach}
</ul>

<p class="center">
<input type="submit" name="enable" value="{$LANG.domainsautorenewenable}" class="buttongo button1 color2" />
<input type="submit" name="disable" value="{$LANG.domainsautorenewdisable}" class="buttonwarn button1 color1" />
</p>

{elseif $update eq "reglock"}

		<div class="bigheader">
			<h2>{$LANG.domainreglockstatus}</h2>
		</div><!-- .bigheader -->

{if $save}
    {if $errors}   
    
        {foreach from=$errors item=error}
        
        <div class="notice notice-error">
				<div class="inside">
           		 {$error}
            	</div>
        	</div>
        {/foreach}		
        
    {else}
    
        <div class="notice notice-success">
				<div class="inside">
           		 {$LANG.changessavedsuccessfully}
            	</div>
        	</div>
    {/if}
{/if}

<p>{$LANG.domainreglockinfo}</p>

<p>{$LANG.domainreglockrecommend}</p>

<p>{$LANG.domainbulkmanagementaffect}</p>

<ul class="checklist">
{foreach from=$domains item=domain}
<li>{$domain}</li>
{/foreach}
</ul>

<p class="center">
<input type="submit" name="enable" value="{$LANG.domainreglockenable}" class="buttongo button1 color1" /> <input type="submit" name="disable" value="{$LANG.domainreglockdisable}" class="buttonwarn button1 color2" />
</p>

{elseif $update eq "contactinfo"}

		<div class="bigheader">
			<h2>{$LANG.domaincontactinfoedit}</h2>
		</div><!-- .bigheader -->

{if $save}
    {if $errors}
    
    {foreach from=$errors item=error}
    
        <div class="notice notice-error">
				<div class="inside">
           		 {$error}
            	</div>
        	</div>    
    
    {/foreach}
        
    {else}
    
        <div class="notice notice-success">
				<div class="inside">
           		 {$LANG.changessavedsuccessfully}
            	</div>
        	</div>     
    
    {/if}
{/if}

{literal}
<script language="javascript">
function usedefaultwhois(id) {
	jQuery("."+id.substr(0,id.length-1)+"customwhois").attr("disabled", true);
	jQuery("."+id.substr(0,id.length-1)+"defaultwhois").attr("disabled", false);
	jQuery('#'+id.substr(0,id.length-1)+'1').attr("checked", "checked");
}
function usecustomwhois(id) {
	jQuery("."+id.substr(0,id.length-1)+"customwhois").attr("disabled", false);
	jQuery("."+id.substr(0,id.length-1)+"defaultwhois").attr("disabled", true);
	jQuery('#'+id.substr(0,id.length-1)+'2').attr("checked", "checked");
}
</script>
{/literal}

<p>{$LANG.domainbulkmanagementchangesaffect}</p>

<ul class="checklist">
{foreach from=$domains item=domain}
<li>{$domain}</li>
{/foreach}
</ul>

{foreach from=$contactdetails name=contactdetails key=contactdetail item=values}

<p><strong><a name="{$contactdetail}"></a>{$contactdetail}</strong>


{if $smarty.foreach.contactdetails.first}{foreach from=$contactdetails name=contactsx key=contactdetailx item=valuesx}{if !$smarty.foreach.contactsx.first} - <a href="clientarea.php?action=bulkdomain#{$contactdetailx}">{$LANG.jumpto} {$contactdetailx}</a>{/if}{/foreach}{else} - <a href="clientarea.php?action=bulkdomain#">{$LANG.top}</a>{/if}</p>

<p><input type="radio" name="wc[{$contactdetail}]" id="{$contactdetail}1" value="contact" onclick="usedefaultwhois(id)" /> <label for="{$contactdetail}1">{$LANG.domaincontactusexisting}</label></p>
    <table id="{$contactdetail}defaultwhois">
      <tr>
        <td width="150" align="right">{$LANG.domaincontactchoose}</td>
        <td><select class="{$contactdetail}defaultwhois" name="sel[{$contactdetail}]" id="{$contactdetail}3" onclick="usedefaultwhois(id)">
            <option value="u{$clientsdetails.userid}">{$LANG.domaincontactprimary}</option>
            {foreach key=num item=contact from=$contacts}
            <option value="c{$contact.id}">{$contact.name}</option>
            {/foreach}
          </select></td>
      </tr>
  </table>
<p><input type="radio" name="wc[{$contactdetail}]" id="{$contactdetail}2" value="custom" onclick="usecustomwhois(id)" checked /> <label for="{$contactdetail}2">{$LANG.domaincontactusecustom}</label></p>

<table width="100%">
{foreach key=name item=value from=$values}
<tr><td width="150" align="right">{$name}</td><td><input type="text" name="contactdetails[{$contactdetail}][{$name}]" value="{$value}" size="30" class="{$contactdetail}customwhois" /></td></tr>
{/foreach}
</table>

{foreachelse}


        <div class="notice notice-error">
				<div class="inside">
           		 {$LANG.domainbulkmanagementnotpossible}
            	</div>
        	</div>   

{/foreach}

<p class="center"><input type="submit" value="{$LANG.clientareasavechanges}" class="buttonwarn button1 color1" /></p>

{/if}

</form>