-
Notifications
You must be signed in to change notification settings - Fork 0
/
E_CONTRACT_WITHOUT_ABI_AND_ADDRESS.html
179 lines (162 loc) · 5 KB
/
E_CONTRACT_WITHOUT_ABI_AND_ADDRESS.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<html>
<head>
<title>EMPLOYEE_CONTRACT</title>
<script>
function testVariable() {
var n=document.getElementById("name1").value;
var i=document.getElementById("id1").value;
var s1=document.getElementById("sal_1").value;
var s2=document.getElementById("sal_2").value;
var s3=document.getElementById("sal_3").value;
var s4=document.getElementById("sal_4").value;
document.getElementById("get_name").innerHTML = n.bold().fontcolor("red");
document.getElementById("get_id").innerHTML = i.bold().fontcolor("red");
document.getElementById("get_sal1").innerHTML = s1.bold().fontcolor("red");
document.getElementById("get_sal2").innerHTML = s2.bold().fontcolor("red");
document.getElementById("get_sal3").innerHTML = s3.bold().fontcolor("red");
document.getElementById("get_sal4").innerHTML = s4.bold().fontcolor("red");
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.js"></script>
<script>
var account;
window.addEventListener('load', async () => {
if (typeof window.ethereum !== 'undefined') {
console.log("MetaMask is Available :) !");
}
// Modern DApp browsers
if (window.ethereum) {
window.web3 = new Web3(ethereum);
// To prevent the page reloading when the MetaMask network changes
ethereum.autoRefreshOnNetworkChange = false;
// To Capture the account details from MetaMask
const accounts = await ethereum.enable();
account = accounts[0];
}
// Legacy DApp browsers
else if (window.web3) {
//window.web3 = new Web3(web3.currentProvider);
window.web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/cbd9dc11b30147e9a2cc974be655ef7c"));
}
// Non-DApp browsers
else {
console.log('Non-Ethereum browser detected. Please install MetaMask');
}
});
</script>
</head>
<body style="background-color:powderblue;""max-width:100%;height:auto;>
<h1>EMPLOYEE_DETAILS & TOTAL_SALARY_COUNT </h1>
<h3>PROVIDE_EMPLOYEE_DETAILS</h3>
<form position="center">
<table style="width:25%">
<tr>
<td><label for="name1">EMPLOYEE_NAME:</label></td>
<td><input type="text" id="name1" name="name1"></td>
</tr>
<tr>
<td><label for="id1">EMPLOYEE_Id:</label></td>
<td><input type="text" id="id1" name="id1"></td>
</tr>
<tr>
<td><label for="sal_1">FIRST_QUARTER_SALARY:</label></td>
<td><input type="text" id="sal_1" name="sal_1"></td>
</tr>
<tr>
<td><label for="sal_2">SECOND_QUARTER_SALARY:</label></td>
<td><input type="text" id="sal_2" name="sal_2"></td>
</tr><tr>
<td><label for="sal_3">THIRD_QUARTER_SALARY:</label></td>
<td><input type="text" id="sal_3" name="sal_3"></td>
</tr><tr>
<td><label for="sal_4">FOURTH_QUARTER_SALARY:</label></td>
<td><input type="text" id="sal_4" name="sal_4"></td>
</tr><tr>
<td><input type="button" onclick="testVariable()" value="Add Details"></td>
</tr>
</table>
<form>
<h3>DISPLAYING_DETAILS:</h3>
<table style="width:25%">
<tr>
<td>NAME:</td>
<td><b><div id="get_name"></b></td>
</tr>
<tr>
<td>ID:</td>
<td><b><div id="get_id"></b></td>
</tr>
<tr>
<td>FIRST_QUARTER_SALARY:</td>
<td><b><div id="get_sal1"></b></td>
</tr>
<tr>
<td>SECOND_QUARTER_SALARY:</td>
<td><b><div id="get_sal2"></b></td>
</tr>
<tr>
<td>THIRD_QUARTER_SALARY:</td>
<td><b><div id="get_sal3"></b></td>
</tr>
<tr>
<td>FOURTH_QUARTER_SALARY:</td>
<td><b><div id="get_sal4"></b></td>
</tr>
</table>
</form>
</form>
<h4> TRANSACTION ID: <a href=""><div id="result"></div></a></h4>
<>
<form>
<h3>DISPLAYING_DETAILS:</h3>
<table style="width:25%">
<tr>
<td> ENTER ID:</td>
<td><input type="text" id="id1" name="id1"></td>
</tr>
<tr><td><input type="button" onclick="testVariable()" value="Get Details"></td></tr>
<tr>
<td>NAME:</td>
<td><b><div id="get_name"></b></td>
</tr>
<tr>
<td>ID:</td>
<td><b><div id="get_id"></b></td>
</tr>
<tr>
<td>FIRST_QUARTER_SALARY</td>
<td><b><div id="get_sal1"></b></td>
</tr>
<tr>
<td>SECOND_QUARTER_SALARY</td>
<td><b><div id="get_sal2"></b></td>
</tr>
<tr>
<td>THIRD_QUARTER_SALARY</td>
<td><b><div id="get_sal3"></b></td>
</tr>
<tr>
<td>FOURTH_QUARTER_SALARY</td>
<td><b><div id="get_sal4"></b></td>
</tr>
</table>
</form>
<h3>DISPLAY_TOTAL:</h3>
<form>
<table style="width:25%">
<tr>
<td>NAME:</td>
<td><b><div id="get_name"></b></td>
</tr>
<tr>
<td>ID:</td>
<td><b><div id="get_id"></b></td>
</tr>
<tr>
<td>TOTAL_SALARY:</td>
<td><b><div id="get_total"></b></td>
</tr>
</table>
</form>
</body>
</html>