{{function page_tree aPageTree=[] bMenu=true}}{{if $bMenu && isset($aPageTree.sMenu)}}{{$aPageTree.sMenu}}&nbsp;&raquo;&nbsp;{{/if}}{{foreach from=$aPageTree.aPath item=aPage}}{{$aPage.sName}}&nbsp;&raquo;&nbsp;{{/foreach}}{{/function}}
{{function name="countPages" iPages=1 iPageNumber=1 sUrl="" sUrl2=""}}
	{{if $iPageNumber > 1}}
		<a href="{{$sUrl}}{{if $iPageNumber > 2}}&amp;iPage={{$iPageNumber - 1}}{{/if}}{{$sUrl2}}">&laquo;&nbsp;{{$lang.pages_prev}}</a>
	{{/if}}
	{{$iPaginationSpacer = false}}
	{{section name=pages start=1 loop=$iPages+1 step=1}}
		{{if $smarty.section.pages.index != $iPageNumber && (abs($smarty.section.pages.index - $iPageNumber) <= $config.pagination_counter_admin || $smarty.section.pages.index <= $config.pagination_counter_admin || $smarty.section.pages.index >=  + $iPages - $config.pagination_counter_admin + 1)}}
			<a href="{{$sUrl}}{{if $smarty.section.pages.index > 1}}&amp;iPage={{$smarty.section.pages.index}}{{/if}}{{$sUrl2}}">{{$smarty.section.pages.index}}</a>
		{{$iPaginationSpacer = false}}
		{{elseif $smarty.section.pages.index == $iPageNumber}}
			<strong>{{$smarty.section.pages.index}}</strong>
		{{else}}
			{{if $iPaginationSpacer === false}}
			<strong>...</strong>
			{{$iPaginationSpacer = true}}
			{{/if}}
		{{/if}}
	{{/section}}
	{{if $iPageNumber < $iPages}}
		<a href="{{$sUrl}}&amp;iPage={{$iPageNumber + 1}}{{$sUrl2}}">{{$lang.pages_next}}&nbsp;&raquo;</a>
	{{/if}}
{{/function}}

<table class="list">
<thead>
	<tr><td colspan="6">
		<div class="filter">
			<form action="admin.php" method="get">
				<input type="hidden" name="p" value="avail_newsletter-list" />
				{{if !empty( $_GET.iProduct )}}<input type="hidden" name="iProduct" value="{{$_GET.iProduct}}" />{{/if}}
				{{if !empty( $_GET.iProductVariant )}}<input type="hidden" name="iProductVariant" value="{{$_GET.iProductVariant}}" />{{/if}}
				<label><input type="radio" class="checkbox" name="iSent" value="-1" {{if !isset( $_GET.iSent ) || $_GET.iSent == -1}}checked="checked"{{/if}} />{{$lang.Sent_all}}</label>
				<label><input type="radio" class="checkbox" name="iSent" value="0" {{if isset( $_GET.iSent ) && $_GET.iSent == 0}}checked="checked"{{/if}} />{{$lang.Not_sent}}</label>
				<label><input type="radio" class="checkbox" name="iSent" value="1" {{if isset( $_GET.iSent ) && $_GET.iSent == 1}}checked="checked"{{/if}} />{{$lang.Sent}}</label>
				<input type="submit" class="submit styled" value="{{$lang.Select}}" />
			</form>
		</div>
	</td></tr>
	<tr><td colspan="6" class="pages">{{if $aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aPagesCountData.iCount iPageNumber=$aPagesCountData.iPageNumber sUrl='admin.php?p=avail_newsletter-list' sUrl2=$sUrlExt}}{{/if}}</td></tr>
	<tr>
		<th>{{$lang.Email}}</th>
		<th>{{$lang.Phone}}</th>
		<th class="photo">{{$lang.Photo}}</th>
		<th class="name">{{$lang.smartoffer_name}}</th>
		<th class="smartoffer">{{$lang.smartoffer_time}}<br/>{{$lang.smartoffer_time_ago}}</th>
		<th class="smartoffer">{{$lang.smartoffer_time_sent}}<br/>{{$lang.smartoffer_time_ago}}</th>
	</tr>
</thead>
<tfoot>
	<tr><td colspan="6" class="pages">{{if $aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aPagesCountData.iCount iPageNumber=$aPagesCountData.iPageNumber sUrl='admin.php?p=avail_newsletter-list' sUrl2=$sUrlExt}}{{/if}}</td></tr>
</tfoot>
{{foreach from=$aProducts item=aProduct}}
	<tr>
		<td><a href="?p=users-list&amp;sPhrase={{$aProduct.sEmail}}">{{$aProduct.sEmail}}</a></td>
		<td><a href="?p=users-list&amp;sPhrase={{$aProduct.sPhone}}">{{$aProduct.sPhone}}</a></td>
		<td class="photo">{{if isset( $aProduct.aDataImage )}}<a href="{{$config.dir_files}}{{$aProduct.aDataImage.sFileName}}" class="photo"><img src="{{$config.dir_files}}30/{{$aProduct.aDataImage.sFileName}}" alt="(f)"/></a>{{/if}}</td>
		<td class="name">{{page_tree aPageTree=$aProduct.aPageTree}}<strong><a href="?p=products-form&amp;iProduct={{$aProduct.iProduct}}">{{$aProduct.sName}}</a></strong></td>
		<td class="smartoffer">{{date( 'Y-m-d H:i:s', $aProduct.iTime )}}<br/>{{$aProduct.sTimeDifference}}</td>
		<td class="smartoffer">{{if !empty( $aProduct.iTimeSent )}}{{date( 'Y-m-d H:i:s', $aProduct.iTimeSent )}}<br/>{{$aProduct.sTimeDifferenceSent}}{{else}}-{{/if}}</td>
	</tr>
{{/foreach}}
</table>