<table class="window">
	<tr>
		<td>
			<div class="frame_center settings_form">
				<h1>{{@page_data.title}}</h1>
				<form name="settings_pre_form" action="/settings/pre_printer" method="POST">
					<input type="hidden" name="type" value="0">
					<input type="hidden" name="device" value="pre">
					<table width="100%">
						<tr>
							<td>
								Использовать принтер
							</td>
							<td align="right">
								<select name="active">
									<option value="0">Нет</option>
									<option value="1" {{@data.active==1?'selected="selected"':""}}>Да</option>
								</select>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Драйвер принтера
							</td>
							<td align="right">
								<select name="driver">
									<option value="">Нет</option>
									<repeat group="{{@drivers}}" value="{{@d}}">
									<option value="{{@d['path']}}" {{@data.driver==@d['path']?'selected="selected"':""}} data-url="{{@d['url']}}">{{@d['title']}}</option>
									</repeat>
								</select>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								<a href="/settings/drivers?path={{@data.driver}}&device=pre" id="driver_settings" class="show_window {{@data.driver==''?'hide':''}}"><small>(настройка драйвера)</small></a>
							</td>
						</tr>

						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Адрес принтера
							</td>
							<td align="right">
								<input type="text" name="url" value="{{@data.url}}">
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<p align="center">Верхняя часть чека</p>
								<textarea name="header">{{@data.header}}</textarea>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<p align="center">Нижняя часть чека</p>
								<textarea name="footer">{{@data.footer}}</textarea>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								<a class="show_window" href="/settings/manualforprinters"><small>Команды для чекопечатающего оборудования</small></a>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<input type="submit" value="Сохранить">
							</td>
						</tr>
					</table>
				</form>
			</div>
		</td>
	</tr>
</table>
