diff options
| author | Adam Soltys <[email protected]> | 2012-10-04 21:32:11 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-10-04 21:32:11 -0700 |
| commit | 72cb78448372860c0b96f31edfc9958114fd94c9 (patch) | |
| tree | 2db5bed1e9e5231a8ddac2f817bafb0c3817e1e2 | |
| parent | 17c4c05b2398e7fc86fef90699308c7526125800 (diff) | |
| download | coinos-server-72cb78448372860c0b96f31edfc9958114fd94c9.tar.gz coinos-server-72cb78448372860c0b96f31edfc9958114fd94c9.zip | |
Transactions report
| -rw-r--r-- | report.php | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -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> |
