Commit bdb433cf authored by Kalinka's avatar Kalinka

Update

parent 9f391389
......@@ -19,9 +19,9 @@ class AccountController extends AbstractController
a.creation_height AS first_block,
a.height AS last_block,
FORMAT(a.forged_balance/ 100000000, 2) as forged_balance,
FORMAT(( SELECT SUM(b.total_fee) FROM block b WHERE generator_id = a.id)/ 100000000, 2) AS pool_balance_fee,
(( SELECT SUM(b.total_fee) FROM block b WHERE generator_id = a.id)/ 100000000) AS pool_balance_fee,
( SELECT SUM(FLOOR(pow(0.95,FLOOR(b.height/10800))*10000)) FROM block b WHERE b.generator_id = a.id) AS pool_balance_forged,
( SELECT rid.recipient_id
( SELECT CAST(rid.recipient_id AS UNSIGNED)
FROM transaction rid
WHERE rid.type = 20 AND rid.height <= ? -3 AND rid.sender_id = a.id
ORDER BY rid.height DESC
......@@ -50,7 +50,6 @@ class AccountController extends AbstractController
) as moss ) AS mos_recieved
FROM account a
WHERE CAST(a.id AS UNSIGNED) = ? AND a.latest = 1';
// input: max-height, max-height, account-id
private $entityManager;
......
This diff is collapsed.
......@@ -36,5 +36,24 @@
</div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<ul class="nav nav-tabs" id="accountTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ (account.count_sent + account.tx_count + account.mo_count + account.mos_count) }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="asset-tab" data-toggle="tab" href="#asset" role="tab" aria-controls="asset" aria-selected="false">Asset Transfers</a>
</li>
</ul>
<div class="tab-content" id="accountTabContent">
<div class="tab-pane fade show active" id="tx" role="tabpanel" aria-labelledby="tx-tab">
<div class="include-html" id="tx-list" include-html="{{ url('transactions_by_accountId', {'id': account.id }) }}">Loading....</div>
</div>
<div class="tab-pane fade" id="asset" role="tabpanel" aria-labelledby="asset-tab">Asset, to be done</div>
</div>
</div>
<div class="col-md-2"></div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -61,7 +61,7 @@
</ul>
<div class="tab-content" id="blockTabContent">
<div class="tab-pane fade show active" id="tx" role="tabpanel" aria-labelledby="tx-tab">
{{ render_hinclude(url('transactions_by_height', {'height': block.height }), {'default': 'Loading....'}) }}
{{ render_hinclude(url('transactions_by_blockId', {'id': block.id }), {'default': 'Loading....'}) }}
</div>
<div class="tab-pane fade" id="asset" role="tabpanel" aria-labelledby="asset-tab">Asset, to be done</div>
</div>
......
<script src="{{ asset('dev/jquery-3.4.1.min.js') }}"></script>
<script src="{{ asset('dev/bootstrap.bundle.js') }}"></script>
<script src="{{ asset('dev/hinclude.js') }}"></script>
\ No newline at end of file
<script src="{{ asset('dev/hinclude.js') }}"></script>
<script>
function includeHTML() {
var z, i, elmnt, file, xhttp;
/* Loop through a collection of all HTML elements: */
z = document.getElementsByClassName("include-html");
for (i = 0; i < z.length; i++) {
elmnt = z[i];
/*search for elements with a certain atrribute:*/
file = elmnt.getAttribute("include-html");
if (file) {
/* Make an HTTP request using the attribute value as the file name: */
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
/* Remove the attribute, and call this function once more: */
elmnt.removeAttribute("include-html");
includeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
/* Exit the function: */
return;
}
}
}
// without jQuery (doesn't work in older IEs)
document.addEventListener('DOMContentLoaded', function(){
includeHTML();
}, false);
function nextPage(element_id, url) {
elem = document.getElementById(element_id);
elem.setAttribute('include-html', url);
elem.innerText = 'Loading....';
includeHTML();
}
</script>
\ No newline at end of file
<ul class="pagination">
{% if 0 not in pageLinks %}
<li class="page-item">
<a class="page-link" href="#" onclick="nextPage('tx-list', '{{ path(route, {'id': id, 'page': 0 }) }}')">
1
</a>
</li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
{% endif %}
{% if page != 0 %}
<li class="page-item">
<a class="page-link" href="#" onclick="nextPage('tx-list', '{{ path(route, {'id': id, 'page': page - 1 }) }}')">
&laquo;
</a>
</li>
{% endif %}
{% for pageLink in pageLinks %}
{% if pageLink != page %}
<li class="page-item">
<a class="page-link" href="#" onclick="nextPage('tx-list', '{{ path(route, {'id': id, 'page': pageLink }) }}')">
{{ pageLink + 1 }}</a>
</li>
{% else %}
<li class="page-item active"><span class="page-link">{{ pageLink + 1 }}</span></li>
{% endif %}
{% endfor %}
{% if page != lastPage %}
<li class="page-item">
<a class="page-link" href="#" onclick="nextPage('tx-list', '{{ path(route, {'id': id, 'page': page + 1 }) }}')">
&raquo;
</a>
</li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
<li class="page-item">
<a class="page-link" href="#" onclick="nextPage('tx-list', '{{ path(route, {'id': id, 'page': lastPage, }) }}')">
{{ lastPage + 1 }}
</a>
</li>
{% endif %}
</ul>
<table class="table table-striped table-bordered table-hover table-sm">
<thead>
<th>ID</th>
......@@ -23,10 +63,8 @@
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
{% elseif transaction.mo_count is not null %}
{{ transaction.mo_count }} Recipients, <a href="#">Details</a>
{% elseif transaction.mosr_count is not null %}
{{ transaction.mosr_count }} Recipients, <a href="#">Details</a>
{% else%}
Multiple Recipients, <a href="#">Details</a>
{% endif %}
</td>
<td>{{ transaction.amount }}</td>
......
......@@ -64,10 +64,69 @@ BEGIN
WHERE bi.height = in_height;
END$$
DELIMITER ;
-- run "php bin/console explorer:import:blockinfo" afterwards
DELIMITER $$
CREATE FUNCTION getTransactionType(type tinyint(4), subtype tinyint(4))
RETURNS char(100) DETERMINISTIC
BEGIN
IF type = 0 THEN
IF subtype = 0 THEN RETURN 'Ordinary Payment';
ELSEIF subtype = 1 THEN RETURN 'MultiOut Payment';
ELSEIF subtype = 2 THEN RETURN 'MultiOut-Same Payment';
END IF;
ELSEIF type = 1 THEN
IF subtype = 0 THEN RETURN 'Arbritrary Message';
ELSEIF subtype = 1 THEN RETURN 'Alias Assignment';
ELSEIF subtype = 5 THEN RETURN 'Account Info';
ELSEIF subtype = 6 THEN RETURN 'Alias Sell';
ELSEIF subtype = 7 THEN RETURN 'Alias Buy';
END IF;
ELSEIF type = 2 THEN
IF subtype = 0 THEN RETURN 'Asset Issued';
ELSEIF subtype = 1 THEN RETURN 'Asset Transfer';
ELSEIF subtype = 2 THEN RETURN 'Ask Order Placement';
ELSEIF subtype = 3 THEN RETURN 'Bid Order Placement';
ELSEIF subtype = 4 THEN RETURN 'Ask Order Cancellation';
ELSEIF subtype = 5 THEN RETURN 'Bid Order Cancellation';
END IF;
ELSEIF type = 3 THEN
IF subtype = 0 THEN RETURN 'Marketplace Listing';
ELSEIF subtype = 1 THEN RETURN 'Marketplace Delisting';
ELSEIF subtype = 2 THEN RETURN 'Marketplace Price Change';
ELSEIF subtype = 3 THEN RETURN 'Marketplace Quantity Change';
ELSEIF subtype = 4 THEN RETURN 'Marketplace Purchase';
ELSEIF subtype = 5 THEN RETURN 'Marketplace Delivery';
ELSEIF subtype = 6 THEN RETURN 'Marketplace Feedback';
ELSEIF subtype = 7 THEN RETURN 'Marketplace Refund';
END IF;
ELSEIF type = 4 THEN
IF subtype = 0 THEN RETURN 'Effective Balance Leasing';
END IF;
ELSEIF type = 20 THEN
IF subtype = 0 THEN RETURN 'Reward Recipient';
END IF;
ELSEIF type = 21 THEN
IF subtype = 0 THEN RETURN 'Escrow Creation';
ELSEIF subtype = 1 THEN RETURN 'Escrow Signing';
ELSEIF subtype = 2 THEN RETURN 'Escrow Result';
ELSEIF subtype = 3 THEN RETURN 'Subscription Subscribe';
ELSEIF subtype = 4 THEN RETURN 'Subscription Cancel';
ELSEIF subtype = 5 THEN RETURN 'Subscription Payment';
END IF;
ELSEIF type = 22 THEN
IF subtype = 0 THEN RETURN 'AT Creation';
ELSEIF subtype = 1 THEN RETURN 'AT Payment';
END IF;
ELSE
RETURN 'unkown transaction type';
END IF;
END $$
DELIMITER ;
CREATE TABLE `mo` (
`db_id` bigint(20) NOT NULL,
`recipient_id` bigint(20) NOT NULL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment