-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.php
126 lines (113 loc) · 5.97 KB
/
select.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sparks Bank | Transfer Money</title>
<link rel="icon" href="./img/icon_bank.png">
<script src="https://kit.fontawesome.com/50b1d2491c.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style1.css">
<link rel="stylesheet" type="text/css" href="css/resnavbar.css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</head>
<body style="height:100%;background-color: #11545e;margin:0 0;">
<div class="containe">
<!----------NAVIGATION BAR---------->
<div class="resnavbar">
<!-- LOGO -->
<div class="reslogo">Banking System</div>
<!-- NAVIGATION MENU -->
<ul class="resnav-links">
<!-- USING CHECKBOX HACK -->
<input type="checkbox" id="checkbox_toggle" />
<label for="checkbox_toggle" class="hamburger">☰</label>
<!-- NAVIGATION MENUS -->
<div class="resmenu">
<li><a href="index.html" style="text-decoration: none;">Home</a></li>
<li><a href="#" style="text-decoration: none;">About</a></li>
<li><a href="#" style="text-decoration: none;">Services</a></li>
<li><a href="#" style="text-decoration: none;">Customers</a></li>
<li><a href="#" style="text-decoration: none;">Contact Me</a></li>
</div>
</ul>
</div>
<?php
$server = "localhost";
$username = "root";
$password = "";
$database = "bank_system";
// Create a database connection
$con = mysqli_connect($server, $username, $password, $database);
// Check for connection success
if(!$con){
die("connection to this database failed due to" . mysqli_connect_error());
}
if($_SERVER['REQUEST_METHOD']=='POST'){
$name = $_POST['cus'];
}
$sql = "SELECT balance FROM customer WHERE Name='$name';";
$sql1 = "SELECT Name FROM customer;";
?>
<div class="intro">
<h1 style="letter-spacing: 2px; font-weight: bold;">Make a Transaction</h1>
</div><br>
<div class="container-xl" style="width:40%">
<form action="payment.php" method="POST">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default">Sender  </span>
</div>
<input type="text" value="<?php echo $name ?>" class="form-control" id="sender" name="sender"
aria-label="Default" aria-describedby="inputGroup-sizing-default" readonly>
</div>
<?php $result=mysqli_query($con,$sql); ?>
<?php while($row=mysqli_fetch_array($result)):; ?>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default">Balance </span>
</div>
<input type="text" value="<?php echo $row[0];?>" class="form-control" aria-label="Default"
aria-describedby="inputGroup-sizing-default" readonly>
</div>
<?php endwhile ;
?>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default">Receiver</span>
</div>
<select id="rec" name="rec" class="form-control" aria-label="Default"
aria-describedby="inputGroup-sizing-default">
<?php $result1=mysqli_query($con,$sql1); ?>
<?php while($row1=mysqli_fetch_array($result1)):; ?>
<option value="<?php echo $row1[0]; ?>">
<?php echo $row1[0]; ?>
</option>
<?php endwhile ;
$con->close();
?>
</select>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default">Amount</span>
</div>
<input type="number" name="amount" class="form-control" aria-label="Default"
aria-describedby="inputGroup-sizing-default" required placeholder="Enter Amount here"
oninvalid="this.setCustomValidity('Please Enter Price')" oninput="this.setCustomValidity('')">
</div>
<button class="btn btn-info btn-lg btn-block mt-5" value="Transfer">Send Money</button>
</form>
</div>
</div>
<!----------Footer---------->
<!-- <footer id="footer">
<p id="p1">© Copyright 2021 <span class="footer_logo">Basic Banking System</span></p>
<div class="social-icon">
<a href="https://www.linkedin.com/in/aman-jaiswal-6b8b94211/"><i class="fab fa-linkedin-in"></i></a>
<a href="mailto: [email protected]"><i class="fas fa-envelope"></i></i></a>
</div>
</footer> -->
</body>
</html>