-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathabout.php
More file actions
97 lines (91 loc) · 3.11 KB
/
Copy pathabout.php
File metadata and controls
97 lines (91 loc) · 3.11 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
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type ="text/css" href="css/style">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.php">All customers</a>
</div>
<ul class="nav navbar-nav">
<li ><a href="index.php">Homepage</a></li>
<li class="active"><a href="about.php">All customers</a></li>
</ul>
</div>
</nav>
<head>
<title>View all customers</title>
</head>
<body>
<table>
<tr>
<th>Name</th>
<th>View</th>
</tr>
<?php
$conn = mysqli_connect("localhost","root","","banking");
if($conn -> connect_error){
die("connection failed:".$conn->connect_error);
}
$sql = "SELECT * from customers";
$result = $conn -> query($sql);
if($result-> num_rows>0)
{
while($row = $result-> fetch_assoc())
{
?>
<tr>
<td><?php echo $row["Name"]; ?></td>
<td>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal<?php echo $row["id"]; ?>">View Details</button>
</td>
</tr>
<!-- Modal -->
<div id="myModal<?php echo $row["id"]; ?>" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Details of <?php echo $row["Name"]; ?></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-4" style="background-color:lavender;">Email:</div>
<div class="col-sm-8" style="background-color:lavenderblush;"><?php echo $row["Email"]; ?></div>
</div>
<div class="row">
<div class="col-sm-4" style="background-color:lavender;">Mobile:</div>
<div class="col-sm-8" style="background-color:lavenderblush;"><?php echo $row["Mobile"]; ?></div>
</div>
<div class="row">
<div class="col-sm-4" style="background-color:lavender;">Balance:</div>
<div class="col-sm-8" style="background-color:lavenderblush;"><?php echo $row["Current Balance"]; ?></div>
</div>
</div>
</div>
<!--<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>-->
</div>
</div>
</div>
<?php
}
}
else{
echo "0 result";
}
$conn -> close();
?>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</body>
</html>