This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
forked from timloden/calcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer-app.php
77 lines (61 loc) · 1.45 KB
/
footer-app.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
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package CalCoin
*/
$user = wp_get_current_user();
$user_id = $user->ID;
$address = get_field('wallet_address', 'user_' . $user_id);
?>
<?php if ($address) : ?>
<div class="wallet-container">
<div class="row">
<div class="columns">
<div class="card wallet-card faster">
<p class="text-right">
<a class="wallet-button wallet-close">
<i class="la la-close"></i>
</a>
</p>
<div id="wallet-qr"></div>
<span>Address:</span>
<p class="wallet-address"><?php echo $address; ?></p>
</div>
</div>
</div>
</div>
<?php endif; ?>
</main>
<footer class="app">
<?php
wp_nav_menu( array(
'menu' => 'Footer app',
'theme_location' => 'footer-app',
'menu_class' => 'app-nav',
'fallback_cb' => false
) );
?>
</footer>
<?php wp_footer(); ?>
</body>
<script>
(function ($) {
$(document).ready(function() {
<?php if ($address) : ?>
var typeNumber = 0;
var errorCorrectionLevel = 'L';
var qr = qrcode(typeNumber, errorCorrectionLevel);
qr.addData('<?php echo $address; ?>');
//qr.addData('test');
qr.make();
document.getElementById('wallet-qr').innerHTML = qr.createImgTag('10','0','Address QR Code');
<?php endif; ?>
});
})(jQuery);
</script>
</html>