


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The creation of routes and views in node.js for an admin dashboard that allows a director to manage shops and products. The director can view a table of all shops or specific shops, and choose between them to display related images. The creation of a form for the director to make selections.
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Index.js
In this file, I required models gen-box to use selsect_box
Next, I create a route post select_box to render admin and show select_box and table with role director.
Then, In login page I use If-clause to set role director and function of it when I login.
Admin.ejs
In this file, I create view table_string and select_box.
Select_box.js
In this file, I make a form select_box to director choose.
table_display.js
I use query to list all product when director login or list product with shop_id when user login. Then Display all data from table in database.
Shop ddd
Shop_B
When I choose option Shop_B the image will display as image.
Shop_C
When I choose option Shop_C the image will display as image.