diff options
| author | Adam Soltys <[email protected]> | 2012-10-23 10:28:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-10-23 10:28:49 -0700 |
| commit | b94145ff904315c48781f958f54fae1428ef60e6 (patch) | |
| tree | b31db13342939584d12b52e88bd83ce23c77571c /report.php | |
| parent | 5ec0a340957a90afe2bcf7073cc368eee77bf856 (diff) | |
| download | coinos-server-b94145ff904315c48781f958f54fae1428ef60e6.tar.gz coinos-server-b94145ff904315c48781f958f54fae1428ef60e6.zip | |
Clean up report, save transactions as JSON
Diffstat (limited to 'report.php')
| -rw-r--r-- | report.php | 76 |
1 files changed, 35 insertions, 41 deletions
@@ -3,52 +3,46 @@ <head> <meta charset="utf-8" /> <title>Bitcoin Payment Report</title> - <script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> - <style> - body, input { font-family: 'Arial'; font-size: 20px; } - body { width: 100% } - #total { font-size: 32px; } - table { width: 100%; } - td, th { min-width: 200px; text-align: left; } - </style> + <link href="css/bootstrap.min.css" rel="stylesheet" /> + <link href="css/bootstrap-responsive.min.css" rel="stylesheet" /> + <link href="css/jquery-ui-1.9.0.custom.min.css" rel="stylesheet" /> + <link href="css/report.css" rel="stylesheet" /> + <script src="js/jquery-1.8.2.min.js"></script> + <script src="js/jquery-ui-1.9.0.custom.min.js"></script> + <script src="js/bootstrap.min.js"></script> + <script src="js/searchjs.js"></script> + <script src="js/report.js"></script> </head> <body> <div id="container"> Date: <input id="date" name="date" type="text" /> - <table> - <tr> - <th>Date</th> - <th>Address</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><? 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 class="table"> + <thead> + <tr> + <th>Date</th> + <th>Address</th> + <th>Exchange Rate</th> + <th>BTC</th> + <th>CAD</th> + </tr> + </thead> + <tbody> + <tr> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> + </tbody> + <tfoot> + <tr> + <td id="total" colspan="3">Totals:</td> + <td id="btc"></td> + <td id="cad"></td> + </tr> + </tfoot> </table> - <br /> - <b> - Total BTC: <? echo $total_amount . "<br />\n"; ?> - Total CAD: <? echo $total_value . "<br />\n"; ?> - </b> </div> </body> </html> |
