aboutsummaryrefslogtreecommitdiffstats
path: root/js/report.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2012-10-23 17:29:29 +0000
committerAdam Soltys <[email protected]>2012-10-23 17:29:29 +0000
commit98ecfec09563811bc65c2bd86b27e77fa2823da0 (patch)
tree7acad5c23b92305f1f70e593be39059c544865f2 /js/report.js
parentc4cf80845afd2d7d6862074060c00eceea51bad8 (diff)
parentb94145ff904315c48781f958f54fae1428ef60e6 (diff)
downloadcoinos-server-98ecfec09563811bc65c2bd86b27e77fa2823da0.tar.gz
coinos-server-98ecfec09563811bc65c2bd86b27e77fa2823da0.zip
Merge branch 'master' of https://github.com/asoltys/bitcoin_pos
Diffstat (limited to 'js/report.js')
-rw-r--r--js/report.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/report.js b/js/report.js
new file mode 100644
index 00000000..6cacf077
--- /dev/null
+++ b/js/report.js
@@ -0,0 +1,29 @@
+$(function() {
+ $('#date').datepicker();
+
+ $.getJSON('transactions.json', function(data) {
+ $.each(data.transactions, function() {
+ var keys = Object.keys(this);
+ var transaction = this;
+
+ $.each(keys, function(i,v) {
+ $('tbody tr:last td:eq(' + i + ')').html(transaction[v]);
+ });
+
+ $('tbody:last').append($('tbody tr:last').clone());
+ });
+ $('tbody tr:last').remove();
+
+ var btc = 0;
+ $('td:nth-child(4)').each(function() {
+ btc += parseFloat($(this).html());
+ });
+ $('#btc').html(btc);
+
+ var cad = 0;
+ $('td:nth-child(5)').each(function() {
+ cad += parseFloat($(this).html());
+ });
+ $('#cad').html(cad);
+ });
+});