-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
165 lines (132 loc) · 6.45 KB
/
index.html
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.0.min.js"><\/script>')</script>
<script src="js/vendor/jquery.qrcode-0.7.0.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="header-container">
<header class="wrapper clearfix">
<h1 class="title">Welcome to the ITB hotspot</h1>
<nav>
<!-- <ul>
<li><a href="#">nav ul li a</a></li>
<li><a href="#">nav ul li a</a></li>
<li><a href="#">nav ul li a</a></li>
</ul> -->
</nav>
</header>
</div>
<div class="main-container">
<div class="main wrapper clearfix">
<!-- prompt visitors to activate JavaScript -->
<noscript><h1>Your browser has JavaScript disabled. Please enable JavaScript to access the payment page.</h1></noscript>
<script language="JavaScript">
//we need to wait for the DOM to be fully loaded for jQuery to be operational.
$(document).ready(function () {
//a variable that will be compared with the value stored in the db, to prevent unnecessary page refreshes.
var last_transaction_amount = 0.0;
var time_remaining = 0;
//Display a loading message while the ajax request is performed
$("#status").html("Loading...");
//Get updated status; infinite loop, 1s intervals
setInterval(function() //setInterval does an inifinite loop
{
//get the status of the payment for this client
$.getJSON("backend.php",
function(response){
if(response.last_transaction_amount != last_transaction_amount) { //this is to prevent unnecessary page refreshes
//the client just sent money, or just ran out of money ! that means we need to load a new page to confirm good reception of the funds or funds exhaustion.
last_transaction_amount = response.last_transaction_amount;
if (response.time_remaining != null) {time_remaining = response.time_remaining;}
$("#status").slideUp(function(){
$("#status").html(response.html_body);
//generate a QR code
$("#qr_code").qrcode({
render: 'div',
width: 100,
height: 100,
text: $('#bitcoin_address_uri').attr('href')
});
$("#address").hide();
$("#link_show_address").click(function(){$(this).hide(function(){$("#address").slideDown();})})
}).slideDown('slow');
}
});
//simple time countdown in seconds
if (time_remaining != null){
if(time_remaining >= 0){
time_remaining--;
$("#time_remaining").html(time_remaining + ' seconds');
}
}
// $.ajax({
// url: "backend.php",
// data: { request_type: "display_payment_status" },
// success: function(data) //if the request is successful, then...
// {
// if (data != $("#status").html) //if the response is different from the current contents...
// {
// $("#status").slideUp();
// $("#status").html(data); //...then replace the current contents with the contents sent in the response.
// $("#qr_code").qrcode({
// render: 'div',
// width: 100,
// height: 100,
// text: 'sdf'
// });
// $("#status").slideDown();
// }
// }
//}); //That's it for the ajax part !
}, 1000); // the aforementioned 1s interval
//Here we take care of the countdown to credit exhaustion
// setInterval(function(){ //another setInterval, they're asynchronous so no conflict with the other one
// if($("#countdown").length) //this tests whether the #countdown element is present (.length is enough)
// {
// }
// }, 1000); //
});
</script>
<!-- all AJAX responses will be displayed here -->
<div id="status"></div>
</div>
<!-- <aside>
<h3>aside</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec. Curabitur posuere enim eget turpis feugiat tempor. Etiam ullamcorper lorem dapibus velit suscipit ultrices.</p>
</aside> -->
</div> <!-- #main -->
</div> <!-- #main-container -->
<div class="footer-container">
<footer class="wrapper">
<h3>Sean Murnin - Youri Le Cottier - Institute of Technology Blanchardstown</h3>
<img src="img/bitcoin_accepted_here.png" />
</footer>
</div>
<script src="js/main.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<!-- <script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X');ga('send','pageview');
</script> -->
</body>
</html>