forked from TezosRio/taps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rewards.cfm
executable file
·108 lines (82 loc) · 3.96 KB
/
rewards.cfm
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
<cfif not isUserLoggedIn()>
<cflocation url="index.cfm">
</cfif>
<cfscript>
setLocale("English (us)");
</cfscript>
<cfset reload = true>
<!--- Get the pending rewards cycle that is registered in current local database --->
<cfinvoke component="components.database" method="getLocalPendingRewardsCycle" returnVariable="localPendingRewardsCycle">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="cache-control" content="no-cache">
<!-- CSS Bootstrap-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<!-- CSS Page-->
<link rel="stylesheet" type="text/css" href="css/estilo.css">
<script src="js/jquery-3.2.1.min.js"></script>
<script language="javascript">
var reload = true;
</script>
</head>
<body>
<section class="box-content-rewards">
<cfoutput>
<h1 class="title-baker">
Rewards
</h1>
<!--- Check if all data were fetched --->
<cfinvoke component="components.database" method="getSettings" returnVariable="settings">
<cfif #settings.recordCount# GT 0>
<cfif #settings.mode# NEQ "off">
<cfif #settings.status# EQ true>
<cfset reload = false>
<!--- Get baker's rewards and store them in memory cache --->
<cfinvoke component="components.tezosGateway" method="getRewards" bakerID="#application.bakerId#" returnVariable="rewards">
<table class="table table-taps-rewards" style="width:80%;margin-left:80px;">
<thead class="head-table-taps">
<tr>
<th style="text-align:center;" scope="col">Cycle Number</th>
<th style="text-align:center;" scope="col">Rewards Status</th>
</tr>
</thead>
<tbody>
<cfloop from="1" to="#rewards.recordCount#" step="1" index="i">
<tr style="line-height:8px;">
<td align="center" style="background-color:<cfif #rewards.status[i]# EQ "rewards_delivered">##dff0d8<cfelseif #rewards.status[i]# EQ "rewards_pending"><cfif #rewards.cycle[i]# NEQ #localPendingRewardsCycle#>##fcf8e3<cfelse>##fcc3c3</cfif><cfelseif #rewards.status[i]# EQ "cycle_in_progress">##d9edf7<cfelseif #rewards.status[i]# EQ "cycle_pending">##f0f0f0</cfif>">#rewards.cycle[i]#</td>
<td align="center" style="background-color:<cfif #rewards.status[i]# EQ "rewards_delivered">##dff0d8<cfelseif #rewards.status[i]# EQ "rewards_pending"><cfif #rewards.cycle[i]# NEQ #localPendingRewardsCycle#>##fcf8e3<cfelse>##fcc3c3</cfif><cfelseif #rewards.status[i]# EQ "cycle_in_progress">##d9edf7<cfelseif #rewards.status[i]# EQ "cycle_pending">##f0f0f0</cfif>">#rewards.status[i]#</td>
</tr>
</cfloop>
</tbody>
</table>
<cfelse>
<br><br><br><br><br><br>
<table width="100%">
<tr><td align="center"><img src="imgs/spin.gif" width="50" height="50"><br></td></tr>
<tr style="line-height:30px;text-align:center;"><td align="center">Fetching... Please wait</td></tr>
</table>
</cfif>
<cfelse>
<br>
TAPS status is set to OFF.<br>
Please go to menu option STATUS and choose another option.<br>
</cfif>
<cfelse>
<br>
There is no configuration saved on settings.<br>
Please go to SETUP first.<br>
</cfif>
</cfoutput>
</section>
<cfif #reload# EQ true>
<!--- Reload page until fetch completed --->
<script language="javascript">
setTimeout(function(){ location.reload(); }, 5000);
</script>
</cfif>
</body>
</html>