aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2012-10-04 21:32:11 -0700
committerAdam Soltys <[email protected]>2012-10-04 21:32:11 -0700
commit72cb78448372860c0b96f31edfc9958114fd94c9 (patch)
tree2db5bed1e9e5231a8ddac2f817bafb0c3817e1e2
parent17c4c05b2398e7fc86fef90699308c7526125800 (diff)
downloadcoinos-server-72cb78448372860c0b96f31edfc9958114fd94c9.tar.gz
coinos-server-72cb78448372860c0b96f31edfc9958114fd94c9.zip
Transactions report
-rw-r--r--report.php33
1 files changed, 28 insertions, 5 deletions
diff --git a/report.php b/report.php
index e8282748..addf39da 100644
--- a/report.php
+++ b/report.php
@@ -18,16 +18,39 @@
<tr>
<th>Date</th>
<th>Address</th>
- <th>Amount</th>
<th>Exchange Rate</th>
+ <th>BTC</th>
+ <th>CAD</th>
</tr>
+<?
+$row = 1;
+if (($handle = fopen("transactions.csv", "r")) !== FALSE) {
+ $total_amount = 0;
+ $total_value = 0;
+ while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
+ $num = count($data);
+ $row++;
+ $value = $data[2] * $data[3];
+ $total_amount += $data[2];
+ $total_value += $value;
+?>
<tr>
- <td>2012-01-01</td>
- <td>2134623421lkwfkjhg</td>
- <td>500</td>
- <td>12.40</td>
+ <td><? echo $data[1] . "<br />\n"; ?></td>
+ <td><? echo $data[0] . "<br />\n"; ?></td>
+ <td><? echo $data[3] . "<br />\n"; ?></td>
+ <td><? echo $data[2] . "<br />\n"; ?></td>
+ <td>$<? echo $value . "<br />\n"; ?></td>
</tr>
+<?
+ }
+}
+?>
</table>
+<br />
+<b>
+ Total BTC: <? echo $total_amount . "<br />\n"; ?>
+ Total CAD: <? echo $total_value . "<br />\n"; ?>
+</b>
</div>
</body>
</html>