<table class="window">
  	<tr>
    	<td class="content2">
			<h1>{{@page_data.title}}</h1>
			<form name="settings_epays_form" action="/settings/epays" method="POST">
				<div class="epays_list" href="/settings/epays">
					<div class="reload">
						<table width="100%">
							<tr>
								<th width="240">
									Драйвер
								</th>
								<th>
									Название
								</th>
								<th width="100">
									Выбран по умолчанию
								</th>
								<th width="70">
									Активен
								</th>
								<td align="right" width="100">
									<input type="button" class="add_epay" value="Добавить">
								</td>
							</tr>
							<repeat group="{{@methods}}" value="{{@m}}">
							<tr>
								<td align="center">
									<input type="hidden" name="id[]" value="{{@m['id']}}">
									<input type="hidden" name="driver_config[]" value="{{is_numeric(@m['driver_config'])?@m['driver_config']:@m['driver_config']=time()+@m['id']}}">
									<select name="driver[]">
										<option value="">Нет</option>
										<repeat group="{{@drivers}}" value="{{@d}}">
										<option value="{{@d['path']}}" title="{{@d['method_title']}}" {{@m['driver']==@d['path']?'selected="selected"':''}}>{{@d['title']}}</option>
										</repeat>
									</select>
									<div href="/settings/epay_drivers?path={{@m.driver}}&id={{@m['id']}}&device=epay&print_group_id={{@m['driver_config']}}" class="driver_settings {{@m.driver==''?'hide':''}} a"><small>(настройка драйвера)</small></div>
								</td>
								<td>
									<input type="text" name="title[]" data-changed="1" value="{{@m['title']}}" style="width: 99%;">
								</td>
								<td align="right">
									<div class="switch right">
										<input type="checkbox" class="selected_epay" {{@m['selected']==1?'checked="checked"':''}}>
										<input type="hidden" name="selected[]" value="{{@m['selected']?1:0}}">
									</div>
								</td>
								<td align="center">
									<span class="order_show">Метод оплаты по умолчанию</span>
									<select name="active[]" style="width: 50px;">
										<option value="1" {{@m['active']==1?'selected="selected"':''}}>Да</option>
										<option value="0" {{@m['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/deleteepay?id=".@m['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="epay_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[]">
								<option value="">Нет</option>
								<repeat group="{{@drivers}}" value="{{@d}}">
								<option value="{{@d['path']}}" title="{{@d['method_title']}}">{{@d['title']}}</option>
								</repeat>
							</select>
							<div href="/settings/epay_drivers?device=epay&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="right">
							<span class="order_show">Метод оплаты по умолчанию</span>
							<div class="switch right">
								<input type="checkbox" class="selected_epay">
								<input type="hidden" name="selected[]" value="0">
							</div>
						</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 deleteepay_tr">
			                  <i class="fa fa-times"></i>
			                  <br>
			                  <div class="small">Удалить</div>
			                </button>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
