{include file="$admin_nl_gentemplates/admin_nl_site_head.tpl"}
<div style="border:0px;">
<div style="overflow:hidden;">
        <div class="panel_section" style="width: 100%;">
        	<div class="panel_content" style="width: 97%;margin-top: 15px;">			
<br><FORM onSubmit="return CheckForm()" name="myform" id="myform" action="change.php?id={$users[0].ID}" method="post" style="margin:0px">
<input type="hidden" name="action" value="change">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
	
		<div class="fl newletter_form">
			<font color="red">*</font> {$lang.newsletter.users.first_name}:&nbsp;
		</div>
		<div class="fl">
			<input type="text" name="firstname" value="{$users[0].FIRSTNAME}" class="inpBox" style="width:200px" maxlength="50">
			&nbsp;
			<A onmouseover="doTooltip(event,22)" onmouseout="hideTip()" href="#">
				<IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle">
			</A>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">
			<font color="red">*</font> {$lang.newsletter.users.second_name}:&nbsp;
		</div>
		<div class="fl">
			<input type="text" name="secondname" value="{$users[0].SECONDNAME}" class="inpBox" style="width:200px" maxlength="50">&nbsp;
			<A onmouseover="doTooltip(event,23)" onmouseout="hideTip()" href="#">
				<IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle">
			</A>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">
			<font color="red">*</font> {$lang.newsletter.users.email}:&nbsp;</div>
		<div class="fl"><input type="text" name="email1" value="{$users[0].EMAIL1}" class="inpBox" style="width:200px" maxlength="50">
		&nbsp;<A onmouseover="doTooltip(event,24)" onmouseout="hideTip()" href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">{$lang.newsletter.users.company}:&nbsp;</div>
		<div class="fl"><input type="text" name="company" value="{$users[0].COMPANY}" class="inpBox" style="width:200px" maxlength="50">
		&nbsp;<A onmouseover="doTooltip(event,25)" onmouseout="hideTip()" href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">{$lang.newsletter.users.comment}:&nbsp;</div>
		<div class="fl"><input type="text" name="comment" value="{$users[0].COMMENT}" class="inpBox" style="width:200px" maxlength="50">
		&nbsp;<A onmouseover="doTooltip(event,26)" onmouseout="hideTip()" href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">{$lang.newsletter.users.status}:&nbsp;</div>
		<div class="fl">
			<select name="status" class="inpBox" tabindex="6">
			<option value="1" {if $users[0].STATUS == 1} selected {/if}>{$lang.newsletter.users.active}</option>
			<option value="0" {if $users[0].STATUS == 0} selected {/if}>{$lang.newsletter.users.inactive}</option>
			</select>
		</div>
		<div class="cr">&nbsp;</div>
		
		<div class="fl newletter_form">{$lang.newsletter.users.lists}:&nbsp;
			<A onmouseover="doTooltip(event,27)" onmouseout="hideTip()" href="#">
				<IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle">
			</A>&nbsp;
			</div>
		<div class="fl">
			<table>

			{section name=k loop=$lists}
			<tr>
			<td class="main_content_text">
				<input type="hidden"   name="list[{$lists[k].id}]" value="0">
				<input type="checkbox" name="list[{$lists[k].id}]" value="{$lists[k].id}" 
				{section name=j loop=$users[0].LIST}
					{if ($lists[k].id == $users[0].LISTID[j] and $users[0].STATUS_SUBSCRIBE[j] != $config.status_subscribe_val.unsubscribe)} checked {/if}
				{/section}
				  onClick="SetStatus({$lists[k].id})" id="checkbox_{$lists[k].id}">
				{$lists[k].name} ({$lists[k].count} subscribers)
			</td>
			<td class="main_content_text"> Status:  
				<select name="status_subscribe[{$lists[k].id}]" id="status_subscribe_{$lists[k].id}">
					{section name=g loop=$status_subscribe_values}		
					<option value="{$status_subscribe_values[g]}"
					{section name=j loop=$users[0].LIST}
						{if $lists[k].id == $users[0].LISTID[j]}
						   {if $users[0].STATUS_SUBSCRIBE[j] == $status_subscribe_values[g]} selected {/if}	
						{/if}
					{/section}
					>{$status_subscribe_output[g]}</option>	
				{/section}
				</select> 
				{section name=j loop=$users[0].DATE_STATUS}
					{if $lists[k].id == $users[0].LISTID[j]}
					   Date of setting this status: {$users[0].DATE_STATUS[j]|date_format:"%b %d, %Y"} 
					{/if}
				{/section}
				&nbsp;<A onmouseover="doTooltip(event,28)" onmouseout="hideTip()" href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
			</td></tr>
			{/section}
			</table>
		</div>
	</form>
</div>
</div>
<div>
<table>
	<tr height="40">
		<td>
			<a style="float:left;"  class="admin_button_major" onclick="javascript:if(CheckForm())document.myform.submit();">{$lang.newsletter.button.save}<span>&nbsp;</span></a>
			<!--<input type="button" value="{$lang.newsletter.button.save}" class="button" onclick="javascript:if(CheckForm())document.myform.submit();">-->
			<a style="float: left; margin-top: 12px; margin-left: 10px;" onclick='{literal}if(confirm("Are you sure?")) { document.location.href="index.php" }{/literal}'>{$lang.newsletter.button.cancel}<span>&nbsp;</span></a>
			<!--<input type="button" value="{$lang.newsletter.button.cancel}" class="button" onClick='{literal}if(confirm("Are you sure?")) { document.location.href="index.php" }{/literal}'>-->
		</td>
	</tr>
</table>
</div>
</div>
</div>
{literal}
                <script language="JavaScript">
                    function CheckForm(){
                        var f = document.forms[0];

                        if(f.firstname.value == ""){
                            alert("{/literal}{$lang.newsletter.users.enter_firstname|escape:javascript}{literal}");
                            f.firstname.focus();
                            return false;
                        }

                        if(f.secondname.value == ""){
                            alert("{/literal}{$lang.newsletter.users.enter_secondname|escape:javascript}{literal}");
                            f.secondname.focus();
                            return false;
                        }

                        if(f.email1.value == ""){
                            alert("{/literal}{$lang.newsletter.users.enter_email|escape:javascript}{literal}");
                            f.email1.focus();
                            return false;
                        }

                        return true;
                    }
					
					function SetStatus(c) {
					    var status = document.myform.elements['status_subscribe_' + c];
						var checkbox = document.myform.elements['checkbox_' + c];
						if (checkbox.checked) status.selectedIndex = 1;
						else status.selectedIndex = 0;
					}
                </script>

{/literal}

{include file="$admin_nl_gentemplates/admin_nl_site_foot.tpl"}
