{{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}}
<table class="list">
	<thead>
		<tr>
			<th class="id" rowspan="2">{{$lang.smartoffer_id}}</th>
			<th class="name" colspan="2" rowspan="2">{{$lang.smartoffer_name}}</th>
			<th class="date">{{$lang.smartoffer_time}}</th>
			<th class="date">{{$lang.smartoffer_time_ago}}</th>
		</tr>
		<tr>
			<th class="smartoffer">{{$lang.smartoffer_price}}<br/>{{$lang.smartoffer_current}}</th>
			<th class="smartoffer">{{$lang.smartoffer_avail}}<br/>{{$lang.smartoffer_current}}</th>
		</tr>
	</thead>
	{{foreach from=$aSmartoffer.aFilter item=SOaPage}}
		<tr>
			<td class="id">{{$SOaPage.iPage}}</td>
			<td class="name" colspan="2">
				{{page_tree aPageTree=$SOaPage.aPageTree}}<strong>{{$SOaPage.sName}}</strong>
				{{if !empty( $SOaPage.aSearch.aProducers )}}{{$lang.smartoffer_producer}}: {{foreach from=$SOaPage.aSearch.aProducers item=sProducer}}<strong>{{$sProducer}}</strong>{{if !$sProducer@last}}, {{/if}}{{/foreach}}{{/if}}
				{{if !empty( $SOaPage.aSearch.fFilterPriceFrom )}}{{$lang.smartoffer_price_from}}: <strong>{{$SOaPage.aSearch.fFilterPriceFrom}}</strong>{{/if}}
				{{if !empty( $SOaPage.aSearch.sFilterPriceTo )}}{{$lang.smartoffer_price_to}}: <strong>{{$SOaPage.aSearch.fFilterPriceTo}}</strong>{{/if}}
				{{if !empty( $SOaPage.aSearch.asAttributeValue )}}{{foreach from=$SOaPage.aSearch.asAttributeValue key=sAttribute item=aValues}}{{$sAttribute}}: {{foreach from=$aValues item=sValue}}<strong>{{$sValue}}</strong>{{if !$sValue@last}}, {{/if}}{{/foreach}} {{/foreach}}{{/if}}
			</td>
			<td class="date">{{date( 'Y-m-d H:i:s', $SOaPage.iTime )}}</td>
			<td class="date">{{$SOaPage.sTimeDifference}}</td>
		</tr>
		{{foreach from=$SOaPage.aProducts.aList item=SOaProduct}}
			<tr class="product {{if $SOaProduct.iTime > $SOaPage.iTime}}new{{/if}} {{if in_array( $SOaProduct.iProduct, $aSmartoffer.aProductsIds )}}visited{{/if}}">
				<td>{{$SOaProduct.iProduct}}</td>
				<td class="photo">{{if !empty( $SOaProduct.aDataImage )}}<a class="photo" href="{{$config.dir_files}}{{$SOaProduct.aDataImage.sFileName}}"><img src="{{$config.dir_files}}30/{{$SOaProduct.aDataImage.sFileName}}" alt="(f)" /></a>{{/if}}</td>
				<td class="name">{{$SOaProduct.sName}}</td>
				<td class="price">{{$SOaProduct.sPrice}}</td>
				<td class="available">{{$aSmartoffer.aAvailabilities[$SOaProduct.TiAvailable]}}</td>
			</tr>
		{{/foreach}}
	{{/foreach}}
	<tr class="legend"><td colspan="5">{{$lang.smartoffer_legend}}</td></tr>
	<tr class="legend"><td colspan="5"><div></div>{{$lang.smartoffer_legend_search_white}}</td></tr>
	<tr class="legend visited"><td colspan="5"><div></div>{{$lang.smartoffer_legend_search_green}}</td></tr>
	<tr class="legend new"><td colspan="5"><div></div>{{$lang.smartoffer_legend_search_red}}</td></tr>
</table>