-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (85 loc) · 3.41 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
<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/index.css" />
<script>
$(document).ready(function () {
$("#btn_action").click(function () {
//Cookies.set()
//alert("working");
var hashcode = $("#hashaddressdp").val();
myContract.methods.loginPanel(hashcode).call().then(
function (returndata) {
if (returndata[1] == 1) {
uname = returndata[0];
Cookies.set('hashcodecp', hashcode, { expires: 14 });
Cookies.set('usernamecp', uname, { expires: 14 });
window.location.replace('dashboard.html');
}
else {
alert("User Account Not Found");
}
}
);
});
$("#btn_action2").click(function () {
//Cookies.set()
//alert("working");
var hashcode = $("#hashaddresspp").val();
myContract.methods.loginPanel(hashcode).call().then(
function (returndata) {
if (returndata[1] == 1) {
uname = returndata[0];
Cookies.set('hashcodecp', hashcode, { expires: 14 });
Cookies.set('usernamecp', uname, { expires: 14 });
window.location.replace('dashboardpassenger.html');
}
else {
alert("User Account Not Found");
}
}
);
});
});
</script>
</head>
<body>
<h1>EtherRide - Login Panel</h1>
<div class="container">
<div class="newuser" align="right"><a href='newuser.html'>New User?</a></div>
<fieldset>
<legend> User - Driver Panel</legend>
<form id=form1>
<div>
<span class="title">User Address</span>
<input type="text" id="hashaddressdp" placeholder="Write Here" />
</div>
<!-- <br /> -->
<div>
<span class="title"></span>
<input type="button" id="btn_action" value="Log-in as Driver" />
</div>
</form>
</fieldset>
<fieldset>
<legend> User - Passenger Panel</legend>
<form id=form2>
<div>
<span class="title">User Address</span>
<input type="text" id="hashaddresspp" placeholder="Write Here" />
</div>
<!-- <br /> -->
<div>
<span class="title"></span>
<input type="button" id="btn_action2" value="Log-in as Passanger" />
</div>
</form>
</fieldset>
</div>
</body>
</html>