<div class="col-md-12">
	{if('{success}' == '1')}
		<div class="bs-callout bs-callout-success mb-10">
			<h4>Ваш баланс успешно пополнен!</h4>
			<p><b>{login}</b>, Ваш баланс успешно пополнен!</p>
		</div>
	{/if}

	{if('{fail}' == '1')}
		<div class="bs-callout bs-callout-error mb-10">
			<h4>Внимание! Ваш баланс не пополнен!</h4>
			<p>Возможно произошла ошибка, либо Вы отменили платеж.</p>
		</div>
	{/if}

	<div class="block purse">
		<div class="col-md-3">
			<div>
				<span class="glyphicon glyphicon-ruble"></span><br>
				Баланс<br>
				<font id="my_balance">{balance}</font>{{$messages['RUB']}}
			</div>
		</div>
		<div class="col-md-3">
			<div data-target="#voucher" data-toggle="modal" class="c-p">
				<span class="glyphicon glyphicon-star-empty"></span><br>
				Активировать<br>
				ваучер
			</div>
		</div>
		<div class="col-md-3">
			<div>
				<span class="glyphicon glyphicon-send"></span><br>
				Скидка<br>
                {proc}%
			</div>
		</div>
		<div class="col-md-3 c-p" onclick="scrollToBox('#last_operations');">
			<div>
				<span class=" glyphicon glyphicon-shopping-cart"></span><br>
				Последние<br>
				операции
			</div>
		</div>
	</div>

	<script>$('#voucher').modal('hide');</script>
	<div id="voucher" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title">
						Активация ваучера
						<button type="button" class="close" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">&times;</span></button>
					</h4>
				</div>
				<div class="modal-body">
					<input class="form-control" type="text" id="voucher_key" placeholder="Введите ваучер" maxlength="50">
					<button class="btn2 mt-10" onclick="activate_voucher();">Активировать</button>
					<br>
					<div id="activate_result"></div>
				</div>
			</div>
		</div>
	</div>

	{if('{bonusesActivity}' == '1')}
		<div class="block">
			<div class="block_head">
				Бонусы
			</div>
			<div class="row mt--10">
				{for($i = 0; $i < count($bonuses); $i++)}
					<div class="col-md-{if(count($bonuses) % 4 == 0)}3{else}{if(count($bonuses) % 3 == 0)}4{else}{if(count($bonuses) % 2 == 0)}6{else}12{/if}{/if}{/if}">
						<div class="bs-callout bs-callout-success mt-10 br-3">
							<h4>+{{$bonuses[$i]['value']}}{if($bonuses[$i]['type'] == 1)}{{$messages['RUB']}}{else}%{/if}</h4>
							При пополнении на сумму от {{$bonuses[$i]['start']}} до {{$bonuses[$i]['end']}}{{$messages['RUB']}}
						</div>
					</div>
				{/for}
			</div>
		</div>
	{/if}

	<div class="row pay_area">
		{foreach($merchants as $slug => $merchant)}
			{if($merchantsSettings->$slug == 1)}
				<div class="col-md-6">
					<div class="block">
						<div class="block_head">
							{{$merchant['title']}}
						</div>
						<label for="number_{{$slug}}">
							<img src="../files/merchants/{{$merchant['image']}}" alt="{{$merchant['title']}}">
						</label>
						<input class="form-control" id="number_{{$slug}}" placeholder="Укажите сумму" value="{price}">
						<div id="balance_result_{{$slug}}" class="mt-10"></div>
						<button class="btn2 btn-lg" onclick="refill_balance('{{$slug}}');">Пополнить баланс</button>
					</div>
				</div>
			{/if}
		{/foreach}
	</div>

	<div class="clearfix visible-xs"></div>

	<div class="block" id="last_operations">
		<div class="block_head">
			Последние операции
		</div>
		<div class="table-responsive mb-0">
			<table class="table table-bordered">
				<thead>
				<tr>
					<td>Сумма</td>
					<td>Тип</td>
					<td>Дата</td>
				</tr>
				</thead>
				<tbody id="operations">
				<tr>
					<td colspan="4"><br>
						<center><img src="{site_host}templates/{template}/img/loader.gif?v={cache}"></center>
						<br></td>
				</tr>
				</tbody>
			</table>
		</div>
		<script>get_operations();</script>
	</div>
</div>