Question
Using a MVC model, code a search page, buy page and a restock page. For the search page, if username 'administrator' and pass 'pass' has
Using a MVC model, code a search page, buy page and a restock page.
For the search page, if username 'administrator' and pass 'pass' has logged in, there should be a href link for the restock page with the id of a wanted product. If username 'user' and pass 'pass' has logged in, there should be a href link for the buy page with the id of a wanted product.
The buy page should be accessed by shop/buy/Id. The id is the number given to a product from a sql table. The buy page should have an input box where the user types in the number of Id they want. The number should then decrement the amount of Id in sql table. This page should only be accessed if the user has logged in as username "user" and password "pass"
For the restock page it should be accessed by shop/restock/Id. The id is the number given to a product from a sql table. The restock page should have an input box where the user types in the number of Id they want to restock. The number should then increment the amount of Id in sql table. This page should only be accessed if the user has logged in as username "administrator " and password "pass"
The sql table has a name of 'Customers' and the properties are 'username', 'password'
The sql table has a name of 'Stock' and the properties are 'product', 'Id', 'no'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started