php代写 – php web design – 2017-12

Design document
• User interface for each user feature, with detail description
• Program modules, their descriptions, and the interactions between modules (Note. Program modules are files or groups of related files.)
• List of program modules
• Each program module description should include
• Summary and/or purposes
• List of the user features that are supported by the program module
• Functions with their description
• How a program module is used by another program module if applicable
• DB tables, with columns and their descriptions.
• A table showing for which user features user management, DB, MVC, Ajax, and JSON are used
• Due: November 23, 2017

UI (with detail description)
SignIn UI
The interface is setup to control a user from enter/exit a user session using a controller module. The startpage.php is the module implementation for this UI, listing the basic functions (login, register) for user management.

User session UI
The interface to allow users perform most functions for this project. The main.php is the module implementation for the UI, users are allowed to choose a survey, fill in the survey, check user status (survey complete/incomplete), reset password and logout.

Survey UI
The survey interface providing questions to answer and data to submit to the server. Survey.php is the module for data exchange between server and client.

Program modules
Purpose: Deal with user sessions and data exchange between client and server
Supported user features: User session management, function control and data exchange control
Function definition with description
The controller use isset() to check if a session variable is set, isvalid() to check validity of password, does_exist() is used to check if a user exist before registration. Insert_new_user() is used to add a new record to db from the interface.
Purpose: Deal with user login/register/forget password
Supported user features: Login, Logout, Forget password
Function definition with description
Define event registration on clicking for login, register and forget password buttons. Modal window will pop up to request for username, password or email info. When invalid username or password provided the window prompt for error. Otherwise, form data is submitted to the server from controller to store a new record, or start a user session.

Purpose: Perform user verification/Insertion, connection to db, return user data
Supported user features: Provide database connection and various function definition
Function definition with description
Provide definition for SignIn, register and survey submit operations. Insert_new_user($username, $password, $email) is called when user request for an account. The is_valid($username, $password) is used to check user validity for signin. post_question($q, $u) is used to insert questions answered by the user. reset_password($password) is used to update user password. Check_status() is used to check if user complete the survey.

Purpose: Password reset, choose survey, submit survey, check status, logout
Supported user features: Choose survey, check survey status, reset password
Function definition with description
Define event registration on clicking for password reset and choose survey buttons. Modal window will pop up to request for old & new password. If old password matchup with data in DB, the password is replaced with new one, else prompt error. The survey is chosen by clicking the choose survey button, then href of different survey will appear in an iframe to allow multiple choice. One survey can be chosen to be displayed in an iframe with AJAX and JSON data transport techniques. The data can be sent back to server using AJAX $.post() method. Check status button will display the list of survey the user completes/incomplete.

Survery.php(single page application within an iframe)
Purpose: Questions to fill, submit user data to the server and update status
Supported user features: Fill survey, submit (return user data)
Function definition with description
Submit button to send the data to the server and store the records in database. The status is updated to complete when submit button is fired.

Program module interactions
The survey.php is dependent on the user sessions and mainpage.php application. The SPA ajax technique is used to avoid user interruptions during form filling. The password reset and check status can be performed only in active user sessions.

DB tables (columns ,descriptions)
Two tables are used
SRV_USERS TABLE (similar to users)
COLUMN1: username
COLUMN2: password
COLUMN3: email
COLUMN4: date

SURVEYS TABLE (similar to questions)
COLUMN0: surveyID
COLUMN1: userid
COLUMN2: survey#
COLUMN3: question#
COLUMN4: answer
COLUMN5: date

User features and techs used(table)
user management, DB, MVC
user management, MVC
user management, DB, MVC
Reset password
user management, DB, MVC
Choose survey
Submit survey
Check status


电子邮件地址不会被公开。 必填项已用*标注