From 05f4230fae2963cdeb27c7adbd8b89b8d028343f Mon Sep 17 00:00:00 2001 From: khahoangmkit <43039171+khahoangmkit@users.noreply.github.com> Date: Wed, 3 Jul 2019 18:42:17 +0700 Subject: [PATCH 1/3] Create MyWallet --- 17020763_Dao_Kha_Hoang/MyWallet | 1 + 1 file changed, 1 insertion(+) create mode 100644 17020763_Dao_Kha_Hoang/MyWallet diff --git a/17020763_Dao_Kha_Hoang/MyWallet b/17020763_Dao_Kha_Hoang/MyWallet new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/MyWallet @@ -0,0 +1 @@ + From 179da0340f63f71c0547c697e484ffa67356221d Mon Sep 17 00:00:00 2001 From: khahoangmkit <43039171+khahoangmkit@users.noreply.github.com> Date: Wed, 3 Jul 2019 18:42:35 +0700 Subject: [PATCH 2/3] Delete MyWallet --- 17020763_Dao_Kha_Hoang/MyWallet | 1 - 1 file changed, 1 deletion(-) delete mode 100644 17020763_Dao_Kha_Hoang/MyWallet diff --git a/17020763_Dao_Kha_Hoang/MyWallet b/17020763_Dao_Kha_Hoang/MyWallet deleted file mode 100644 index 8b13789..0000000 --- a/17020763_Dao_Kha_Hoang/MyWallet +++ /dev/null @@ -1 +0,0 @@ - From 4112e17e80e2a44d0ad0cafdf5534f6eb342fc5d Mon Sep 17 00:00:00 2001 From: khahoangmkit Date: Wed, 3 Jul 2019 18:56:13 +0700 Subject: [PATCH 3/3] update mywall --- .../JavaWeb/.idea/compiler.xml | 18 + .../JavaWeb/.idea/encodings.xml | 6 + 17020763_Dao_Kha_Hoang/JavaWeb/.idea/misc.xml | 15 + .../JavaWeb/.idea/uiDesigner.xml | 124 +++ 17020763_Dao_Kha_Hoang/JavaWeb/.idea/vcs.xml | 6 + .../JavaWeb/.idea/workspace.xml | 867 ++++++++++++++++++ 17020763_Dao_Kha_Hoang/JavaWeb/pom.xml | 115 +++ .../java/com/CodeCamp2019/Application.java | 20 + .../controller/CustomerController.java | 147 +++ .../src/main/java/com/CodeCamp2019/home.html | 11 + .../java/com/CodeCamp2019/model/Customer.java | 101 ++ .../repository/CustomerRepository.java | 12 + .../CodeCamp2019/service/CustomerService.java | 30 + .../src/main/resources/application.properties | 12 + .../webapp/WEB-INF/views/deleteCustomer.jsp | 52 ++ .../webapp/WEB-INF/views/errorTransfer.jsp | 22 + .../src/main/webapp/WEB-INF/views/home.jsp | 80 ++ .../main/webapp/WEB-INF/views/inforUser.jsp | 43 + .../src/main/webapp/WEB-INF/views/insert.jsp | 36 + .../src/main/webapp/WEB-INF/views/login.jsp | 30 + .../main/webapp/WEB-INF/views/loginFail.jsp | 28 + .../main/webapp/WEB-INF/views/notFound.jsp | 13 + .../src/main/webapp/WEB-INF/views/replace.jsp | 40 + .../main/webapp/WEB-INF/views/transfer.jsp | 34 + .../META-INF/SimpleMaven.kotlin_module | Bin 0 -> 16 bytes .../target/classes/application.properties | 12 + .../com/CodeCamp2019/Application.class | Bin 0 -> 1266 bytes .../controller/CustomerController.class | Bin 0 -> 5417 bytes .../com/CodeCamp2019/model/Customer.class | Bin 0 -> 2457 bytes .../repository/CustomerRepository.class | Bin 0 -> 631 bytes .../service/CustomerService.class | Bin 0 -> 1855 bytes 31 files changed, 1874 insertions(+) create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/compiler.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/encodings.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/misc.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/uiDesigner.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/vcs.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/.idea/workspace.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/pom.xml create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/Application.java create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/controller/CustomerController.java create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/home.html create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/model/Customer.java create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/repository/CustomerRepository.java create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/service/CustomerService.java create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/resources/application.properties create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/deleteCustomer.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/errorTransfer.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/home.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/inforUser.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/insert.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/login.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/loginFail.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/notFound.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/replace.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/transfer.jsp create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/META-INF/SimpleMaven.kotlin_module create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/application.properties create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/Application.class create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/controller/CustomerController.class create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/model/Customer.class create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/repository/CustomerRepository.class create mode 100644 17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/service/CustomerService.class diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/compiler.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/compiler.xml new file mode 100644 index 0000000..e504349 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/encodings.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/encodings.xml new file mode 100644 index 0000000..b26911b --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/misc.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/misc.xml new file mode 100644 index 0000000..3bc1190 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/misc.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/uiDesigner.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/vcs.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/.idea/workspace.xml b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/workspace.xml new file mode 100644 index 0000000..c97013d --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/.idea/workspace.xml @@ -0,0 +1,867 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + plance + re + + + + balance + + + $PROJECT_DIR$/src/main + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1554131416262 + + + 1560964434642 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SimpleMaven + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/pom.xml b/17020763_Dao_Kha_Hoang/JavaWeb/pom.xml new file mode 100644 index 0000000..583458c --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + + com.CodeCamp2019 + SimpleMaven + 1.0-SNAPSHOT + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + javax.servlet + jstl + 1.2 + + + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + org.springframework.boot + spring-boot-autoconfigure + 2.0.5.RELEASE + + + org.apache.struts + struts-tiles + 1.3.8 + + + org.assertj + assertj-core + 3.11.1 + + + org.springframework.boot + spring-boot-starter-data-jpa + + + mysql + mysql-connector-java + 8.0.16 + + + + org.hibernate + hibernate-core + 5.4.3.Final + + + + + + + + + + + + 1.8 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/Application.java b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/Application.java new file mode 100644 index 0000000..e1506bc --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/Application.java @@ -0,0 +1,20 @@ +package com.CodeCamp2019; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +@SpringBootApplication +public class Application extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(Application.class); + } + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/controller/CustomerController.java b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/controller/CustomerController.java new file mode 100644 index 0000000..a1b6887 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/controller/CustomerController.java @@ -0,0 +1,147 @@ +package com.CodeCamp2019.controller; + +import com.CodeCamp2019.model.Customer; +import com.CodeCamp2019.service.CustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; + + +import java.util.List; + + + +@Controller +public class CustomerController { + + + @Autowired + CustomerService customerService; + + @RequestMapping("/") + public String index(Model model) { + List customerList = customerService.findAll(); + model.addAttribute("customerList", customerList); + return "home"; + } + + @GetMapping(value = "/insert") + public String insert() { + return "insert"; + } + + + @PostMapping(value = "/add") + public String addName(@RequestParam(value = "id"/*, required = false*/) int id, + @RequestParam(value = "fullname") String name, + @RequestParam(value = "email") String email, + @RequestParam(value = "phone") String phone, + @RequestParam(value = "balance") int balance + ) { + Customer cus1 = new Customer(id, name, email, phone, balance); + customerService.save(cus1); + return "redirect:/"; + } + + @RequestMapping(value = "/replace") + public String replace(@RequestParam(value = "customerId") int id, Model model) { + + //model.addAttribute("customerId",id); + model.addAttribute("customer1", customerService.getOne(id)); + return "replace"; + } + + @PostMapping(value = "/replaceCus") + public String replaceCustomer(@RequestParam(value = "id") int id, + @RequestParam(value = "name") String name, + @RequestParam(value = "email") String email, + @RequestParam(value = "phone") String phone, + @RequestParam(value = "balance") int balance + ){ + Customer customer = new Customer(id,name,email,phone,balance); + customerService.save(customer); + return "redirect:/"; + } + +//----------------------------------------------------------- + @RequestMapping(value = "/login") + public String login(){ + return "login"; + } + @PostMapping(value = "/login") + public String Login(@RequestParam(value = "username") String user, + @RequestParam(value = "password") String pass, + Model model + ){ + List customerList = customerService.findAll(); + for (Customer customer :customerList){ + if(customer.getEmail().equals(user) && pass.equals("123456")){ + + model.addAttribute("customer",customer); + return "inforUser"; + } + + } + model.addAttribute("customer",new Customer()); + return "loginFail"; + + } + +//--------------------------------------------------------- + @RequestMapping(value = "transfer") + public String transfer(@RequestParam(value = "transferFrom") int id, Model model){ + + model.addAttribute("id",id); + return "transfer"; + } + @PostMapping(value = "transferToID") + public String transferToID(@RequestParam(value = "fromId") int fromid, + @RequestParam(value = "id") int id, + @RequestParam(value = "amount") int amount + ){ + if(customerService.getOne(fromid).getBalance() >= amount ) { + Customer fromCustomer = customerService.getOne(fromid); + Customer toCustomer = customerService.getOne(id); + + fromCustomer.setBalance(fromCustomer.getBalance() - amount); + toCustomer.setBalance(toCustomer.getBalance() + amount); + + customerService.save(fromCustomer); + customerService.save(toCustomer); + + return "redirect:/"; + } + return "errorTransfer"; + + } + //------------------ + @RequestMapping(value = "delete") + public String removeCus(@RequestParam(value = "deleteID") int id, Model model){ + Customer customer = customerService.getOne(id); + model.addAttribute("deleteCustomer",customer); + return "deleteCustomer"; + } + @PostMapping(value = "/deleteCustomer") + public String deleteCustomer(@RequestParam(value = "id") int id){ + customerService.deleteCustomer(id); + return "redirect:/"; + } + @PostMapping("/cancel") + public String cancelDelete(){ + return "redirect:/"; + } + + //------------------------------------------------- + @GetMapping(value = "search") + public String search(@RequestParam(value = "information") String infor, + Model model){ + List customers = customerService.search(infor); + if(customers.size() != 0 ){ + model.addAttribute("customerList", customers); + return "home"; + } + return "notFound"; + } + +} \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/home.html b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/home.html new file mode 100644 index 0000000..b23531c --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/home.html @@ -0,0 +1,11 @@ + + + + + Hello + + +

Wellcome to Home!

+

Hi, hw are you?

+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/model/Customer.java b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/model/Customer.java new file mode 100644 index 0000000..c44213a --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/model/Customer.java @@ -0,0 +1,101 @@ +package com.CodeCamp2019.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "Customer") +@JsonIgnoreProperties("hibernateLazyInitializer") +public class Customer { + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + + @Column(name = "name") + private String name; + + @Column(name = "email") + private String email; + + @Column(name = "phone") + private String phone; + @Column(name = "balance") + private int balance; + public Customer(){ + this.id = -1; + this.name = ""; + this.email = ""; + this.phone = ""; + this.balance = 0; + } + public Customer(Customer cu1){ + this.id = cu1.id; + this.name = cu1.name; + this.email = cu1.email; + this.phone = cu1.phone; + this.balance = cu1.balance; + } + public Customer(int id, String name, String email, String phone, int balance){ + this.id = id; + this.name = name; + this.email = email; + this.phone = phone; + this.balance = balance; + } + + + public void setName(String name) { + this.name = name; + } + + public void setEmail(String email) { + this.email = email; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public void setBalance(int balance) { + this.balance = balance; + } + + public void setId(int id) { + this.id = id; + } + + public int getId(){ + return this.id; + } + public String getName(){ + return this.name; + } + public String getEmail(){ + return this.email; + } + public String getPhone(){ + return this.phone; + } + public int getBalance(){ + return this.balance; + } + + public boolean isNull(){ + if(this.id != -1) return false; + return true; + } + /* + + create table Customer( + id int(5) not null auto_increment, + name varchar(50) not null, + email varchar(50) not null, + phone varchar(11) not null, + balance int(50) not null, + primary key (id) + ) engine=InnoDB Auto_increment=1 default charset=utf8; + */ +} diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/repository/CustomerRepository.java b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/repository/CustomerRepository.java new file mode 100644 index 0000000..5fac56e --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/repository/CustomerRepository.java @@ -0,0 +1,12 @@ +package com.CodeCamp2019.repository; + +import com.CodeCamp2019.model.Customer; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface CustomerRepository extends JpaRepository { + List findByNameContaining(String name); +} diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/service/CustomerService.java b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/service/CustomerService.java new file mode 100644 index 0000000..0db8d66 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/java/com/CodeCamp2019/service/CustomerService.java @@ -0,0 +1,30 @@ +package com.CodeCamp2019.service; + +import com.CodeCamp2019.model.Customer; +import com.CodeCamp2019.repository.CustomerRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class CustomerService { + + CustomerRepository customerRepository; + + @Autowired + public CustomerService(CustomerRepository customerRepository){ + this.customerRepository = customerRepository; + } + + public List findAll(){ + return customerRepository.findAll(); + } + public void save(Customer customer){ customerRepository.save(customer);} + public Customer getOne(int id){return customerRepository.getOne(id);} + public void deleteCustomer(int id){ + customerRepository.delete(customerRepository.getOne(id)); + } + public List search(String name){ return customerRepository.findByNameContaining(name);} + +} diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/resources/application.properties b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/resources/application.properties new file mode 100644 index 0000000..4658886 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/resources/application.properties @@ -0,0 +1,12 @@ +#spring +server.port=6699 +spring.mvc.view.prefix=/WEB-INF/views/ +spring.mvc.view.suffix=.jsp + +#hibernate +spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver +spring.datasource.url = jdbc:mysql://localhost:3306/uetcodecamp +spring.datasource.username=root +spring.datasource.password=123456789 +spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect +spring.jpa.show-sql=true \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/deleteCustomer.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/deleteCustomer.jsp new file mode 100644 index 0000000..04e2d53 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/deleteCustomer.jsp @@ -0,0 +1,52 @@ +<%@ page import="org.apache.catalina.util.CustomObjectInputStream" %> +<%@ page import="com.CodeCamp2019.model.Customer" %> + + + + + Confirm Page + + + + + +<% Customer cus = (Customer) request.getAttribute("deleteCustomer");%> +
+ +
+
Do you sure remove information customer?


+
ID: <%= cus.getId() %>
+
Name: <%= cus.getName() %>
+
Email: <%= cus.getEmail() %>
+
Phone: <%= cus.getPhone() %>
+
Balance: <%= cus.getBalance()%>

+
+
+ + +
+
+
+
+ + +
+
+
+ +
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/errorTransfer.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/errorTransfer.jsp new file mode 100644 index 0000000..207ac1c --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/errorTransfer.jsp @@ -0,0 +1,22 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> + + + + + Error Page + + + + +
+

So du khong kha dung!

+
+ +
+

+
+ +
+
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/home.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/home.jsp new file mode 100644 index 0000000..723938a --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/home.jsp @@ -0,0 +1,80 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.CodeCamp2019.model.Customer" %> + + + + Home + + + + + + + +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
IDFullNameEmailPhonePlance
${cus.id} ${cus.name} ${cus.email} ${cus.phone} ${cus.balance} +
+ + +
+
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/inforUser.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/inforUser.jsp new file mode 100644 index 0000000..e64549d --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/inforUser.jsp @@ -0,0 +1,43 @@ +<%@ page import="org.apache.catalina.util.CustomObjectInputStream" %> +<%@ page import="com.CodeCamp2019.model.Customer" %> + + + + + Information Page + + + + + + <% Customer cus = (Customer) request.getAttribute("customer");%> +
+ +
+
Information User


+
ID: <%= cus.getId() %>
+
Name: <%= cus.getName() %>
+
Email: <%= cus.getEmail() %>
+
Phone: <%= cus.getPhone() %>
+
Balance: <%= cus.getBalance()%>

+
+

+

+
+
+
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/insert.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/insert.jsp new file mode 100644 index 0000000..d58b312 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/insert.jsp @@ -0,0 +1,36 @@ +<%@ page import="java.util.ArrayList" %> + + + + Insert Page + + + + + + +
+
+

ADD USER

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/login.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/login.jsp new file mode 100644 index 0000000..92c9384 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/login.jsp @@ -0,0 +1,30 @@ +<%@ page import="com.CodeCamp2019.model.Customer" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> + + + + + Login Page + + + + + +
+
+

LogIn

+ +
+
+ +
+ +
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/loginFail.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/loginFail.jsp new file mode 100644 index 0000000..681be1f --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/loginFail.jsp @@ -0,0 +1,28 @@ +<%@ page import="com.CodeCamp2019.model.Customer" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> + + + + + Login Page + + + + +
+
+

LogIn Fail!
Tryagain!

+
+
+ +
+ +
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/notFound.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/notFound.jsp new file mode 100644 index 0000000..5387685 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/notFound.jsp @@ -0,0 +1,13 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.CodeCamp2019.model.Customer" %> + + + + + Hello Page + + +

Not found customer!!

+ + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/replace.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/replace.jsp new file mode 100644 index 0000000..6e9750b --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/replace.jsp @@ -0,0 +1,40 @@ +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.CodeCamp2019.model.Customer" %> + + + + + Replace Page + + + + <% Customer customer = (Customer) request.getAttribute("customer1"); %> + <% //Integer id = (Integer) request.getAttribute("customerId"); %> +
+
+
+
+
+
+


+
+
+ +
+ + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/transfer.jsp b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/transfer.jsp new file mode 100644 index 0000000..6f6beca --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/src/main/webapp/WEB-INF/views/transfer.jsp @@ -0,0 +1,34 @@ +<%@ page import="com.CodeCamp2019.model.Customer" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> + + + + + + Transfer Page + + + + + <% Integer id = (Integer) request.getAttribute("id"); %> +
+
+
Transfers
+
+
+ + +
+

+
+
+

+
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/META-INF/SimpleMaven.kotlin_module b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/META-INF/SimpleMaven.kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..8fb60192d378759239a3ecbf60eac8c8de446e9c GIT binary patch literal 16 RcmZQzU|?ooU|@t|UH|}6022TJ literal 0 HcmV?d00001 diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/application.properties b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/application.properties new file mode 100644 index 0000000..4658886 --- /dev/null +++ b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/application.properties @@ -0,0 +1,12 @@ +#spring +server.port=6699 +spring.mvc.view.prefix=/WEB-INF/views/ +spring.mvc.view.suffix=.jsp + +#hibernate +spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver +spring.datasource.url = jdbc:mysql://localhost:3306/uetcodecamp +spring.datasource.username=root +spring.datasource.password=123456789 +spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect +spring.jpa.show-sql=true \ No newline at end of file diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/Application.class b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/Application.class new file mode 100644 index 0000000000000000000000000000000000000000..82923a3b9538f2b685fa4e1a54b6719fa859c70d GIT binary patch literal 1266 zcmbtTZEq4m5PlX84k&FYwP>|g>nmX5sWB!Erb!_&X@b^>!5BX+u%)Yaw`6axZTwaG zMU9F60DqKm?jUkT&=1^)o!xnPZswVpA3wi-2k;QJ0)zw7LeMy~90BbDD^$oG|hB!{6UptEXQ>7f&hwDgBZntS3@>32>~DdY4)=?;W; zIlzrKiFitHE;~RbYfB8Z3`XpP^EH(|*fOxZ`qv=yXg} zXCvm8>mj+V&oDC-Ix5tC@kB;smlCDljj$LtUxdDqp6JRzQUmsVUzwO*Lfo5Q2@j3> zP5y+}CQ+UEL8Ay8IqLZ|>6Xg_!rl5;TWwq~;s$QoxK+e$R2dHD_VrZsoIvOkR~RP< zMwh!CUeZOSF#Ek-32#q-n#WFAX99IXd(7a!4|gnfhn2k90|) zKxZ~q=CMTg;@E-YGQBLUV3oY0;3hJ316J->-;jEpE~h)6V0|D>5@k6?sf;}*C=`Pd z)(E*w-WeKb5_zoS+ywd&$tbT}IbHvP%&Tc?g&1g!YA7et%V7f*@}IzM&^3kg@p%E8 KB%_Kh0>1!v8(_2m literal 0 HcmV?d00001 diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/controller/CustomerController.class b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/controller/CustomerController.class new file mode 100644 index 0000000000000000000000000000000000000000..f73b75d3c40a4c5efdfdee4be53335396c977970 GIT binary patch literal 5417 zcmb_g`Fj)B6+L5ZV|l4e$UxFG zNt3;6aXhueg18qM(Nq6qNci%nt+~wiF{OhfE z0PMxPNo>Va&G-O5nZ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uA;FFoYm1KMk}5n9Qq}XT^!+BWnnl30>Gdb0LxwgEc*dW zJKXO$C=(#R6*P7j$;JlqT50gAx=i{62Xd<))ry6(mmnUbc5z!pp z?kJwPK^ev-0c@ga%F-C-_pu)jad8EU4-`$%RoEeRV#oH0%{VT=XZWIo3ve91n8XEm z4_{o@m`E2_(_qnnA(E!K>Te{fnRCiiC$i_1)1#qBvxH%R$Zh2QF#_Jf>Mku&MF;2P5g-Z9t1@WdPk>WHU=uT%PZ<4(*~D2{Gn!!umYB;j z6PW@nvswbFAq5sdq6!5TA?Xr|w+vBNkf)_dY{i&;66K@?5Jwl8DVB9rvwFp4%;^=^ z&Cp~^2Al}y1Vcil2}Nb{w~%iv=N4v$f>hxAPmv1x^Z|g@E@)!*>6l5UC7N&u0Vz{q zjX~ITz&^YLHty2|mRSp3ofNj_AnXQUH!p#WyF7tqAp{Cu84>~2yHKZCgvWq=atUnw zMiSUq+l6%4%pltuV7D)UjbD2L%Ow=(ltqmEl6JGo`LhH*slW^KjDY;2#e3YBN5WZ E-_jI(#{d8T literal 0 HcmV?d00001 diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/repository/CustomerRepository.class b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/repository/CustomerRepository.class new file mode 100644 index 0000000000000000000000000000000000000000..418daadce6f6145b8c8d154ad75f7ea7d822cd02 GIT binary patch literal 631 zcmbVKO-lno49(QGYwK4PLA-lVgpNu*$cmr~in4ytg7;~6x=!7lS!S}zp8Q`P`~m(b zF|}$76%-F4d0~>gyv*y{^9um9V8w$a4;mgUGg$2_9i0?cB9(#BD3n$@X0Wjt4#b1t ziO@0cprxe0HA>~E5*{jtK7+=k#5)t+2ut-Stz%Hu6f&rFRICN&mg2KNG&>A?Cgp*N zWFXRPZ)f*_rvwrn0G0XKN-|JCbvC#suEgk?Tg&FadRjegY|ZyvC!T!HAsxn|uBAcOK!^(78s1U9a csxa`#&61U%Mh`|&9p*kV^RPg^N~Mbc@5;->Pyhe` literal 0 HcmV?d00001 diff --git a/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/service/CustomerService.class b/17020763_Dao_Kha_Hoang/JavaWeb/target/classes/com/CodeCamp2019/service/CustomerService.class new file mode 100644 index 0000000000000000000000000000000000000000..dbaa80539e38ef859e79b650f891174973597198 GIT binary patch literal 1855 zcmb7EYg5xe6g?YiYuktv(TX65FG^8@0={@##bKt30}g)Pwo6%T6DHZh@UL`6NAZK> zXMdFA-6l;7sjumDle@Y1oU`ZNXvA@DoE2~0n*iHEL ziGRp9WQBpPGxU;9vbHrJBr~_J`Qx78Zh5z+f{2zX>aGdI25zVZ{7MxGQ*2p zboVsGzj>J2avE+~tVum)11-_Pz)WdshFsSv@MwI5qmK54)tWC8y_h#);#>j?CN5*p z#4r{USTeDU6%*I6$S@jttxk5!#44VeC}5nZBe}nsZ5r*iPaCB@QC18+Ic@w@1mlmd zF~jXncYUl@gPJ`Hwiq&P%5__bs&HxU4|uI1Hg*^;QQte-6lBoc#{CIlxY&(|6c6Zk z=jqWa8i0ahD^4F3yNWUTq^0Q-$LLQM(;BDyUYth{`Y2k1K|dgs{|uI&`~>3zMFujo z_EHWgD@IWg{qzGa`PsOD0g9-uiAt*I{tTl)r}!jUx-#8QD$!K46loc${6`qa=wWzI zkx!*Xfj~5c>1PELSDHCPv^R{a0n!RxwP;f#O&%j=;B8yBkCp9^Yld=7j9`?o0=Xju z!f3$80^sKXa7F_UeZiSy#0`8$;