-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustomers.php
68 lines (62 loc) · 2.34 KB
/
customers.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic Banking System</title>
<link rel="stylesheet" href="customers.css">
</head>
<body>
<div class="container">
<div><img src="assets/bank_logo.jpg" class="logo"></div>
<div class="title" >The Sparks Bank</div>
<div class="navbar">
<br />
<a href="index.html">Home</a>
<a href="https://github.com/zul132" target="_blank">About Us</a>
<a class="active" href="customers.php">View Customers</a>
<a href="transferMoney.php">Transfer Money</a>
<a href="transactions.php">Transaction History</a>
<a href="https://www.linkedin.com/in/fathima-zulaikha-2741a4217/" target="_blank">Contact Us</a>
<br />
</div>
</div>
<div class="contentbox" cellspacing="20px" cellpadding="20px">
<h1> Our Customers </h1>
<table class="customer" style="color: white">
<tr>
<th> Name </th>
<th> Email </th>
<th> Account No </th>
<th> Balance </th>
</tr>
<?php
$server="localhost";
$username="root";
$password="";
$dbname="bankingsystem";
//establish db connections
$con=mysqli_connect( $server, $username, $password, $dbname);
//check for connection success
if (!$con){
die("Connection to this database failed due to ".mysqli_connect_error());
}
$sql="Select Name, Email, AccountNo, Balance from customers";
$result= $con-> query($sql);
if ($result-> num_rows>0){
while ($row = $result-> fetch_assoc()){
echo "<tr><td>".$row["Name"]."</td><td>".$row["Email"]."</td><td>".$row["AccountNo"]."</td><td>".$row["Balance"]."</td></tr>";
}
echo "</table>";
}
else{
echo "0 Result Found!";
}
$con->close();
?>
</div>
<div class="footer">
Designed and Developed by Fathima Zulaikha
</div>
</body>
</html>