-
Notifications
You must be signed in to change notification settings - Fork 0
/
allstatement.php
244 lines (200 loc) · 9.87 KB
/
allstatement.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
session_start();
if(!isset($_SESSION["user_email"]))
{
header('Location: index.php');
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<!-- Custom Style -->
<link rel="stylesheet" href="CSS/pdf.css">
<title>DOWNLOAD | STATEMENT</title>
</head>
<body>
<?php
require_once('DBCONFIG/dbconfig.php');
if (class_exists('DATABASE_CONNECT'))
{
$obj_conn = new DATABASE_CONNECT;
$host = $obj_conn->connect[0];
$user = $obj_conn->connect[1];
$pass = $obj_conn->connect[2];
$db = $obj_conn->connect[3];
$conn = new mysqli($host,$user,$pass,$db);
if ($conn->connect_error)
{
die ("Cannot connect " .$conn->connect_error);
}
else
{
$email = $_SESSION["user_email"];
$sql = "select * from users where user_email = '$email'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$sql2 = "select user_balance from accounts where user_email = '$email'";
$result2 = $conn->query($sql2);
$row2 = $result2->fetch_assoc();
$account_no = $row['user_accountno'];
$ifsc = $row['user_ifsc'];
$sql3 = "select date_transfer, _from_customer_lastname,
_from_customer_accno_iban, _to_customer_lastname,
_to_customer_accno_iban, transaction_number, amount
from transactions_all
where _from_customer_accno_iban = '$account_no' or _from_customer_accno_iban = '$ifsc' or _to_customer_accno_iban = '$account_no' or _to_customer_accno_iban = '$ifsc'
order by date_transfer desc";
$result3 = $conn->query($sql3);
?>
<button type="button" class="button" onclick="printDiv('printarea')" style="margin-left: 280px;">
<span class="button__icon">
<ion-icon name="cloud-download-outline"></ion-icon>
</span>
</button>
<div class="my-5 page" size="A4" id="printarea" style="width: 22cm;">
<div class="p-5">
<section class="top-content bb d-flex justify-content-between">
<div class="logo">
<img src="Assets/Images/photo3.svg" alt="" class="img-fluid">
</div>
<div class="top-left">
<div class="graphic-path">
<p>Acc Statement</p>
</div>
<div class="position-relative">
<p>Date. <span><?php echo date("d.m.Y"); ?></span></p>
</div>
</div>
</section>
<section class="store-user mt-5">
<div class="col-10">
<div class="row bb pb-3">
<div class="col-7">
<h2>Soul<span class="span-primary-color">.</span>pay</h2>
<p class="address"> Soul Towers, TVM <br> Street 750, Kerala, 456765</p>
<div class="txn mt-2">Phone: 1800 420 1112</div>
</div>
<div class="col-5">
<h2><?php echo $row['user_firstname'] . " " . $row['user_lastname']?></h2>
<p class="address"> <?php echo $row['use_street'] . ", " . $row['user_houseno']?><br>
<?php echo $row['user_district'] . ", " . $row['user_state']?></p>
<div class="txn mt-2">Phone: <?php echo $row['user_phone']?></div>
</div>
</div>
<div class="row extra-info pt-3">
<div class="col-7">
<p>Account No: <span> <?php echo $row['user_accountno']?></span></p>
<p>Account Status: <span>Active</span></p>
</div>
<div class="col-5">
<p>IFSC: <span><?php echo $row['user_ifsc']?></span></p>
<p>Balance: <span><?php echo $row2['user_balance']?></span></p>
</div>
</div>
</div>
</section>
<section class="product-area mt-4">
<table class="table table-hover" style="margin-bottom:50px;">
<thead>
<tr>
<th>Date</th>
<th>Transaction.No</th>
<th>Amount</th>
<th>DB/CR</th>
<th>From/To</th>
<th>Acc.No/IFSC</th>
</tr>
</thead>
<tbody>
<?php
while ($row3 = $result3->fetch_assoc())
{
?>
<tr>
<td data-heading='Date'><?php echo $row3['date_transfer']?></td>
<td data-heading='Transaction.No'><?php echo $row3['transaction_number']?></td>
<td data-heading='Amount'><?php echo $row3['amount']?> ₹</td>
<td data-heading='DB/CR'>
<?php
if($row['user_lastname'] == $row3['_to_customer_lastname'])
{
echo 'Credit';
}
else
{
echo 'Debit';
}
?>
</td>
<td data-heading='From/To'>
<?php
if($row['user_lastname'] == $row3['_to_customer_lastname'])
{
echo $row3['_from_customer_lastname'];
}
else
{
echo $row3['_to_customer_lastname'];
}
?>
</td>
<td data-heading='Acc.No/IFSC'>
<?php
if($row['user_lastname'] == $row3['_to_customer_lastname'])
{
echo $row3['_from_customer_accno_iban'];
}
else
{
echo $row3['_to_customer_accno_iban'];
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
}
?>
</section>
<div align="left" style="margin-left:-15px; font-size:13px; margin-bottom: 15px">
Abbreviations Used:
<span style="margin-left:10px">DB : Debit</span>
<span style="margin-left:10px">CR : Credit</span>
</div>
<div class="row">
<p class="m-0 font-weight-bold" style="font-size: 10px;"> DISCLAIMER: </p>
<p style="font-size: 10px;">This computer generated statement contains the particulars of the transaction(s) in the account that have been updated till the time of day end operations of the Bank on the
previous working day and the same will not reflect the transaction(s) that have occurred in the account, if any, subsequent thereto. The <span style="font-weight: 700;"> Soul.pay</span> shall not be liable/responsible for want of full
particulars of the transaction(s) at the time of the generation of this statement.</p>
<p style="font-size: 10px;">This is a computer generated statement which need not normally be signed. Contents of this statement will be considered correct if no error is reported within 21 days of the statement date.</p>
</div>
<div class="footer">
<hr>
<p class="m-0 text-center">
END OF STATEMENT
</p>
<div class="social pt-3">
<span class="pr-2">
<i class="fas fa-envelope"></i>
<span>[email protected]</span>
</span>
</div>
</div>
</div>
</div>
<?php
require ('script.php');
?>
</body></html>