Skip to content

Commit 0af187b

Browse files
committed
Add Home.html and login.html with basic structure and functionality; Implement login logic in login_logic.js
1 parent 449782b commit 0af187b

File tree

3 files changed

+171
-0
lines changed

3 files changed

+171
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9+
<title>Document</title>
10+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
11+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
12+
13+
<script>
14+
15+
function printbill(){
16+
name = document.getElementById("product").value;
17+
price = document.getElementById("price").value;
18+
gst = document.getElementById("gst").value;
19+
name_p = document.getElementById("name");
20+
price_p = document.getElementById("price_p");
21+
22+
gst_amount_p = document.getElementById("gst_amount_p");
23+
total_price_p = document.getElementById("total_price_p");
24+
25+
name_p.innerHTML = name;
26+
27+
price_p.innerHTML = price;
28+
29+
30+
31+
switch(gst){
32+
case 20 : document.getElementById("gst_p").innerHTML = 20
33+
break;
34+
case 10 : gst_p.innerHTML = +price*10/100;
35+
break;
36+
case 18 : gst_p.innerHTML = +price*18/100;
37+
break;
38+
case 2 : gst_p.innerHTML = +price*2/100;
39+
break;
40+
case 4 : gst_p.innerHTML = +price*4/100;
41+
break;
42+
}
43+
44+
45+
}
46+
47+
48+
</script>
49+
50+
51+
</head>
52+
<body>
53+
54+
<div class="container mt-5">
55+
<div class="row">
56+
<div class="col-sm-6 shadow-lg border-1 p-3">
57+
<div class="alert alert-primary fs-1 text-center">
58+
Welcome To joy Samosa Store !
59+
</div>
60+
<div class="m-2">
61+
<div class="row">
62+
<div class="col-sm-8">
63+
<label class="form-label">Price</label>
64+
<input type="text" id="price" class="form-control">
65+
</div>
66+
<div class="col-sm-4">
67+
<label class="form-label">GST</label>
68+
<select id="gst" class="form-control">
69+
<option value="20">GST 20%</option>
70+
<option value="10">GST 10%</option>
71+
<option value="18">GST 18%</option>
72+
<option value="2">CGST 2%</option>
73+
<option value="4">CGST 4%</option>
74+
</select>
75+
</div>
76+
</div>
77+
</div>
78+
<div class="m-2">
79+
<div class="row">
80+
<div class="col-sm-8">
81+
<label class="form-label">Product Name</label>
82+
<input type="text" id="product" class="form-control">
83+
</div>
84+
<div class="col-sm-4">
85+
<label class="form-label">QT</label>
86+
<input type="text" id="qt" class="form-control">
87+
</div>
88+
</div>
89+
</div>
90+
<div class="m-2">
91+
<button class="btn btn-danger" onclick="printbill()">Print Bill</button>
92+
</div>
93+
</div>
94+
<div class="col-sm-6 shadow-lg border-1 p-3">
95+
96+
<div class="card">
97+
<div class="card-header">
98+
99+
Welcome To joy Samosa Store ! Bill Print
100+
101+
</div>
102+
<div class="card-body">
103+
104+
<h5 class="card-title">Product Name : <span class="text-danger" id="name"> &nbsp; NON</span> </h5>
105+
<h5 class="card-title">Product Price : <span class="text-danger" id="price_p"> &nbsp; 00</span>/- </h5>
106+
<h5 class="card-title">Product GST : <span class="text-danger" id="gst_p"> &nbsp; 0.0</span>%</h5>
107+
<h5 class="card-title">GST Amount : <span class="text-danger" id="gst_amount_p"> &nbsp; 00</span>/-</h5>
108+
<h5 class="card-title">Total Price : <span class="text-danger" id="total-price_p"> &nbsp; 00</span>/-</h5>
109+
110+
111+
</div>
112+
</div>
113+
114+
</div>
115+
</div>
116+
</div>
117+
118+
119+
</body>
120+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
8+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
9+
<script src="login_logic.js"></script>
10+
</head>
11+
<body>
12+
13+
<div class="container mt-5">
14+
<div class="row justify-content-center">
15+
<div class="col-sm-6 shadow-lg border border-1 border-black rounded-4">
16+
<form class="m-4">
17+
<div class="mb-3">
18+
<label class="form-label">Username</label>
19+
<input type="text" class="form-control" id="username" name="username" required>
20+
</div>
21+
<div class="mb-3">
22+
<label class="form-label">Password</label>
23+
<input type="password" class="form-control" id="password" name="password" required>
24+
<p id="Error_print" class="text-danger"></p>
25+
</div>
26+
<button type="button" class="btn btn-primary" onclick="Login_result()">Login</button>
27+
</form>
28+
</div>
29+
</div>
30+
</div>
31+
32+
</body>
33+
</html>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
function Login_result(){
4+
5+
u_name = document.getElementById("username").value;
6+
u_password = document.getElementById("password").value;
7+
8+
username = "admin@cwpc.in";
9+
password = "admin@123"
10+
11+
if(u_name == username && u_password == password){
12+
window.open("Home.html");
13+
}else{
14+
document.getElementById("Error_print").innerHTML = "Wrong Password and user Name .. Try again !"
15+
}
16+
17+
18+
}

0 commit comments

Comments
 (0)