<form action="?p=smartoffer-newsletter" method="post">
	<fieldset>
		{{$bDisplayed = false}}
		{{foreach from=$aUsers item=aUser}}
			{{if !empty( $aUser.aProducts )}}
				{{$bDisplayed = true}}
				<div class="smartoffer-mail">
					<h2 class="to"><input type="checkbox" name="aEmails[]" value="{{$aUser.sEmail}}" checked="checked" /> {{$aUser.sEmail}}</h2>
					<table class="list">
						<thead><tr>
							<th class="id">{{$lang.Id}}</th>
							<th class="name">{{$lang.Name}}</th>
							<th class="price">{{$lang.Price}} {{$lang.smartoffer_current}}</th>
							<th class="price">{{$lang.Price}} {{$lang.smartoffer_seen}}</th>
							<th class="availability">{{$lang.smartoffer_avail}} {{$lang.smartoffer_current}}</th>
							<th class="availability">{{$lang.smartoffer_avail}} {{$lang.smartoffer_seen}}</th>
						</tr></thead>
					{{foreach from=$aUser.aProducts item=aProduct}}
						<tr>
							<td class="id">{{$aProduct.iProduct}}</td>
							<td class="name"><a href="?p=products-form&iProduct={{$aProduct.iProduct}}">{{$aProduct.sName}}</a></td>
							<td class="price">{{$aProduct.fCurrentPrice}}</td>
							<td class="price">{{$aProduct.fOldPrice}}</td>
							<td class="availability">{{$aAvailabilities[$aProduct.TiAvailable]}}</td>
							<td class="availability">{{$aAvailabilities[$aProduct.iAvailable]}}</td>
						</tr>
					{{/foreach}}
					</table>
				</div>
			{{/if}}
		{{/foreach}}
		{{if !$bDisplayed}}
			<div class="msg" id="error">
				<img src="{{$config.dir_templates}}admin/images/ico/msg_error.png" class="imgv" alt="" /> {{$lang.Data_not_found}}
			</div>
		{{/if}}
		<div class="save float"><div class="save floatcontainer">
			<input type="submit" name="sOption" value="{{$lang.Send_newsletter}}" class="submit styled" />
		</div></div>

	</fieldset>
</form>
<p style="font-size: 9px; text-align: right;">{{$gen_time}}s</p>