<div>
	<div ng-app="eBanking" ng-controller="transferController" ng-show="hasToken">
		<h2 class="page-header">Tranferencias y Pagos</h2>
		<div>
			<div ng-hide="!messages.transfer.err.err" class="alert alert-danger" role="alert">
				{{messages.transfer.err.stat}}<br>
				{{messages.transfer.err.message}}
			</div>
			<div ng-hide="!messages.transfer.success.success" class="alert alert-success" role="alert">
				{{messages.transfer.success.title}}
				{{messages.transfer.success.message}}
			</div>
		</div>
		<form role="form" ng-submit="processTransfer()" class="paddedForm">
			<div class="form-group">
				<label for="fromAccount">Cuenta Origen</label>
				<select name="fromAccount" id="fromAccount" class="form-control" ng-model="transfer.accountNumber">
					<option value="{{account.accountNumber}}" ng-repeat="account in accountsList">
						{{account.accountType}} ({{account.accountNumber}}) - Saldo: {{account.balance | currency : "$" : 2}}
					</option>
				</select>
			</div>
			<div class="form-group">
				<label for="transferAmount">Cantidad</label>
				<input type="number" step="0.01" class="form-control" id="transferAmount" placeholder="Enter Amount" ng-model="transfer.value" required>
			</div>
			<div class="form-group">
				<label for="toAccount">Cuenta Destino</label>
				<select name="toAccount" id="toAccount" class="form-control" ng-model="transfer.otherAccountNumber">
					<option value="{{account.accountNumber}}" ng-repeat="account in accountsList">
						{{account.accountType}} ({{account.accountNumber}}) - Saldo: {{account.balance | currency : "$" : 2}}
					</option>
				</select>
			</div>
			<button type="submit" class="btn btn-success btn-lg btn-block paddedButton">Transferir</button>
		</form>

		<h2 class="page-header">Hacer un Pago</h2>		
		<div>
			<div ng-hide="!messages.payment.err.err" class="alert alert-danger" role="alert">
				{{messages.payment.err.stat}}<br>
				{{messages.payment.err.message}}
			</div>
			<div ng-hide="!messages.payment.success.success" class="alert alert-success" role="alert">
				{{messages.payment.success.title}}
				{{messages.payment.success.message}}
			</div>
		</div>
		<form role="form" ng-submit="processPayment()" class="paddedForm">
			<div class="form-group">
				<label for="fromAccount">Cuenta Origen</label>
				<select name="fromAccount" id="fromAccount" class="form-control" ng-model="payment.accountNumber">
					<option value="{{account.accountNumber}}" ng-repeat="account in accountsList">
						{{account.accountType}} ({{account.accountNumber}}) - Balance: {{account.balance | currency : "$" : 2}}
					</option>
				</select>
			</div>
			<div class="form-group">
				<label for="paymentAmount">Cantidad</label>
				<input type="number" step="0.01" class="form-control" id="paymentAmount" placeholder="Enter Amount" ng-model="payment.value" required>
			</div>
			<div class="form-group">
				<label for="accountNumber">Cuenta Destino</label>
				<input type="text" class="form-control" id="accountNumber" placeholder="Enter Account Number" ng-model="payment.otherAccountNumber" required>
				<span class="help-block"></span>
				<label for="sortCode">Referencia Bancaria</label>
				<input type="text" class="form-control" id="sortCode" placeholder="Enter Sort Code" ng-model="payment.otherSortCode" required>
				<span class="help-block"></span>
			</div>
			<button type="submit" class="btn btn-success btn-lg btn-block paddedButton">Realizar Pago</button>
		</form>
	</div>
</div>