-
Notifications
You must be signed in to change notification settings - Fork 41
/
transac_export_anyone_bank.php
194 lines (132 loc) · 5.16 KB
/
transac_export_anyone_bank.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
<?php
/*
* Copyright (c) 2018 Barchampas Gerasimos <[email protected]>
* online-banking a online banking system for local businesses.
*
* online-banking is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* online-banking is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
session_start();
if(!isset($_SESSION['login']))
{
header('Location: index.php');
}
else
{
$idletime=898;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime)
{
session_destroy();
session_unset();
}
else
{
$_SESSION['timestamp']=time();
}
require_once('__SRC__/connect.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
{
require('fpdf/fpdf.php');
$pdf = new FPDF();
//$pdf->AddPage();
$pdf->addPage("P", "A3");
$pdf->GetPageWidth(); // Width of Current Page
$pdf->GetPageHeight(); // Height of Current Page
$image="logo_pdf.jpg";
$pdf-> Image('images/'.$image,10,5,60,50);
$pdf->SetFont('Arial','',20);
$pdf->Cell(280,12,"Easy Bank: https://easybank.com",0,0,TRUE);
$pdf->Ln();
$pdf->Cell(280,12,"Country: Greece",0,0,TRUE);
$pdf->Ln();
$pdf->Cell(280,12,"Location: Mesolongi",0,0,TRUE);
$pdf->Ln();
$pdf->Cell(280,12,"Phone number: 6976829275",0,0,TRUE);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',10);
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont('times','B',10);
$pdf->SetFillColor(230,230,230); // edw kathorizeis to xrwma
$pdf->Cell(280,12,"All Transactions From Anyone Bank",1,0,'C',TRUE);
$pdf->Ln(); // afhnei mia grammh keno kai paei apo katw
// edw vazeis platos,upsos,onoma,border w,0h,kai true gia na parei to xrwma
$pdf->Cell(35,15,"Date Transfer",1,0,'C',TRUE);
$pdf->Cell(40,15,"From Customer",1,0,'C',TRUE);
$pdf->Cell(53,15,"From Customer IBAN",1,0,'C',TRUE);
$pdf->Cell(40,15,"To Customer",1,0,'C',TRUE);
$pdf->Cell(53,15,"To Customer IBAN",1,0,'C',TRUE);
$pdf->Cell(35,15,"Transaction Number",1,0,'C',TRUE);
$pdf->Cell(24,15,"Amount",1,0,'C',TRUE);
$pdf->Ln();
//$email = $_SESSION['login'];
$sql = "select IBAN from accounts where email = '".$_SESSION['login']."'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$IBAN = $row['IBAN'];
$sql2 = "select date_transfer, _from_customer_lastname, _from_customer_firstname,
_from_customer_IBAN, _to_customer_lastname, _to_customer_firstname,
_to_customer_IBAN, transaction_number, amount
from transactions_anyone_bank
where _from_customer_IBAN = '$IBAN'
order by date_transfer desc";
$result2 = $conn->query($sql2);
while($row2=$result2->fetch_assoc())
{
$nbsp = " ";
$euro = "€";
$date_transfer = $row2['date_transfer'];
$_from_customer_lastname = $row2['_from_customer_lastname'];
$_from_customer_firstname = $row2['_from_customer_firstname'];
$_from_customer_all_name = $_from_customer_lastname .$_from_customer_firstname;
$_from_customer_iban = $row2['_from_customer_IBAN'];
$_to_customer_lastname = $row2['_to_customer_lastname'];
$_to_customer_firstname = $row2['_to_customer_firstname'];
$_to_customer_all_name = $_to_customer_lastname .$_to_customer_firstname;
$_to_customer_iban = $row2['_to_customer_IBAN'];
$transaction_number = $row2['transaction_number'];
$amount = $row2['amount'];
$pdf->Cell(35,10,$date_transfer,1);
$pdf->Cell(40,10,$_from_customer_all_name,1);
$pdf->Cell(53,10,$_from_customer_iban,1);
$pdf->Cell(40,10,$_to_customer_all_name,1);
$pdf->Cell(53,10,$_to_customer_iban,1);
$pdf->Cell(35,10,$transaction_number,1);
$pdf->Cell(24,10,$amount,1);
$pdf->Ln();
}
$pdf->Output();
/*
duo eidh eksodou pdf
$pdf->Output('D','all_transactions.pdf'); //eksodos kateutheian me onoma
$pdf->Output(); // edw anoigo vlewpw kai meta katevazw kai allazw onoma
*/
} // end of else connect
$conn->close();
} // end of id class exists
} // end of else session
?>