-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetRideBookingApprovalStatus.html
69 lines (55 loc) · 2.26 KB
/
SetRideBookingApprovalStatus.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
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js"></script>
<!-- Web3.js-->
<script src="node_modules/web3.js-browser/build/web3.js"></script>
<script src="node_modules/web3/dist/web3.min.js"></script>
<script src="web3connection.js"></script>
<link rel="stylesheet" href="css/SetRideBookingApprovalStatus.css" />
<script>
var hashcode = "";
$(document).ready(function () {
var hashcode = Cookies.get('hashcodecp');
var username = Cookies.get('usernamecp');
$("#uname").html(username);
$("#hcode").html(hashcode);
//balance View
web3.eth.getBalance(hashcode).then(function (rvalue) {
rvalue = web3.utils.fromWei(rvalue, "Ether");
$("#balance").html(rvalue + "ETH");
})
var totalrides = 0;
//reading of Query String
var param = new URLSearchParams(window.location.search);
var rbid = param.get("rbid");
var action = param.get("action");
if (action == 1) {
$("#actionview").html("<font color=green>Booking Status has been Approved</font>");
}
else {
$("#actionview").html("<font color=red>Booking Status has been Rejected</font>");
}
//http://127.0.0.1:5500/SetRideBookingApprovalStatus.html?rbid=undefined&action=1
myContract.methods.rideBookingStatusUpdate(rbid, action).send({ from: hashcode, gas: '3000000' });
});
</script>
</head>
<body>
<h1>EtherRide - Ride Activation</h1>
<div class="container">
<div class="details">
<div>User :<span id="uname"></span></div>
<div>Account ID : <span id="hcode"></span></div>
<div>Account Balance: <span id="balance"></span></div>
</div>
<div class="btns">
<a class="dash" href="dashboard.html">Dashboard</a>
<a class="btn_logout" href="index.html">Logout</a>
</div>
<div class="options">
<h2><span id="actionview"></span></h2>
</div>
</div>
</body>
</html>