Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbb0e60
commit 98aa5c9
Showing
4 changed files
with
60 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,73 @@ | ||
<?php include('header.phtml'); ?> | ||
|
||
<?php | ||
|
||
?> | ||
<h1><a href='/calculator' style=''><img src="<?=$vars['baseUrl']?>/images/bitcoin.png" width='35' style='margin-bottom:5px'></a> Bitcoin Savings Calculator</h1> | ||
|
||
<h1> | ||
<a href='/calculator' style=''> | ||
<img src="<?=$vars['baseUrl']?>/images/bitcoin.png" width='35' style='margin-bottom:5px'> | ||
</a> | ||
Bitcoin Savings Calculator | ||
</h1> | ||
|
||
<h3>Savings Plan</h3> | ||
|
||
<form method='get' class="form-inline"> | ||
|
||
What if I saved | ||
|
||
What if I saved | ||
$ <input class="form-control" style="width:100px" type='text' value='<?=$vars['amount']?>' size='6' name='amount'> | ||
as bitcoin every | ||
<select name='freq' class="form-control" style="width:90px"> | ||
<?php foreach ($vars['frequencies'] as $freqOption) { ?> | ||
<option <?=($vars['freq'] == $freqOption ? 'selected="true"' : '')?>"><?=$freqOption?></option> | ||
<?php } ?> | ||
</select> | ||
starting on | ||
<select name='month' style="width:120px" class="form-control"> | ||
<?php foreach ($vars['months'] as $monthOption) { ?> | ||
<option <?=($vars['month'] == $monthOption ? 'selected="true"' : '')?>"><?=$monthOption?></option> | ||
<?php } ?> | ||
</select> | ||
<input name='day' type='text' size='4' value='<?=$vars['day']?>' style="width:45px" class="form-control"></input>, | ||
<select name='year' style="width:90px" class="form-control"> | ||
<?php foreach ($vars['years'] as $yearOption) { ?> | ||
<option <?=($vars['year'] == $yearOption ? 'selected="true"' : '')?>"><?=$yearOption?></option> | ||
<?php } ?> | ||
</select> | ||
? | ||
|
||
<button type='submit' class='btn btn-primary' value='Calculate'>Calculate</button> | ||
<select name='freq' class="form-control" style="width:90px"> | ||
<?php foreach ($vars['frequencies'] as $freqOption) { ?> | ||
<option <?=($vars['freq'] == $freqOption ? 'selected="true"' : '')?>"><?=$freqOption?></option> | ||
<?php } ?> | ||
</select> | ||
starting on | ||
<select name='month' style="width:120px" class="form-control"> | ||
<?php foreach ($vars['months'] as $monthOption) { ?> | ||
<option <?=($vars['month'] == $monthOption ? 'selected="true"' : '')?>"><?=$monthOption?></option> | ||
<?php } ?> | ||
</select> | ||
<input name='day' type='text' size='4' value='<?=$vars['day']?>' style="width:45px" class="form-control"></input>, | ||
<select name='year' style="width:90px" class="form-control"> | ||
<?php foreach ($vars['years'] as $yearOption) { ?> | ||
<option <?=($vars['year'] == $yearOption ? 'selected="true"' : '')?>"><?=$yearOption?></option> | ||
<?php } ?> | ||
</select> | ||
? | ||
|
||
<button type='submit' class='btn btn-primary' value='Calculate'>Calculate</button> | ||
</form> | ||
|
||
<h3>Results</h3> | ||
|
||
<div class="alert alert-success lead" role="alert"> | ||
I would have <b><?=number_format($vars['totalCoins'], 4);?></b> bitcoin worth <b>$<?=number_format($vars['totalValue'], 2);?></b> today. | ||
I would have <b><?=number_format($vars['totalCoins'], 4);?></b> bitcoin | ||
worth <b>$<?=number_format($vars['totalValue'], 2);?></b> today. | ||
</div> | ||
|
||
<table class="table"> | ||
<tr style='background-color:lightblue;font-weight:bold'><td>Date</td><td>Spent So Far</td><td>Amount of Bitcoin I Own</td><td>Value of My Savings</td></tr> | ||
<?php foreach ($vars['results'] as $result) { ?> | ||
<tr> | ||
<td><?=$result['dateCasual']?></td> | ||
<td>$<?=number_format($result['totalSpent'], 2);?></td> | ||
<td><?=number_format($result['totalCoins'], 4);?></td> | ||
<td>$<?=number_format($result['totalValue'], 2);?></td></tr> | ||
<?php } ?> | ||
<tr style='background-color:lightblue;font-weight:bold'> | ||
<td>Date</td> | ||
<td>Spent So Far</td> | ||
<td>Amount of Bitcoin I Own</td> | ||
<td>Value of My Savings</td> | ||
</tr> | ||
<?php foreach ($vars['results'] as $result) { ?> | ||
<tr> | ||
<td><?=$result['dateCasual']?></td> | ||
<td>$<?=number_format($result['totalSpent'], 2);?></td> | ||
<td><?=number_format($result['totalCoins'], 4);?></td> | ||
<td>$<?=number_format($result['totalValue'], 2);?></td> | ||
</tr> | ||
<?php } ?> | ||
</table> | ||
|
||
<p><i>*Note: Does not include transaction fees. All calculations rounded. Price data from CoinDesk API.</i></p> | ||
<p><a href='https://github.com/thorie7912/bitcoin-calculator'>Help improve this calculator on GitHub!</a></p> | ||
<p> | ||
<i>*Note: Does not include transaction fees. All calculations rounded. Price data from CoinDesk API.</i> | ||
</p> | ||
|
||
<p> | ||
<a href='https://github.com/thorie7912/bitcoin-calculator'> | ||
Help improve this calculator on GitHub! | ||
</a> | ||
</p> | ||
|
||
<?php include('footer.phtml'); ?> |