<?php if(@$error): ?>
	<div class="alert alert-dismissible alert-danger">
		<button type="button" class="close" data-dismiss="alert">×</button>
		<strong>Hata!</strong> <?=$errorText?>
	</div>
<?php endif; ?>
<?php if(@$success): ?>
	<div class="alert alert-dismissible alert-success">
		<button type="button" class="close" data-dismiss="alert">×</button>
		<strong>Başarılı!</strong> <?=$success?>
	</div>
<?php endif; ?>
<a href="#" class="btn btn-success" style="margin-bottom:20px;" data-toggle="modal" data-target="#addApi">Yeni Banka Hesabı Ekle</a>
<div style="float:right;">
    <a href="<?=admin_url('settings/payment')?>" class="details_backButton btn btn-link"><span>‹</span> Geri</a>
</div>
<div class="panel panel-default">
	<div class="panel-body" style="padding:0;">
		<table class="table" style="margin-bottom:0;">
			<thead>
				<tr>
					<th class="p-l" width="45%">Hesap İsmi</th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($accounts as $row): ?>
					<tr>
						<td><?=$row["account_title"];?></td>
						<td>
							<div class="dropdown pull-right">
								<button class="btn btn-xs btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">İşlemler<span class="caret"></span></button>
								<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
									<li><a href="#" data-toggle="modal" data-toggle="modal" data-target="#modalDefault" data-action="get_account" data-id="<?=$row["id"];?>">Düzenle</a></li>
									<li><a href="#" onclick="delete_account(<?=$row["id"];?>)">Sil</a></li>
								</ul>
							</div>
						</td>
					</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
	</div>
</div>
</div>

<div id="addApi" class="modal fade" role="dialog">
	<div class="modal-dialog">

		<!-- Modal content-->
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">&times;</button>
				<h4 class="modal-title">Yeni Banka Hesabı Ekle</h4>
			</div>
			<div class="modal-body">
				<form id="add_bankaccount" onsubmit="return false;" data-reset="1">
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Banka İsmi</b></span>
							<input type="text" name="account_title" class="form-control" required="">
						</div>
					</div>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>İsim Soyisim</b></span>
							<input type="text" name="account_name" class="form-control" required="">
						</div>
					</div>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>IBAN</b></span>
							<input type="text" name="account_iban" class="form-control" required="">
						</div>
					</div>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Hesap Numarası</b></span>
							<input type="text" name="account_number" class="form-control" required="">
						</div>
					</div>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Şube Kodu</b></span>
							<input type="text" name="account_branch" class="form-control" required="">
						</div>
					</div>
					<div class="form-group text-right">
						<button type="button" class="btn btn-default" data-dismiss="modal">Vazgeç</button>
						<button type="submit" class="btn btn-success">Ekle</button>
					</div>
				</form>
			</div>
		</div>

	</div>
</div>