{showMessage}

{if $usersList}

	<div class="accessStats">
		<a href="#;" onclick="selectUsers(0);" class="link">{$_LANG.reportsManagement.admin.access.deselectAllButt}</a>
		&nbsp; / &nbsp;
		<a href="#;" onclick="selectUsers(1);" class="link">{$_LANG.reportsManagement.admin.access.selectAllButt}</a>
	</div>

	<table class="list" width="100%" style="margin:0px" id="usersListTbl">

		<tr>
			<th width="30" class="nowrap">#</th>
			<th class="nowrap">{$_LANG.reportsManagement.admin.access.th_name}</th>
			<th class="nowrap">{$_LANG.reportsManagement.admin.access.th_office}</th>
			<th class="nowrap">{$_LANG.reportsManagement.admin.access.th_dept}</th>
			<th class="center nowrap">{$_LANG.reportsManagement.admin.access.th_hasAcc}</th>
		</tr>

		{foreach from=$usersList item=user key=key}
			<tr class="{cycle values="odd,even"}">
				<td>{counter name=usersList}.</td>
				<td>
					<label for="userCheck_{$user.id}">
						{userLabel ref=$user.id}
					</label>
				</td>
				<td><i>{officeLabel ref=$user.idOffice}</i></td>
				<td><i>{departmentLabel ref=$user.idDepartment}</i></td>
				<td class="center">
					<input type="checkbox" id="userCheck_{$user.id}" class="noBorder"
						onclick="
							if ( $F('userAccess_{$user.id}')=='0') $('userAccess_{$user.id}').value='1';
							else $('userAccess_{$user.id}').value='0';
						"
						{if $usersAccess[$user.id]}checked="1"{/if}
					/>
					<input type="hidden" id="userAccess_{$user.id}" name="userAccess[{$user.id}]"
						{if $usersAccess[$user.id]}value="1"{else}value="0"{/if}
					/>
				</td>
			</tr>
		{/foreach}

	</table>

	<div class="accessStats">
		<a href="#;" onclick="selectUsers(0);" class="link">{$_LANG.reportsManagement.admin.access.deselectAllButt}</a>
		&nbsp; / &nbsp;
		<a href="#;" onclick="selectUsers(1);" class="link">{$_LANG.reportsManagement.admin.access.selectAllButt}</a>
	</div>

{/if}

{showMessage message=$showMessage2}
