-
Notifications
You must be signed in to change notification settings - Fork 13
/
customer_home.php
78 lines (54 loc) · 1.92 KB
/
customer_home.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
<?php
include "validate_customer.php";
include "header.php";
include "customer_navbar.php";
include "customer_sidebar.php";
include "session_timeout.php";
$id = $_SESSION['loggedIn_cust_id'];
$sql0 = "SELECT * FROM customer WHERE cust_id=".$id;
$result0 = $conn->query($sql0);
$row0 = $result0->fetch_assoc();
$sql1 = "SELECT * FROM passbook".$id." WHERE trans_id=(
SELECT MAX(trans_id) FROM passbook".$id.")";
$result1 = $conn->query($sql1);
$row1 = $result1->fetch_assoc();
if ($row1["debit"] == 0) {
$transaction = $row1["credit"];
$type = "credit";
}
else {
$transaction = $row1["debit"];
$type = "debit";
}
$time = strtotime($row1["trans_date"]);
$sanitized_time = date("d/m/Y, g:i A", $time);
$sql2 = "SELECT COUNT(*) FROM beneficiary".$id;
$result2 = $conn->query($sql2);
$row2 = $result2->fetch_assoc();
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="admin_home_style.css">
</head>
<body>
<div class="flex-container">
<div class="flex-item">
<h1 id="customer">
Welcome, <?php echo $row0["first_name"] ?> <?php echo $row0["last_name"] ?> !
<br>AC/No: <?php echo $row0["account_no"]; ?>
</h1>
<p id="customer">
▸ Balance (INR): <?php echo number_format($row1["balance"]); ?>/-
<br>▸ You have <?php echo $row2["COUNT(*)"]; ?> beneficiaries.
<br>▸ Your last transaction (<?php echo $type; ?>) of Rs. <?php
echo number_format($transaction); ?>
<br>
on <?php echo $sanitized_time; ?>, was: "<?php echo $row1["remarks"]; ?>".
</p>
</div>
</div>
</body>
</html>
<?php include "easter_egg.php"; ?>