<h1>{{@page_data['title']}}</h1>
<check if="{{isset(@products) && !empty(@products)}}">
	<true>
<form name="tap_product_add_form" action="/taps/product_add" method="POST">
	<input type="hidden" name="tap_id" value="{{@POST.tap_id}}">
	<p align="center">
		<button type="submit">
			Подтвердить выбор
		</button>
	</p>
	<div align="center">
	<repeat group="{{@products}}" value="{{@product}}">
		<input type="checkbox" class="custom-checkbox" id="product_id_{{@product['id']}}" name="product_id[]" value="{{@product['id']}}">
		<label for="product_id_{{@product['id']}}"> {{@product['title']}}</label>
	</repeat>
	</div>
</form>
	</true>
	<false>
<form name="tap_product_add_form" action="/taps/product_add" method="POST">
	<input type="hidden" name="tap_id" value="{{@GET.tap_id}}">
	<table width="100%">
		<tr>
			<td align="center">
				<input type="text" name="product_add_search" class="product_add_search width_input_100" placeholder="Штрих-код или название" autocomplete="off" required="true">
			</td>
		</tr>
		<tr>
			<td align="center">
				<check if="{{@base_settings.virtual_keyboard==1}}">
					<true>
				<div class="virtual_keyboard full_keyboard">
					{~@keys='1234567890-+|QWERTYUIOP_|ASDFGHJKL@|ZXCVBNM'~}
					<div class="eng hide">
					<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='product_add_search'>
							</false>
						</check>
					</loop>
						<button type="button" class="virtual_key_bks" for='product_add_search'>
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for='product_add_search' value="CE">
						<br>
						<input type="button" class="virtual_key_ru" value="RU">
						<input type="button" class="virtual_key virtual_key_space" for='product_add_search' value=" ">
						<input type="button" class="virtual_key" for='product_add_search' value=",">
						<input type="button" class="virtual_key" for='product_add_search' value=".">
						<button type="submit" class="virtual_key_submit virtual_key_total">
							<i class="fas fa-search"></i>
							Искать
						</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='product_add_search'>
							</false>
						</check>
					</loop>
						<button type="button" class="virtual_key_bks" for='product_add_search'>
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for='product_add_search' value="CE">
						<br>
						<input type="button" class="virtual_key_eng" value="ENG">
						<input type="button" class="virtual_key virtual_key_space" for='product_add_search' value=" ">
						<input type="button" class="virtual_key" for='product_add_search' value="@">
						<input type="button" class="virtual_key" for='product_add_search' value=",">
						<input type="button" class="virtual_key" for='product_add_search' value=".">
						<button type="submit" class="virtual_key_submit virtual_key_total">
							<i class="fas fa-search"></i>
							Искать
						</button>
					</div>
				</div>
					</true>
					<false>
				<button type="submit">
					<i class="fas fa-search"></i>
					Искать
				</button>
					</false>
				</check>
			</td>
		</tr>
	</table>
</form>
	</false>
</check>
<script type="text/javascript">
$('form[name="tap_product_add_form"] input[name="product_add_search"]').focus();
</script>