{{function name="countPages" iPages=1 iPageNumber=1 sUrl="" sUrl2=""}}
	{{$sUrl2 = preg_replace( '/^\\?/', '&amp;', $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}}

{{include file='head.tpl' inline}}

<script type="text/javascript">
	var request_type = '{{$_GET.request_type}}';
</script>
</head>
<body>
	<h1>{{$lang.Users}}</h1>
	<div class="filter">
	<form method="get" id="users-search-form">
		<input type="hidden" name="request_type" value="{{$_GET.request_type}}" />
		<input type="hidden" name="p" value="{{$_GET.p}}" />
		<label for="user-search">{{$lang.search}}</label>
		<input type="text" name="sPhrase" value="{{$_GET.sPhrase}}" />
		<label><input type="checkbox" name="iAnon" value="1" {{if $_GET.iAnon}}checked="checked"{{/if}} class="checkbox" /> {{$lang.Anon_show}}</label>
		<input type="submit" class="submit" value="{{$lang.search}}" />
	</form>
	<div class="clear"></div>
	</div>
	{{if count( $aUsers.aUsers ) > 0}}
		<form action="?p={{$_GET.p}}" method="post" id="users-multiselect">
			<fieldset>
				<table class="list" id="users">
					<thead>
						<tr><th class="enabled">{{$lang.Select}}</th><th class="id">{{$lang.Id}}</th><th class="name">{{$lang.First_surname}} [{{$lang.Login}}]</th></tr>
						<tr><td class="pages" colspan="">{{if $aUsers.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aUsers.aPagesCountData.iCount iPageNumber=$aUsers.aPagesCountData.iPageNumber sUrl='admin.php?p=users-'|cat:$a sUrl2=$sUrlExt}}{{/if}}</td></tr>
					</thead>
					<tfoot>
						<tr><td class="pages" colspan="">{{if $aUsers.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aUsers.aPagesCountData.iCount iPageNumber=$aUsers.aPagesCountData.iPageNumber sUrl='admin.php?p=users-'|cat:$a sUrl2=$sUrlExt}}{{/if}}</td></tr>
					</tfoot>
					<tbody>
						{{foreach from=$aUsers.aUsers item=aUser}}
							<tr>
								<td class="enabled"><input type="checkbox" name="aSelected[{{$aUser.iUser}}]" id="selected-{{$aUser.iUser}}" /></td> 
								<td class="id"><label for="selected-{{$aUser.iUser}}">{{$aUser.iUser}}</label></td>
								<th class="name"><label for="selected-{{$aUser.iUser}}">{{$aUser.sLastName}} {{$aUser.sFirstName}} [{{$aUser.sLogin}}]</label></th>
							</tr>
						{{/foreach}}
					</tbody>
				</table>
				<div class="save float"><div class="floatcontainer">
					<input type="submit" class="submit" name="sOption" value="{{$lang.Save}}" />
				</div></div>
			</fieldset>
		</form>
	{{else}}
		<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 id="footer"></div>
</body>
</html>