This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
transfer.php
76 lines (64 loc) · 2.12 KB
/
transfer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
$title = 'Transfer: Federal Bank';
$curnav = 'Transfer';
require './includes/config.php';
require './includes/session.php';
require './includes/header.php';
$acc = '';
if ( isset($_GET['from']) ) $acc = $_GET['from'];
$notice = '';
if (
isset($_POST['srcAcc']) &&
isset($_POST['dstAcc']) &&
isset($_POST['amount']) && is_numeric($_POST['amount']) &&
isset($_POST['pin']) && is_numeric($_POST['pin'])
) {
$req = api_request('/transfer', [
'session' => $curuser->getSessionKey(),
'src' => $_POST['srcAcc'],
'dst' => $_POST['dstAcc'],
'amount' => $_POST['amount'],
'pin' => $_POST['pin']
]);
$notice = '<div class="alert '.($req['code'] == 200 ? 'alert-success' : 'alert-danger').'">'.$req['message'].'</div>';
}
?>
<div class="container">
<h2>Account Balance Transfer</h2>
<?=$notice?>
<form class="form-horizontal" method="post">
<div class="form-group">
<label for="srcAcc" class="col-sm-2 control-label">Source Account</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="srcAcc" name="srcAcc" value="<?=$acc?>" placeholder="#0000000000">
</div>
</div>
<div class="form-group">
<label for="dstAcc" class="col-sm-2 control-label">Destination Account</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="dstAcc" name="dstAcc" value="" placeholder="#0000000000">
</div>
</div>
<div class="form-group">
<label for="amount" class="col-sm-2 control-label">Amount</label>
<div class="col-sm-10">
<div class="input-group">
<div class="input-group-addon">$</div>
<input type="text" class="form-control" id="amount" name="amount" value="" placeholder="1000">
</div>
</div>
</div>
<div class="form-group">
<label for="pin" class="col-sm-2 control-label">PIN</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="pin" name="pin" placeholder="PIN">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Send Money!</button>
</div>
</div>
</form>
</div>
<?php require './includes/footer.php'; ?>