Question
COMP 3540 Advanced Web Design and Programming Seminar/Lab 6 MVC, Session Management, Bootstrap, and MainPage 1. After Lesson 15 2. Learning outcomes * Use of
COMP 3540 Advanced Web Design and Programming Seminar/Lab 6 MVC, Session Management, Bootstrap, and MainPage
1. After Lesson 15 2. Learning outcomes * Use of PHP session management * Use of MySQL * Use of Bootstrap * User of MVC
3. Messages table * You should create the Messages table in your DB using phpMyAdmin very similar to the Users table in the previous assignment. * Columns Id, UsernameFrom, UsernameTo, Message, ReadOrNot, Date o Data type for primary key column Id * INT AUTO_INCREMENT PRIMARY KEY Type, A_I, Index on phyMyAdmin o UsernameFrom * string * Username who sent the message o UsernameTo * string * Username who receives/received the message o Message * string o ReadOrNot * boolean * Whether the message is read or not o Date * integer
4. Session management * You should implement Session Management in Controller. o A session: from LogIn sent from StartPage till LogOut sent from MainPage o Session variables: at least the username so that the commands sent from MainPage can use the username in Controller. * You may review 4.4.7 from the course web site. You can find what you need to do.
5. MainPage * FindFriend When the magnifier icon is clicked, the FindFriend modal window will be displayed. In MainPage, the result code will be included below Friends on the right side pane. MainPage needs to be redisplayed. * SendMessage
When the second icon is clicked, the SendMessage modal window will be displayed. MainPage may not have to be redisplayed. * ReadMessages just Sent Messages this week. Received Messages will be implemented next week.
When the 3rd icon is clicked, the messages sent by the current user will be encoded below Sent Messages. MainPage needs to be redisplayed.
6. Model o You should include functions for o FindFriend * A search term will be passed. * Find all the usernames that include the search term, and save them in a linear array. * The array will be returned. o SaveMessage * Two usernames who sends and who receives will be passed with a message. * Save the message in DB o ReadSentMessages * Username who sent messages will be passed * Find all the messages that we sent by the username, and save them in an array. * The array needs to include [UsernameTo, Message, Date]s, i.e., a linear array of linear arrays. * The array will be returned.
7. Controller o Three commands coming from MainPage, FindFriend, SendMessage, ReadMessages, will be implemented. o The above three functions in Model should be used. o The return values from the Model functions will be used in MainPage. The return values are a linear array and another liner array of linear arrays.
8. MainPage o The variables returned from the Model functions should be used to print the results for Friends and Sent Messages, as explained in 5. You will need to include PHP code. o Exercise 6 includes some trials.
9. Assignment * The URL of the controller o Due: * 11:59 PM, February 26, 2021 with 10% bonus, only when there is no error. * 6:00 PM, March 2, 2021 with the full marks * 6:00 PM, March 3, 2021 with penalty 10% o Total marks: 20 * 0 mark for any syntax error or warning message in JS or PHP * PHP error messages will be returned and displayed. * For JS, turn on Developer tools using Inspect (Ctrl + Shift + I) on the right button. You will see console. If there is an error, there will be an indication.
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