Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
fix add customer
Browse files Browse the repository at this point in the history
  • Loading branch information
thson58 committed Mar 7, 2024
1 parent 47e3dd8 commit ff8887b
Showing 1 changed file with 56 additions and 10 deletions.
66 changes: 56 additions & 10 deletions src/main/webapp/view/jsp/management/customer/add-customer.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<link rel="icon" type="image/png" sizes="512x512" href="<%=request.getContextPath()%>/view/assets/images/favicon/favicon.png">

<link rel="stylesheet" href="<%=request.getContextPath()%>/view/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&amp;display=swap">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css">
<link rel="stylesheet" href="https://f...content-available-to-author-only...s.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&amp;display=swap">
<link rel="stylesheet" href="https://c...content-available-to-author-only...e.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="https://c...content-available-to-author-only...e.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/view/assets/css/animate.min.css">

</head>
Expand All @@ -36,20 +36,50 @@
<p class="text-primary m-0 fw-bold">Thêm khách hàng mới</p>
</div>
<div class="card-body">
<form action="./add-customer" method="post">
<form action="./add-customer" method="post" id="form-add-customer">
<div class="row">
<div class="col">
<div class="mb-3"><label class="form-label" for="name"><strong>Tên khách hàng</strong></label><input class="form-control" type="text" id="name" placeholder="Nhập tên khách hàng" name="name"></div>
<div class="mb-3 form-group">
<label class="form-label" for="name">
<strong>Tên khách hàng</strong>
</label>
<div class="mb-3 form-group">
<input class="form-control" type="text" id="name-customer" placeholder="Nhập tên khách hàng" name="name" >
<span class="form-message text-danger"></span>
</div>
</div>
</div>
<div class="col">
<div class="mb-3"><label class="form-label" for="code"><strong>Mã khách hàng</strong></label><input class="form-control" type="text" id="code" placeholder="Mã khách hàng" name="code"></div>
<div class="mb-3">
<label class="form-label" for="code">
<strong>Mã khách hàng</strong>
</label>
<div class="mb-3 form-group">
<input class="form-control" type="text" id="code-customer" placeholder="Mã khách hàng" name="code" >
<span class="form-message text-danger"></span>
</div>
</div>
</div>
</div>
<div class="mb-3">
<div class="mb-3"><label class="form-label" for="address"><strong>Địa chỉ</strong></label><input class="form-control" type="text" id="address" placeholder="Nhập địa chỉ của khách hàng" name="address"></div>
<div class="mb-3"><label class="form-label" for="email"><strong>Email</strong></label><input class="form-control" type="email" id="email" placeholder="Nhập email khách hàng" name="email"></div>

<a class="btn btn-primary btn-sm" href="customer">Quay lại</a>
<div class="mb-3">
<label class="form-label" for="address">
<strong>Địa chỉ</strong>
</label>
<div class="mb-3 form-group">
<input class="form-control" type="text" id="address-customer" placeholder="Nhập địa chỉ của khách hàng" name="address" >
<span class="form-message text-danger"></span>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="email">
<strong>Email</strong>
</label>
<div class="mb-3 form-group">
<input class="form-control" type="email" id="email-customer" placeholder="Nhập email khách hàng" name="email" >
<span class="form-message text-danger"></span>
</div>
</div>
<button class="btn btn-primary btn-sm" type="submit">Lưu lại</button>
</div>
</form>
Expand All @@ -68,7 +98,23 @@
<script src="<%=request.getContextPath()%>/view/assets/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/view/assets/js/bs-init.js"></script>
<script src="<%=request.getContextPath()%>/view/assets/js/theme.js"></script>
<script src="<%=request.getContextPath()%>/view/assets/js/validate/validator.js"></script>

<script>
Validator({
form: '#form-add-customer',
errorSelector: '.form-message',
formGroupSelector: '.form-group',
rules: [
Validator.isRequired('#name-customer', 'Vui lòng nhập tên khách hàng!'),
Validator.isRequired('#code-customer', 'Vui lòng nhập mã khách hàng!'),
Validator.isRequired('#address-customer', 'Vui lòng nhập mã khách hàng!'),
Validator.isRequired('#email-customer', 'Vui lòng nhập mã khách hàng!')
]
});
</script>
</body>

</html>

0 comments on commit ff8887b

Please sign in to comment.