-
Notifications
You must be signed in to change notification settings - Fork 0
/
summary.php
138 lines (108 loc) · 4.23 KB
/
summary.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
$powerbyAlgo= $stats->powerbyAlgo($alldata['rigs']);
//hash summary by Algorithm
$hashbyAlgo= $stats->sumbyAlgo($alldata['per_info']);
$callWTM->wtmLink($hashbyAlgo,$powerbyAlgo);
$callWTM->sendRequestwithParams();
//echo $callWTM->url;
?>
<div id = "intro" class="jumbotron jumbotron-fluid text-white text-center">
<?php
//validate wtm api call
if($callWTM->error || $callWTM->json_error){
$display_calculator = false;
echo $callWTM->error_message."<br/>";
echo $callWTM->url;
}
else {
$display_calculator = true;
$response = $callWTM->response_content;
$calculator= new wtmCalculator();
//organise coins in array - coininfo
$calculator->coinsByAlgo($response);
//sorted coins
//$calculator->coinsSorted($response);
//get deafulat rates as array - defaults
$calculator->wtmDefaults();
//power by Algo
//$powerbyAlgo= $stats->powerbyAlgo($alldata['rigs']);
//hash summary by Algorithm
//$hashbyAlgo= $stats->sumbyAlgo($alldata['per_info']);
}
//get total power
$sum_power = $stats->totalPower($alldata["rigs"]);
//if($o->error ) echo "<h4>".$o->error_message."</h4>";
//else{
$tlabels = array("hashrate"=>$pagecontent["label7"],"gpus"=>$pagecontent["label5"],"total_alive" =>$pagecontent["label4"], "rigs"=>$pagecontent["label3"],"capacity"=>$pagecontent["label12"], "sum_power"=>$pagecontent["label17"]);
$tvalues = array("hashrate"=>$alldata["total_hash"],"alive_gpus"=>$alldata["alive_gpus"],"total_gpus" =>$alldata["total_gpus"], "alive_rigs"=>$alldata["alive_rigs"],"total_rigs"=>$alldata["total_rigs"],"capacity"=>$alldata["capacity"], "sum_power"=>$sum_power);
?>
<!-- Tital Hash, Capacity, Ris and GPus -->
<div class="summary_wrapper">
<?php
if($display_calculator){
?>
<div class="summary_block">
<?php
//echo $s->displayMilestonePeriod($calculator->get1BTCdays($calculator->coininfo, $hashbyAlgo, $calculator->defaults), $pagecontent["forecast"],$pagecontent["1btcforecast"]);
echo $s->displayMilestonePeriod($calculator->get1BTCdays2($calculator->coininfo, $hashbyAlgo), $pagecontent["forecast"],$pagecontent["1btcforecast"]);
?>
</div>
<?php
}
?>
<div class="summary_block">
<?php
$s->totalInfo($tvalues, $tlabels) ;
//$s->sumhashInfo($stats->sumbyAlgo($alldata['per_info']));
?>
</div>
</div>
<?php
//$s->sumhashInfo($stats->sumbyAlgo($alldata['per_info']));
if($display_calculator){
?>
<div class="summary_wrapper">
<div class="summary_block">
<h5><?php echo $pagecontent["calculator"]; ?></h5>
<?php
//$s->totalInfo($tvalues, $tlabels) ;
foreach($stats->sumbyAlgo($alldata['per_info']) as $algo=>$hash){
//echo "<div style=\"text-align:left;\"><span>".$algo."</span><br/>";
//$s->displayHashStats($algo,$hash);
//echo '<pre>' . print_r($calculator->coininfo[$algo], true) . '</pre>';
//echo $s->displayCalculator($hash, $calculator->coininfo[$algo], $calculator->defaults[$algo],$algo, $powerbyAlgo[$algo]);
echo $s->displayCalculatorParams($hash, $calculator->coininfo[$algo],$algo, $powerbyAlgo[$algo], sizeof($calculator->coininfo));
//echo "</div>";
}
echo $s->wtmLink($hashbyAlgo, $powerbyAlgo, $pagecontent["poweredby"], $pagecontent["wtmlinknote"]);
?>
</div></div>
<?php
//echo "CURL Error: ".$callapi->error_message." error code:".$callapi->error_code."<br/>";
//echo "Cannot get data for coins info.";
}else{
//echo "Respones status code:".$callapi->curl_status_code;
}
?>
<div class="summary_wrapper">
<div class="summary_block">
<?php
foreach($stats->sumbyAlgo($alldata['per_info']) as $algo=>$hash){
$s->displayHashStats($algo,$hash);
}
?>
</div>
<div class="summary_block">
<h5><?php echo $pagecontent["label21"]; ?></h5>
<?php
$miners_summary = $alldata['per_info'];//information from miners as per_info
$pools_stats=$stats->minerPools($alldata['rigs']);
//$miners_details =
foreach($miners_summary as $algo_miner=>$sum_info){
$s->summaryMiner($algo_miner, get_algo($algo_miner), $pagecontent["label21"]);
$s->minerPool($pools_stats[$algo_miner]);
}
?>
</div>
</div>
</div>