-
Notifications
You must be signed in to change notification settings - Fork 0
/
function.php
44 lines (38 loc) · 1.12 KB
/
function.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
function convertBtcToSatoshi($value)
{
return $value * 100000000;
}
function printBTC($value)
{
return number_format(($value) * (pow(10, -8)), 8, '.', '');
}
function printDolar($value)
{
return number_format($value, 2, '.', '');
}
function convertSatoshiToBtc($value)
{
return $value/100000000;
}
function checkCurrency($currency) {
$currencys = file('http://www.cnb.cz/cs/financni_trhy/devizovy_trh/kurzy_devizoveho_trhu/denni_kurz.txt');
foreach ($currencys as $v) {
$h = explode("|", $v);
if ((count($h) >= 5) && ($h[3] == $currency)) {
return str_replace(",", '.', $h[4]);
}
}
}
function templateStyle()
{
$template = '<style>
#mail { width: 600px; margin: 0 auto; position: relative; }
table { border-collapse: collapse; border: 1px solid #aaa; width: 100%; }
table td, table th { border-collapse: collapse; border: 1px solid #aaa; padding: 5px; margin: 0; }
table td { text-align: right; }
table th { background: #eee; text-align: left; }
table th.date { width: 80px; }
</style>';
return $template;
}