<h1>{{@page_data['title']}}</h1>
<form name="users_form" class="change_form" action="/users/form" method="POST">
	<input type="hidden" name="id" value="{{@data['id']}}">
	<table>
		<tr>
			<check if="count(@groups)>1">
				<true>
			<td>
				Группа пользователей
			</td>
			<td>
				<select name="group_id">
					<repeat group="{{@groups}}" value="{{@g}}">
					<option value="{{@g['id']}}" {{@data['group_id']==@g['id']?'selected="selected"':''}}>{{@g['title']}}</option>
					</repeat>
				</select>
			</td>
			<td>
				Фамилия*
			</td>
			<td>
				<input type="text" name="surname" class="mixed_pay mixed_pay_surname" pid="surname" value="{{@data['surname']}}" required="required" style="{{count(@groups)<=1?'width: 100%;':''}}">
			</td>
				</true>
				<false>
			<td>
				Фамилия*
			</td>
			<td colspan="3">
				<input type="hidden" name="group_id" value={{@groups[0]['id']}}>
				<input type="text" name="surname" class="mixed_pay mixed_pay_surname" pid="surname" value="{{@data['surname']}}" required="required" style="width: 100%;">
			</td>
				</false>
			</check>
		</tr>
		<tr>
			<td>
				Имя*
			</td>
			<td>
				<input type="text" name="name" class="mixed_pay mixed_pay_name" pid="name" value="{{@data['name']}}" required="required">
			</td>
			<td>
				Отчество
			</td>
			<td>
				<input type="text" name="second_name" class="mixed_pay mixed_pay_second_name" pid="second_name" value="{{@data['second_name']}}">
			</td>
		</tr>
		<tr>
			<td>
				Тип пользователя
			</td>
			<td>
				<select name="type">
					<option value="3" {{@data['type']==3?'selected="selected"':''}}>Кассир и исполнитель</option>
					<option value="2" {{@data['type']==2?'selected="selected"':''}}>Кассир</option>
					<option value="1" {{@data['type']==1?'selected="selected"':''}}>Исполнитель</option>
				</select>
			</td>
			<td>
				ИНН
			</td>
			<td>
				<input type="text" name="inn" class="mixed_pay mixed_pay_inn" pid="inn" value="{{@data['inn']}}">
			</td>
		</tr>
		<tr>
			<td>
				Номер карты сотрудника
			</td>
			<td>
				<input type="text" name="card" class="mixed_pay mixed_pay_card" pid="card" value="{{@data['card']}}">
			</td>
			<td>
				Пароль{{!@data?'*':''}}
			</td>
			<td>
				<input type="password" name="pass" class="mixed_pay mixed_pay_pass" pid="pass" value="">
			</td>
		</tr>
		<check if="{{@data}}">
		<tr>
			<td align="right" colspan="4">
				<p><small>Оставьте это поле пустым, если не хотите менять пароль</small></p>
			</td>
		</tr>
		</check>
		<tr>
			<td colspan="4" align="center">
				<check if="{{@base_settings.virtual_keyboard==1}}">
					<true>
				<div class="virtual_keyboard virtual_keyboard_product_form full_keyboard">
				{~@keys='1234567890-+|QWERTYUIOP_|ASDFGHJKL@|ZXCVBNM'~}
					<div class="eng">
					<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
						<check if="{{@keys[@i]=='|'}}">
							<true>
						<br>
							</true>
							<false>
						<input type="button" class="virtual_key" value="{{@keys[@i]}}" for="mixed_pay_name">
							</false>
						</check>
					</loop>
						<button type="button" class="virtual_key_bks" for=" mixed_pay_name">
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for="mixed_pay_name" value="CE">
						<br>
						<input type="button" class="virtual_key_ru" value="RU">
						<input type="button" class="virtual_key virtual_key_space" for="mixed_pay_name" value=" ">
						<input type="button" class="virtual_key" for="mixed_pay_name" value=",">
						<input type="button" class="virtual_key" for="mixed_pay_name" value=".">
						<button type="submit">Сохранить</button>
					</div>
					{~@keys='1234567890-+|ЙЦУКЕНГШЩЗХЪ|ФЫВАПРОЛДЖЭ_|ЯЧСМИТЬБЮ@'~}
					<div class="ru">
						<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
							{~@a=mb_substr(@keys, @i, 1)~}
							<check if="{{@a=='|'}}">
								<true>
						<br>
								</true>
								<false>
						<input type="button" class="virtual_key" value="{{@a}}" for="mixed_pay_name">
								</false>
							</check>
						</loop>
						<button type="button" class="virtual_key_bks" for="mixed_pay_name">
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for="mixed_pay_name" value="CE">
						<br>
						<input type="button" class="virtual_key_eng" value="ENG">
						<input type="button" class="virtual_key virtual_key_space" for="mixed_pay_name" value=" ">
						<input type="button" class="virtual_key" for="mixed_pay_name" value=",">
						<input type="button" class="virtual_key" for="mixed_pay_name" value=".">
						<button type="submit">Сохранить</button>
					</div>
				</div>
					</true>
					<false>
				<p align="center">
					<button type="submit">Сохранить</button>
				</p>
					</false>
				</check>
			</td>
		</tr>
	</table>
</form>
<script type="text/javascript">
$('form[name="users_form"] input[name="name"]').focus();
$('form[name="users_form"] input[name="name"]').select();
</script>
