-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
137 lines (127 loc) · 4.77 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="shortcut icon"
href="imgs/favicon_io/favicon-32x32.png"
type="image/x-icon"
/>
<link rel="stylesheet" href="css/all.min.css" />
<link rel="stylesheet" href="font/bootstrap-icons.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/style.css" />
<title>Product Management System</title>
</head>
<body>
<div class="container">
<h1 class="fw-bolder display-6 mx-auto text-start">
Product Management System
</h1>
<div class="mb-3">
<label for="ProductName" class="form-label fw-bold"
>Product Name:</label
>
<input
oninput="validateProductName(this.value)"
type="text"
class="form-control"
id="ProductName"
placeholder="Please, insert Product Name"
/>
<p class="text-danger d-none" id="productNameValidRule">make sure the product name contains from 4 to 8 characters and the first character is capital.</p>
</div>
<div class="mb-3">
<label for="ProductPrice" class="form-label fw-bold"
>Product Price:</label
>
<input
oninput="validateProductPrice(this.value)"
type="number"
class="form-control"
id="ProductPrice"
placeholder="Please, insert Product Price"
/>
<p class="text-danger d-none" id="productPriceValidRule">make sure the product price from 1000 to 10000.</p>
</div>
<div class="mb-3">
<label for="ProductCategory" class="form-label fw-bold"
>Product Category:</label
>
<input
oninput="validateProductCategory(this.value)"
type="text"
class="form-control"
id="ProductCategory"
placeholder="Please, insert Product Category"
/>
<p class="text-danger d-none" id="productCategoryValidRule">make sure the product category <span class="fst-italic">Tv</span> or <span class="fst-italic">Mobile</span> or <span class="fst-italic">Laptop</span>.</p>
</div>
<div class="mb-3">
<label for="ProductDescription" class="form-label fw-bold"
>Product Description:</label
>
<textarea
oninput="validateProductDescription(this.value)"
class="form-control"
id="ProductDescription"
rows="5"
placeholder="Please, insert Product Description"
></textarea>
<div class="d-flex justify-content-between">
<p class="text-danger opacity-0 text-start" id="productDescriptionValidRule">make sure the minimum characters accepted are more than 250 characters.</p>
<p class="text-end"><span id="characterCounter"></span>/250</p>
</div>
</div>
<button onclick="addProductToTable()" class="btn btn-danger" id="addProduct">
Add Product
</button>
<button onclick="putUpdatedProductInTable()" class="btn btn-info d-none" id="updateProduct">
Update Product
</button>
</div>
<div class="container mt-3">
<input
type="search"
onkeyup="searchForProduct(this.value)"
class="form-control"
id="ProductSearch"
placeholder="Search..."
/>
<div class="d-flex justify-content-between">
<div class="d-flex justify-content-between">
<button onclick="searchMode(this.id)" id="searchByName" class="btn btn-warning mt-2">
Search By Product Name
</button>
<button onclick="searchMode(this.id)" id="searchByCategory" class="btn btn-success mt-2 ms-2">
Search By Product Category
</button>
</div>
<div class="d-flex justify-content-between">
<button onclick="reset()" class="btn btn-secondary mt-2 me-2">Reset</button>
<button onclick="deleteAll()" class="btn btn-primary mt-2">Delete All</button>
</div>
</div>
</div>
<div class="container mt-5">
<table class="table">
<thead>
<tr>
<th scope="col">Index</th>
<th scope="col">Product Name</th>
<th scope="col">Product Price</th>
<th scope="col">Product Category</th>
<th scope="col">Product Description</th>
<th scope="col">Update</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
</div>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>