លំហាត់​អនុវត្តន៍

លំហាត់​អនុវត្តន៍

Task 1

This practical assignment is for you to build a rental bicycle website using localStorage as the database to store all data concerning the bicycles from different countries. However, the website will be built step by step as follow:

1. Create a website with menu to show bicycle, customer, register, and top rental

2. Write code to create a form and a database in localStorage to store as much bicycles as possible. The database consists of one array of objects representing bicycles. Each bicycle has its own id, brand, country of production, year of production, amout of availibity, and price.

3. Write code to display the bicycles in a table on the front page.

4. Wrtie code to add "edit" and "delete" functionalities to the table.

5. Write code to add the functionalities of sorting & searching the database.

6. Write code to create a database for cumstomers using a form. The database is an array of object representing customer. Each object consists of ID, name, and phone number. When validate the form, make sure all fields are filled, and the phone number must contain only number, space and dash

7. Write code to display the customers in a table by adding "edit" functionality to the table.

8. Write code to add the functionalities of "sort" by name & "search" by name or phone number for the customers' database.

9. Write code to create another database to keep track of rental bicycle. The database includes customer's name, type of bicycle, renting date, return date. The return date shows up the current date only when the customer return the bicycle. Otherwise, the field is marked by a return logo. Cumstomers' name and type of bicycle are taken from the bicycle and customer database to put into a two dropdown lists. And when a bicycle is rented, the amount of bicycle in the database is decreased by 1. In contrast, when a bicycle is returned, the amount of bicycle in the database is increased by 1.

10. Write code to create another database to keep track of rental bicycle and customer who rents it. Displaying the five most rented bicycles and five best customers.