From b94145ff904315c48781f958f54fae1428ef60e6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 23 Oct 2012 10:28:49 -0700 Subject: Clean up report, save transactions as JSON --- record_transaction.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'record_transaction.php') diff --git a/record_transaction.php b/record_transaction.php index 4640f21d..bd858b76 100644 --- a/record_transaction.php +++ b/record_transaction.php @@ -1,13 +1,17 @@ $_GET['address'], + 'date'=> $_GET['date'], + 'received'=> $_GET['received'], + 'exchange'=> $_GET['exchange'], + 'value'=> $_GET['received'] * $_GET['exchange'] +); -foreach ($list as $fields) { - fputcsv($fp, $fields); -} +$json = json_decode(file_get_contents($file)); +array_push($json->transactions, $transaction); +file_put_contents($file, json_encode($json)); -fclose($fp); ?> -- cgit v1.2.3