-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransactions.php
42 lines (41 loc) · 1.73 KB
/
transactions.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
<?php
require 'includes/header.php';
$transactions = $pheal->WalletTransactions(array('characterID' => $apiKeys['charId']))->toArray()['result']['transactions'];
?>
<h1>TRANSACTIONS</h1>
<table border="1">
<tr>
<td>WHEN</td>
<td>TYPE</td>
<td>PRICE</td>
<td>QTY</td>
<td>CREDIT</td>
<td>WHO</td>
<td>WHERE</td>
</tr>
<?php foreach ($transactions as $trans): ?>
<tr>
<td><?=$trans['transactionDateTime'] ?></td>
<td>
<?php
$stmt = $db->prepare('SELECT typeName FROM invTypes WHERE typeID = ?');
$stmt->bind_param('i', $trans['typeID']);
$stmt->execute();
$typeName = $stmt->get_result()->fetch_assoc()['typeName'];
print $typeName;
?>
</td>
<td><?=$trans['price'] ?></td>
<td><?=$trans['quantity'] ?></td>
<td style="<?php print $trans['transactionType'] == 'buy' ? 'color: red;' : 'color: green;'; ?>">
<?php
$credit = $trans['quantity'] * $trans['price'];
print $trans['transactionType'] == 'buy' ? '-' : '';
print number_format($credit) . ' ISK';
?>
</td>
<td><?=$trans['clientName'] ?></td>
<td><?=$trans['stationName'] ?></td>
</tr>
<?php endforeach; ?>
</table>