-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransferfunds.php
More file actions
148 lines (99 loc) · 3.08 KB
/
Copy pathtransferfunds.php
File metadata and controls
148 lines (99 loc) · 3.08 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
include 'account.php';
$connection = mysqli_connect("localhost","root","","admintransfer");
$database = mysqli_select_db($connection,"admintransfer");
$transferfrom = $transferto = $useraccount = $amount = $date = $message = "";
if($_SERVER["REQUEST_METHOD"] == "POST"){
if(!empty($_POST["sendfrom"])){
$transferfrom = $_POST["sendfrom"];
}
if(!empty($_POST["sendto"])){
$transferto = $_POST["sendto"];
}
if(!empty($_POST["accountto"])){
$useraccount = $_POST["accountto"];
}
if(!empty($_POST["amount"])){
$amount = $_POST["amount"];
}
if(!empty($_POST["date"])){
$date = $_POST["date"];
}
if(!empty($_POST["msg"])){
$message = $_POST["msg"];
}
$sql = "INSERT INTO transfertable(transfer_from,transfer_to,transfer_account,amount,datee,message)
VALUES('$transferfrom','$transferto','$useraccount','$amount','$date','$message')";
$result = mysqli_query($connection,$sql);
if(@$_POST["accountto"] === @$row["account_number"]){
$total = $_POST["amount"] + @$row["current_balance"];
}
}
?>
<?php
$connection = mysqli_connect("localhost","root","","bankaccount");
$database = mysqli_select_db($connection,"bankaccount");
if(isset($_POST["submit"])){
$total = @$row["current_balance"] + $_POST["amount"];
$query="UPDATE banktable SET current_balance = '$total' WHERE id = '$id'";
$testresult = mysqli_query($connection,$query);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ADMIN ACCOUNT TRANSFER</title>
<meta name="viewport" content="width=device-width,scalable=no">
<style>
#user{
display: none;
}
#transfer{
margin: 5em 0px;
line-height: 2em;
}
#tr{
width: 30em;
height: 2em;
}
@media all and (max-width: 580px){
#transfer{
font-size: 2em;
line-height: 3em;
}
#tr{
font-size: 1em;
width: 20em;
height: 4em;
}
h3{
width: 100vw;
font-size: 2em;
display: block;
}
}
</style>
</head>
<body>
<center>
<h3>ADMIN CASH TRANSFER</h3>
<div id="transfer">
<form name="admintransfer" action="transferfunds.php" method="POST">
<label for="from">TRANSFER FROM</label><br>
<input type="text" name="sendfrom" id="tr" placeholder="ADMIN TRANSFER"><br>
<label for="to">TRANSFER TO</label><br>
<input type="text" name="sendto" id="tr" placeholder="TRANSFER TO USER NAME"><br>
<label for="no">USER ACCOUNT NO</label><br>
<input type="text" name="accountto" id="tr" placeholder="TRANSFER TO USER ACCOUNT"><br>
<label for="amount">TRANSFER AMOUNT</label><br>
<input type="text" name="amount" id="tr" placeholder="AMOUNT TO TRANSFER"><br>
<label for="date">DATE</label><br>
<input type="date" name="date" id="tr" placeholder="DATE OF TRANSFER"><br>
<label for="msg">MESSAGE</label><br>
<textarea name="msg" id="tr">TEXT HERE</textarea><br>
<input type="submit" name="submit" id="tr" value="submit"><br>
</form>
</div>
</center>
</body>
</html>