-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbill.html
More file actions
117 lines (89 loc) · 3.69 KB
/
bill.html
File metadata and controls
117 lines (89 loc) · 3.69 KB
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>
<title>ELECTRICITY BILL</title>
<script type="application/javascript">
function calbill() {
units = document.getElementById("units").value;
if (units <= 500) {
u = (5 * parseFloat(units));
document.getElementById("unitsbill").value = u;
} else
document.getElementById("unitsbill").value = (10 * parseFloat(units));
document.getElementById("loadbill").value = 100 * document.getElementById("load").value;
document.getElementById("fanbill").value = 50 * document.getElementById("fan").value;
document.getElementById("acbill").value = 100 * document.getElementById("ac").value;
document.getElementById("total").value = parseInt(document.getElementById("unitsbill").value) + parseInt(document.getElementById("loadbill").value) + parseInt(document.getElementById("fanbill").value) + parseInt(document.getElementById("acbill").value);
document.getElementById("discount").value = (document.getElementById("total").value) / 10;
document.getElementById("net").value = parseFloat(document.getElementById("total").value) - parseFloat(document.getElementById("discount").value);
}
</script>
</head>
<BODY>
<center>
<form>
<table border=2>
<tr>
<center>ELECTRICITY BILL
<hr>
</center>
</tr>
<tr>
<td>
UNITS:
<input type="text" id="units" placeholder="enter units" autofocus></td>
</tr>
<tr>
<td>
LOAD:
<input type="text" id="load" placeholder="enter load">KW</td>
</tr>
<tr>
<td>
FAN:
<input type="text" id="fan" placeholder="enter no of fans"></td>
<td> AC:
<input type="text" id="ac" placeholder="enter no of ac">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="BILL" onclick="calbill();"></td>
</tr>
<tr>
<td>
UNITS BILL:
<input type="text" id="unitsbill"></td>
</tr>
<tr>
<td>
LOAD BILL:
<input type="text" id="loadbill"></td>
</tr>
<tr>
<td>
FAN BILL:
<input type="text" id="fanbill"></td>
</tr>
<tr>
<td>
AC BILL:
<input type="text" id="acbill"></td>
<td>
TOTAL:
<input type="text" id="total"></td>
</tr>
<tr>
<td>
DISCOUNT:
<input type="text" id="discount"></td>
</tr>
<tr>
<td>
NET:
<input type="text" id="net"></td>
</tr>
</table>
</form>
</center>
</BODY>
</html>