{include file="$admin_nl_gentemplates/admin_nl_site_head.tpl"}
<form name="ArchiveForm" action="index.php" enctype="application/x-www-form-urlencoded" method="post" style="margin:0px">
<div class="user_operation_line">
		<div class="uol_item" onclick="javascript: location.href='index.php'">
            <div class="uol_in_item">{$lang.newsletter.archives.gen_stats}</div>
        </div>        
		<div class="uol_item" onclick="javascript: location.href='sent_newsletters.php'">
            <div class="uol_in_item">{$lang.newsletter.archives.sent_newsletters}</div>
        </div>        

</div>
<div class="cr"></div>
<br/><br/><br/><br/>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{if $amount > 0}
<table cellpadding="2" cellspacing="2" width="100%" border="0"><tr>
<td align="left">{$lang.newsletter.archives.on_page}: <select name="archive_page" style="width:auto" onChange="document.location='sent_newsletters.php?archive_page=' + document.ArchiveForm.archive_page.value">
   {html_options values=$archive_page_values selected=$archive_page output=$archive_page_output}
	</select>
</td>
<td align="center" width="50%">{$navigation}</td>
<td align="right">{$lang.newsletter.archives.total_sent}: {$amount}</td>
</tr>
</table>
<div style="width:10px;" class="fl">&nbsp;</div>
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	<tr class="table_header">
		<td width=5% align="left" align=center>&nbsp;&nbsp;<a href="sent_newsletters.php?order=priority" title='{$lang.newsletter.archives.sort_by_priority}'><img src="{$site_root}{$template_root}/images/newsletter/unsent_high.gif" border="0" height="15" align="absmiddle"></a>{if $order == "priority" and $end == ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_up.gif" border="0" height="8"> {elseif $order == "priority" and $end <> ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_down.gif" border="0" height="8">{/if}</td>					
		<td width="4%" align=center><a href="sent_newsletters.php?order=is_attach" title='{$lang.newsletter.archives.sort_by_attach}'><img src="{$site_root}{$template_root}/images/newsletter/attach.gif" border="0"></a>{if $order == "is_attach" and $end == ""} <img src="{$site_root}{$template_root}/images/arrow_up.gif" border="0" height="8"> {elseif $order == "is_attach" and $end <> ""} <img src="{$site_root}{$template_root}/images/arrow_down.gif" border="0" height="8">{/if}</td>
		<td width=15% align=center>
			<a href="sent_newsletters.php?order=date&archive_page={$archive_page}">{$lang.newsletter.archives.date}</a>{if $order == "date" and $end == ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_up.gif" border="0" height="8"> {elseif $order == "date" and $end <> ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_down.gif" border="0" height="8">{/if}
		</td>
		<td width=40% align=center>
			<a href="sent_newsletters.php?order=subject&archive_page={$archive_page}">{$lang.newsletter.archives.subject}{if $order == "subject" and $end == ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_up.gif" border="0" height="8"> {elseif $order == "subject" and $end <> ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_down.gif" border="0" height="8">{/if}
		</td>
		<td width=10% align=center>
			<a href="sent_newsletters.php?order=format&archive_page={$archive_page}">{$lang.newsletter.archives.format}{if $order == "format" and $end == ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_up.gif" border="0" height="8"> {elseif $order == "format" and $end <> ""} <img src="{$site_root}{$template_root}/images/newsletter/arrow_down.gif" border="0" height="8">{/if}
		</td>
		<td width=15% align=center>{$lang.newsletter.archives.recepients}</td>
</tr>
            

{section name=c loop=$rel}
<tr {if $smarty.section.c.index mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
	<td align="left">&nbsp;
		{if $rel[c].priority}
		<img 
		{if $rel[c].priority == 1} src="{$site_root}{$template_root}/images/newsletter/sent_high.gif" 
		{elseif $rel[c].priority == 3} src="{$site_root}{$template_root}/images/newsletter/sent_mail.gif"
		{elseif $rel[c].priority == 5} src="{$site_root}{$template_root}/images/newsletter/sent_low.gif"
		{/if}
		>{/if}
	</td>
	<td align=center>{if $rel[c].is_attach == 1}<img src="{$site_root}{$template_root}/images/newsletter/attach.gif" border="0">{/if}</td>
	<td align=center>{$rel[c].date}</td>
	<td align=center>{$rel[c].subject}</td>                                              
	<td align=center>{$rel[c].format}</td>                                              						
	<td align=center>
		{if $rel[c].get > 0 }
		<div class="block_action fr" style="display: none;">
			<div class="action_edit" style="display: block;">
				<img width="16" alt="" src="{$site_root}{$template_root}/images/admin_marketing_view1.gif" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.statistic}');return false" onclick="window.open('get.php?id={$rel[c].id}&date={$rel[c].date}')">
			</div>
		</div>
		{*<input type="button" value="{$lang.newsletter.archives.sent}: {$rel[c].get} {$lang.newsletter.archives.subscribers}" class="button" onClick="window.open('get.php?id={$rel[c].id}&date={$rel[c].date}','','scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,width=750,height=420')">*}
		{/if}
		{if $rel[c].status == 2} 
		<div style="font-size: 2px">&nbsp;</div>
		<input type="button" value="{$lang.newsletter.archives.left}: {$rel[c].left} {$lang.newsletter.archives.subscribers}" class="button" onClick="window.open('get.php?id={$rel[c].id}&date={$rel[c].date}&status=0','','scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,width=750,height=420')">
		{/if}
		{if $rel[c].error ne 0}
		<div style="font-size: 2px">&nbsp;</div>
		<input type="button" value="{$lang.newsletter.archives.error}: {$rel[c].error} {$lang.newsletter.archives.subscribers}" class="button" onClick="window.open('get.php?id={$rel[c].id}&date={$rel[c].date}&status=2','','scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,width=750,height=420')">
		{/if}
		{if $rel[c].get <= 0 }
		{$rel[c].get}
		{/if}
	</td>
</tr>
{sectionelse}
	<tr height="40">
		<td class="main_error_text" bgcolor="#FFFFFF" align="left" colspan="6">{$lang.interests_spr.empty}</td>
	</tr>
{/section}
<tr class="table_header"><td colspan="6">&nbsp;</td></tr>
</table>
<div style="width:10px;" class="fl">&nbsp;</div>
<table cellpadding="2" cellspacing="2" width="100%" border="0"><tr>
<!--<td align="left">{$lang.newsletter.archives.on_page}: 
	<select name="archive_page1" style="width:auto" onChange="document.location='sent_newsletters.php?archive_page=' + document.ArchiveForm.archive_page.value">
   {html_options values=$archive_page_values selected=$archive_page output=$archive_page_output}
	</select>
</td>-->
<td align="center" width="50%">{$navigation}</td>
<!--<td align="right">{$lang.newsletter.archives.total_sent}: {$amount}</td>-->
</tr></table>

{else}

<div align="center">{$lang.newsletter.archives.no_sent_newsletters}</div>
<br>
{/if}
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}

{/literal}		
</script>
{include file="$admin_nl_gentemplates/admin_nl_site_foot.tpl"}
{literal}
<script language="JavaScript" type="text/JavaScript">
function DelItems(the_form) {
    var elts       = document.forms[the_form].elements['del[]'];
	var is_ok = false;
    var elts_cnt = 0;

	if (typeof(elts.length) != 'undefined') {
		elts_cnt = elts.length
		for (var i = 0; i < elts_cnt; i++) {
            if (elts[i].checked) {		
				is_ok = true;
				break;
			}
        }
	}	
	else if (typeof(elts.value) != 'undefined') {
		if (elts.checked) {		
			is_ok = true;			
		}	
	}
	if (is_ok) {
		if (confirm('{/literal}{$lang.newsletter.archives.confirm_delete_lists|escape:javascript}{literal}')) document.forms[the_form].submit();
	}
	else alert('{/literal}{$lang.newsletter.archives.alert_list_not_chosen|escape:javascript}{literal}');
	return false;
}
</script>
{/literal}