<table class="window">
  	<tr>
    	<td class="content2">
			<h1>{{@page_data.title}}</h1>
			<form name="settings_scales_form" action="/settings/clientsscales" method="POST">
				<div class="scales_list" href="/settings/clientsscales">
					<div class="reload">
						<table width="100%">
							<tr>
								<td colspan="4">
									Диапазон IP-адресов, для поиска подключенных весов
								</td>
							</tr>
							<tr>
								<td colspan="4">
									от
									<input type="text" name="ip_clientsscales_range_start" value="{{@base_settings.ip_clientsscales_range_start}}" placeholder="127.0.0.1">
									до
									<input type="text" name="ip_clientsscales_range_end" value="{{@base_settings.ip_clientsscales_range_end}}" placeholder="127.0.0.255">
								</td>
							</tr>
							<tr>
								<th width="240">
									Драйвер
								</th>
								<th>
									Название
								</th>
								<th width="70">
									Активен
								</th>
								<td align="right" width="100">
									<input type="button" class="add_clientsscale" value="Добавить">
								</td>
							</tr>
							<repeat group="{{@scales}}" value="{{@scale}}">
							<tr>
								<td align="center">
									<input type="hidden" name="id[]" value="{{@scale['id']}}">
									<input type="hidden" name="driver_config[]" value="{{is_numeric(@scale['driver_config'])?@scale['driver_config']:@scale['driver_config']=time()+@scale['id']}}">
									<select name="driver[]" href="/settings/clientsscales_drivers">
										<option value="">Нет</option>
										<repeat group="{{@drivers}}" value="{{@d}}">
										<option value="{{@d['path']}}" title="{{@d['method_title']}}" {{@scale['driver']==@d['path']?'selected="selected"':''}}>{{@d['title']}}</option>
										</repeat>
									</select>
									<div href="/settings/clientsscales_drivers?path={{@scale['driver']}}&id={{@scale['id']}}&device=clientsscales&print_group_id={{@scale['driver_config']}}" class="driver_settings {{@scale['driver']==''?'hide':''}} a"><small>(настройка драйвера)</small></div>
								</td>
								<td>
									<input type="text" name="title[]" data-changed="1" value="{{@scale['title']}}" style="width: 99%;">
								</td>
								<td align="center">
									<select name="active[]" style="width: 50px;">
										<option value="1" {{@scale['active']==1?'selected="selected"':''}}>Да</option>
										<option value="0" {{@scale['active']==0?'selected="selected"':''}}>Нет</option>
									</select>
								</td>
								<td align="right">
									<button type="button" class="return_receipts_button show_window" href="/messages/continue?uri={{urlencode("/settings/deleteclientsscales?id=".@scale['id'])}}">
					                  <i class="fa fa-times"></i>
					                  <br>
					                  <div class="small">Удалить</div>
					                </button>
								</td>
							</tr>
							</repeat>
						</table>
					</div>
				</div>
				<p align="center"><input type="submit" value="Сохранить"></p>
			</form>
			<div id="clientsscale_tmp" style="display: none;">
				<table>
					<tr>
						<td align="center">
							<input type="hidden" name="id[]" value="">
							<input type="hidden" name="driver_config[]" value="@driver_config">
							<select name="driver[]" href="/settings/clientsscales_drivers">
								<option value="">Нет</option>
								<repeat group="{{@drivers}}" value="{{@d}}">
								<option value="{{@d['path']}}" title="{{@d['method_title']}}">{{@d['title']}}</option>
								</repeat>
							</select>
							<div href="/settings/clientsscales_drivers?device=clientsscales&path=" class="driver_settings hide a"><small>(настройка драйвера)</small></div>
						</td>
						<td>
							<input type="text" name="title[]" data-changed="0" value="" style="width: 99%;">
						</td>
						<td align="center">
							<select name="active[]" style="width: 50px;">
								<option value="1">Да</option>
								<option value="0">Нет</option>
							</select>
						</td>
						<td>
							<button type="button" class="return_receipts_button deleteclientsscale_tr">
			                  <i class="fa fa-times"></i>
			                  <br>
			                  <div class="small">Удалить</div>
			                </button>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
