This form takes the users input data and place it to the Database.
This is the entry point of the application. It consists of html layout with feedback form inside.
- Provides connection to Database via singleton pattern.
- Parameters for connection stores in properties of the class DbConnector:
$host
for host name,$db_name
for name of the Database,$user
for login,$pass
for password.
- Main methods are:
getInstance()
for class DbConnector,getConnection()
for PDO Object.
- This file store class Model to perform the operations with DB.
- Main method is:
setFeedback()
to insert new data to Database.
- This method gets data from index.php by AJAX request in js/main.js and sets it to Database.
- Parameters are:
$name
for user's name,$number
for user's telephone number,$email
for user's email address,$note
for user's message,$isClient
to check if the user belongs to company's clients or not,$gotData
to mark if all the date was given with AJAX request.
- Main methods are:
__construct()
for setting values for properties of the class from POST request via AJAX,setDataToDb()
for setting data to Database by Model.php.
This is the dump of the tables of my local feedback
Database.
It is partly filled for example.
There is only one table named messages. It consists of columns:
id
to store unique id of the certain feedback. This parameter is set to auto increment,name
to store user's name,telephone
to store user's telephone number,email
to store user's email address,note
to store user's message,client
to store mark if user is client of company or not.
Bootstrap file for html layout.
Font Awesome file for html layout.
Main stylesheet for custom style.
This directory stores fonts for project.
Bootstrap file for dynamic html layout.
JQuery file for form validation.
JQuery file for dynamic layout and AJAX support.
JQuery file with custom functions:
- for masked input of telephone number,
- for AJAX request.
JQuery file for supporting of masked input.