-
Notifications
You must be signed in to change notification settings - Fork 1
/
bank_details_display.php
144 lines (78 loc) · 4.07 KB
/
bank_details_display.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
include 'includes/db.php';
include 'includes/header.php';
include 'includes/navbar.php';
$sql= "SELECT * FROM users WHERE email = '$username'";
$sql_run = mysqli_query($con, $sql);
$row_a = mysqli_fetch_assoc($sql_run);
$user_id= $row_a['id'];
$query_b = "SELECT * FROM bank_details WHERE user_id='$user_id' ";
$query_run_b = mysqli_query($con, $query_b);
$row_b = mysqli_fetch_assoc($query_run_b)
?>
<div class="app-main__outer">
<div class="app-main__inner">
<div class="app-page-title">
<div class="page-title-wrapper">
<div class="page-title-heading">
<div class="page-title-icon">
<i class="pe-7s-global text-success">
</i>
</div>
<div>Bank Details
<div class="page-title-subheading">View and Edit bank account details here
</div>
</div>
</div>
<div class="page-title-actions">
<?php if (empty($row_b['bank_name'])) { ?><button style="font-size:14px;" type="button" class="btn mr-3 mb-3 btn-primary" data-toggle="modal" data-target="#addbank">
<i class="fa fa-plus"></i> Add Bank Details
</button> <?php } else { ?>
<button style="font-size:14px;" type="button" class="btn mr-3 mb-3 btn-primary" data-toggle="modal" data-target="#addbank" disabled>
<i class="fa fa-plus"></i> Add Bank Details
</button>
<?php } ?>
</div>
</div>
</div>
<div class="tab-content">
<div class="tab-pane tabs-animation fade show active" id="tab-content-0" role="tabpanel">
<?php
if(isset($_SESSION['SUCCESS']) && $_SESSION['SUCCESS'] !=''){
echo '<div class="alert alert-success" role="alert"> '.$_SESSION['SUCCESS']. '</div>';
unset($_SESSION['SUCCESS']);
}
if(isset($_SESSION['Failure']) && $_SESSION['Failure'] !=''){
echo '<div class="alert alert-danger" role="alert"> '.$_SESSION['Failure']. '</div>';
unset($_SESSION['Failure']);
}
?>
<div class="main-card mb-3 card">
<div class="card-body" style="font-size:15px;">
<?php
$query = "SELECT * FROM bank_details WHERE user_id='$user_id' ";
$query_run = mysqli_query($con, $query);
if(mysqli_num_rows($query_run) == 0){
echo "No record found!";
} else {
while($row_a = mysqli_fetch_assoc($query_run)){
echo "Bank Name: " . $row_a["bank_name"]. "<br>A/C Number: " . $row_a["account_number"]. "<br>A/C Type: " . $row_a["acc_type"]. "<br>A/C Name: " . $row_a["account_name"]. "<br>IFSC Code: " . $row_a["ifsc_code"]. "<br>MICR Code: " . $row_a["micr_code"]. "<br>SWIFT Code: " .$row_a["swift_code"]. "<br>Online Payment URL: " .$row_a["url"]. "";
?>
<table align="center" style="margin-top:20px;"><td>
<form action="bank_details_edit.php" method="post">
<input type="hidden" name="edit_id" value="<?php echo $row_a['bank_id']; ?>">
<button type="submit" name="edit_btn" class="btn btn-success"> EDIT</button>
</form></td>
</table>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
include 'includes/footer.php';
?>