forked from gea-ecobricks/ecobricks-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetails-brk-trans.php
More file actions
409 lines (299 loc) · 13.9 KB
/
details-brk-trans.php
File metadata and controls
409 lines (299 loc) · 13.9 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
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<!--Content Includes Page template: v.1.0.2-->
<?php require_once ("lang.php");
echo <<<_END
<!DOCTYPE html>
<!-- this grabs the language identifier for the page so that it can used in the meta and canonical url variables-->
<html lang="$lang">
_END;?>
<HEAD>
<!-- PHP starts by laying out canonical URLs for the page and language -->
<META NAME="robots" CONTENT="noindex">
<?php
$parts = explode ("/", $_SERVER['SCRIPT_NAME']);
$name = $parts [count($parts)-1];
;?>
<meta charset="utf-8"> <!--OBSOLETE BUT MUST BE ADDED TO ALL OTHER PAGES FIRST-->
<link rel="canonical" href="https://www.ecobricks.org/<?php echo ($lang); ;?>/<?php echo ($name); ;?>">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link rel="alternate" href="https://ecobricks.org/en/<?php echo ($name); ;?>" hreflang="en" />
<link rel="alternate" href="https://ecobricks.org/id/<?php echo ($name); ;?>" hreflang="id" />
<link rel="alternate" href="https://ecobricks.org/es/<?php echo ($name); ;?>" hreflang="es" />
<link rel="alternate" href="https://ecobricks.org/fr/<?php echo ($name); ;?>" hreflang="fr" />
<link rel="alternate" href="http://ecobricks.org/en/<?php echo ($name); ;?>" hreflang="x-default" />
<!-- Arc CDN Script without delay
<script async src="https://arc.io/widget.min.js#Z7EC7Cze"></script>-->
<!-- This calls our Github hosted stylesheet - if it gets hopelessly cached and doesn't load, up the version number! -->
<link rel="stylesheet" type="text/css" href="http://ecobricks.org/stylesheet-general.css?v0.7">
<!-- This calls GEA typography -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!-- Mulish loads first for first page view-->
<link href="https://fonts.googleapis.com/css2?family=Mulish:wght@300;500&display=swap" rel="stylesheet" media="print" onload="this.media='all'">
<!-- Arvo loads very last to speed up first load. See the script in the footer that triggers this
<noscript>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Arvo&display=swap" />
</noscript>
<link href="https://fonts.googleapis.com/css2?family=Arvo&display=swap" rel="stylesheet" media="print" onload="this.media='all'">-->
<!-- This calls our webmanifest wich turns our page into a progress web app (PWA)
<link rel="manifest" href="manifest.webmanifest">-->
<!-- This allows Ecobricks.org to be used a PWA on iPhones
<meta name="apple-mobile-web-app-capable" content="yes">-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1.8, target-densitydpi=160, maximum-scale=1, user-scalable = no">
-->
<!-- WHAT"S THIS? <meta http-equiv="Cache-control" content="no-store" Cache-Control: private, max-age=604800>
-->
<meta name="apple-mobile-web-app-title" content="Ecobricks.org">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- This calls GEA typography -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!-- Mulish loads first for first page view-->
<link href="https://fonts.googleapis.com/css2?family=Mulish:wght@300;500&display=swap" rel="stylesheet" media="print" onload="this.media='all'">
<!-- Arvo loads very last to speed up first load. See the script in the footer that triggers this -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Arvo&display=swap" />
<!-- This calls our Github hosted stylesheet - if it gets hopelessly cached and doesn't load, up the version number! -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
button {
margin-top: 15px;
font-size: 1.3em;
padding: 8px 10px 8px 10px;
float: right;
margin-bottom: 20px;
/*background: #ded9d9;
border-radius: 8px;
border: none;
margin-bottom: 15px;
border: 1px;
border-color: grey;*/
}
#main-details {
background-color: #ded9d9;
margin-top: 10px;
margin-bottom: 20px;
margin-right: 0px;
margin-left: -7px;
width: 100%;
padding: 5% 5% 5% 5%;
}
#details-content {
margin: auto;
box-sizing: border-box;
width: 90%;
}
.transaction {
font-size: 1.1em;
font-family: 'Mulish', Arial, Helvetica, sans-serif;
color: #222222;
line-height: 1.2;
font-weight: 400;
margin-top: 40px;
}
.block {
font-size: 3.2em;
font-family: 'Arvo', Georgia, sans-serif;
color: black;
line-height: 1.3;
}
.type {
font-size: 1.3em;
font-family: 'Arvo', Georgia, sans-serif;
color: black;
line-height: 1.3;
font-weight: bolder;
padding-bottom: 15px;
}
.amount {
font-size: 1.6em;
font-family: 'Mulish', Arial, Helvetica, sans-serif;
color: #222222;
line-height: 1.3;
font-weight: 300
}
.status {
font-size: 1.6em;
font-family: 'Mulish', Arial, Helvetica, sans-serif;
color: #222222;
line-height: 1.4;
font-weight: 300
}
.general-field {
font-size: 1.3em;
font-family: 'Mulish', Arial, Helvetica, sans-serif;
color: #222222;
line-height: 1.3;
margin-top: 12px;
font-weight: 300;
}
#data-chunk {
padding: 15px;
background: #e6f3ff;}
.trans-data p{
font-size: 0.9em;
font-family: 'Courier New', monospace !important;
color: #222222;
line-height: 1.3;
margin-top: 12px;
/*font-weight: 300;*/
background: aliceblue;
padding: 10px;
border-radius: 5px;
}
b {
font-weight: bold !important;
}
strong {
font-weight: bold !important;
}
b {font-weight: 500;}
</style>
</head>
<BODY id="full-page">
<div id="details-content">
<a name="top"></a>
<button onClick="javascript:window.close('','_parent','');">Close & Return</button><br><br>
<!-- The DB connection creator -->
<?php include 'ecobricks_env.php';?>
<?php
// Get the contents from the Transaction table as an ordered View, using the transaction id from the URL.
$transactionId = $_GET['tran_id'];
$sql = "SELECT * FROM vw_brk_tran_ledgerid_asc WHERE chain_ledger_id = " . $transactionId;
$result = $conn->query($sql);
if ($result->num_rows > 0) {
//echo "</br><h3>" . $transactionId . "</h1>";
// Output data of each row
while($array = $result->fetch_assoc()) {
echo " <div class=\"transaction\"><b>Chain Ledger ID:</b> " . $array["chain_ledger_id"] . " </div></div><div id=\"main-details\">" ;
if ( isset($array["block_amt"]) && $array["block_amt"] != '0' ) {
echo " <div class=\"block\"><b>Block:</b> " . $array["block_amt"] ." ß</var></div>" ;
}
echo " <div class=\"type\">" . $array["block_tran_type"] . "</div>" ;
echo " <div class=\"amount\"><b>Transfer amount:</b> <var>" . $array["individual_amt"] . " ß</var></div>" ;
if ( isset($array["ecobrick_serial_no"]) && $array["ecobrick_serial_no"] != '' ) {
echo ' <div class="status"><b>Authenticated Ecobrick:</b> <a href="details-ecobrick-page.php?serial_no=' . $array["ecobrick_serial_no"] . '" target="_parent">' . $array["ecobrick_serial_no"] . '</a></var></div>';
}
echo " <div class=\"status\"><b>Generated:</b> " . $array["send_ts"] . "</div>" ;
echo " <div class=\"status\"><b>Status:</b> " . $array["status"] . "</div></div><div id=\"details-content\">" ;
//DETAILS
echo '<div class="trans-data">
<p><b>>> Raw BRK Transaction Record</b></p>';
echo " <p><strong>Chain Ledger ID:</strong>" . $array["chain_ledger_id"] ."</p>" ;
echo " <p><strong>Legacy Tran ID:</strong>" . $array["tran_id"] ."</p>" ;
if ( isset($array["tran_name"]) && $array["tran_name"] != '' ) {
echo " <p><strong>Tran name: </strong>" . $array["tran_name"] ."</p>" ;
}
if ( isset($array["individual_amt"]) && $array["individual_amt"] != '' ) {
echo " <p><strong>Indiv Amt: </strong>" . $array["individual_amt"] ."</p>" ;
}
if ( isset($array["status"]) && $array["status"] != '' ) {
echo " <p><strong>Status: </strong>" . $array["status"] ."</p>" ;
}
if ( isset($array["send_ts"]) && $array["send_ts"] != '' ) {
echo " <p><strong>Authenticated: </strong>" . $array["send_ts"] ."</p>" ;
}
if ( isset($array["sender_ecobricker"]) && $array["sender_ecobricker"] != '' ) {
echo " <p><strong>sender_ecobricker: </strong>" . $array["sender_ecobricker"] ."</p>" ;
}
if ( isset($array["block_tran_type"]) && $array["block_tran_type"] != '' ) {
echo " <p><strong>block_tran_type: </strong>" . $array["block_tran_type"] ."</p>" ;
}
if ( isset($array["block_amt"]) && $array["block_amt"] != '0' ) {
echo " <p><strong>block_amt: </strong>" . $array["block_amt"] ."</p>" ;
}
if ( isset($array["sender"]) && $array["sender"] != '' ) {
echo " <p><strong>sender: </strong>" . $array["sender"] ."</p>" ;
}
if ( isset($array["receiver_or_receivers"]) && $array["receiver_or_receivers"] != '' ) {
echo " <p><strong>receiver_or_receivers: </strong>" . $array["receiver_or_receivers"] ."</p>" ;
}
if ( isset($array["receiver_1"]) && $array["receiver_1"] != '' ) {
echo " <p><strong>receiver_1: </strong>" . $array["receiver_1"] ."</p>" ;
}
if ( isset($array["receiver_2"]) && $array["receiver_2"] != '' ) {
echo " <p><strong>receiver_2: </strong>" . $array["receiver_2"] ."</p>" ;
}
if ( isset($array["receiver_1"]) && $array["receiver_1"] != '' ) {
echo " <p><strong>receiver_3: </strong>" . $array["receiver_3"] ."</p>" ;
}
if ( isset($array["receiver_central_reserve"]) && $array["receiver_central_reserve"] != '' ) {
echo " <p><strong>receiver_central_reserve: </strong>" . $array["receiver_central_reserve"] ."</p>" ;
}
if ( isset($array["sender_central_reserve"]) && $array["sender_central_reserve"] != '' ) {
echo " <p><strong>sender_central_reserve: </strong>" . $array["sender_central_reserve"] ."</p>" ;
}
if ( isset($array["ecobrick_serial_no"]) && $array["ecobrick_serial_no"] != '0' ) {
echo " <p><strong>ecobrick_serial_no: </strong>" . $array["ecobrick_serial_no"] ."</p>" ;
}
if ( isset($array["tran_sender_note"]) && $array["tran_sender_note"] != '' ) {
echo " <p><strong>tran_sender_note: </strong>" . $array["tran_sender_note"] ."</p>" ;
}
if ( isset($array["product"]) && $array["product"] != '' ) {
echo " <p><strong>product: </strong>" . $array["product"] ."</p>" ;
}
if ( isset($array["send_dt"]) && $array["send_dt"] != '' ) {
echo " <p><strong>send_dt: </strong>" . $array["send_dt"] ."</p>" ;
}
if ( isset($array["accomp_payment"]) && $array["accomp_payment"] != '' ) {
echo " <p><strong>accomp_payment: </strong>" . $array["accomp_payment"] ."</p>" ;
}
if ( isset($array["authenticator_version"]) && $array["authenticator_version"] != '' ) {
echo " <p><strong>authenticator_version: </strong>" . $array["authenticator_version"] ."</p>" ;
}
if ( isset($array["expense_type"]) && $array["expense_type"] != '' ) {
echo " <p><strong>expense_type: </strong>" . $array["expense_type"] ."</p>" ;
}
if ( isset($array["gea_accounting_category"]) && $array["gea_accounting_category"] != '' ) {
echo " <p><strong>gea_accounting_category: </strong>" . $array["gea_accounting_category"] ."</p>" ;
}
if ( isset($array["shipping_brk_cost"]) && $array["shipping_brk_cost"] != '0' ) {
echo " <p><strong>shipping_brk_cost: </strong>" . $array["shipping_brk_cost"] ."</p>" ;
}
if ( isset($array["product_cost_brk"]) && $array["product_cost_brk"] != '0' ) {
echo " <p><strong>product_cost_brk: </strong>" . $array["product_cost_brk"] ."</p>" ;
}
if ( isset($array["total_cost_incl_shipping"]) && $array["total_cost_incl_shipping"] != '0' ) {
echo " <p><strong>total_cost_incl_shipping: </strong>" . $array["total_cost_incl_shipping"] ."</p>" ;
}
if ( isset($array["shipping_with_currency"]) && $array["shipping_with_currency"] != '0' ) {
echo " <p><strong>shipping_with_currency: </strong>" . $array["shipping_with_currency"] ."</p>" ;
}
if ( isset($array["aes_officially_purchased"]) && $array["aes_officially_purchased"] != '0' ) {
echo " <p><strong>aes_officially_purchased: </strong>" . $array["aes_officially_purchased"] ."</p>" ;
}
if ( isset($array["country_of_buyer"]) && $array["country_of_buyer"] != '' ) {
echo " <p><strong>country_of_buyer: </strong>" . $array["country_of_buyer"] ."</p>" ;
}
if ( isset($array["currency_for_shipping"]) && $array["currency_for_shipping"] != '' ) {
echo " <p><strong>currency_for_shipping: </strong>" . $array["currency_for_shipping"] ."</p>" ;
}
if ( isset($array["credit_other_ecobricker_yn"]) && $array["credit_other_ecobricker_yn"] != '' ) {
echo " <p><strong>credit_other_ecobricker_yn: </strong>" . $array["credit_other_ecobricker_yn"] ."</p>" ;
}
if ( isset($array["catalyst"]) && $array["catalyst"] != '' ) {
echo " <p><strong>catalyst: </strong>" . $array["catalyst"] ."</p>" ;
}
}
} else {
echo "<div id=\"main-details\"><div class=\"serial\">Sorry :-(</div></div><div id=\"details-content\"><div class=\"general-field\">No results found for transaction ID $transactionId.</div>";
}
$conn->close();
?>
<br><br>
</body>
</html>