Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 53

ONLINE SURVEY SYSTEM

Abstract
Since the emergence of website feedback, online survey software and questionnaire
tools have evolved into something entirely different. Having started as a solution more in the
realm of traditional survey tools with long lists of questions and anonymous respondents,
online survey software has somehow managed to stay ‘in fashion’ among online marketers.
Routine and repetitive surveys require a sophisticated and structured approach to the
execution of the survey and the management and reporting of the survey response data.
Designed well, robust and repeatable automated processes can take the grind out of handling
survey datasets - improving quality and reducing cost on a daily basis. Online Survey System
(OSS) is a web-enabled application which empowers the development, distributing and
analysis of survey forms to improve communication, process management, and decision
support across the organization. SMS is suitable for institutes that require surveying and
interviewing techniques to measure evaluation amongst different participant's levels and
categories.The main aim of the project is to form a platform to collect the viewpoints of
related people about certain issue using the internet. This online survey is the collection of
data through a self-administered electronic set of questions on the Web. It lets the user not
only to build questionnaires but also to publish questionnaires to the respondents.This
technology provides an inexpensive mechanism for conducting surveys online instead
ofthrough traditional survey methods. Also, it speeds up the distribution and response cycles.
Along with launching survey, it is capable of giving e-mail notifications. It can be
implemented in any organizations or college for carrying out survey of any kind.
Introduction
1.1. Overview
Online survey or internet survey, is one of the most popular data-collection sources, where a
set of survey questions is sent out to a target sample and the members of this sample can
respond to the questions over the world wide web. Respondents receive online surveys via
various mediums such as email, embedded over website, social media etc.
Organizations implement online surveys to use the internet in order to gain insights and
feedback about upcoming products or services, change in marketing strategies, enhancement
in current features etc. With the progress made by the internet, more and more organizations
depend on the data received and analysed from online surveys to make integral changes in
their functioning. For efficient data collection, organizations must choose an advanced and
efficient online survey platform.
1.2. Characteristics of Online Surveys
There are six distinct characteristics that should ideally define online surveys.
Purpose of the online survey: This is the most important characteristic of online surveys. An
established survey can only lead to appalling results. Researchers should decide the objective
of conducting an online survey so that the gauged results can be used to enhance
products/service, customer service or any other pre-decided objective.
Accurate research design: For an online survey to bear efficient results, it is important for
the researcher to design a thorough research design. How to carry out market research and
analysis using online surveys – this can be decided by implementing research design.
Research design will help market researchers in deciding how to collect information using
online surveys and how to measure and analyze collected data. The type of research design
can be decided according to the research problem an organization is facing. Upon detecting
the research problem, a market researcher can decide from among various types of research
design: Cross-sectional, longitudinal, experimental, correlational etc. In case, an organization
intends to conduct an online survey at a particular time, the researchers can rely on cross-
sectional research design and in situations where the organization wants to observe a change
in pattern from a particular time interval to another, the researchers can rely on longitudinal
research design.
Precisely structured survey questions: An efficient survey should include a carefully
curated balance of open-ended and closed-ended survey questions. There are various question
types which can suffice different purposes of online surveys. The questions added in an
online survey should be effective in obtaining the required information from the selected
sample. Some of the most widely used survey questions are:
 Multiple-choice questions
 Dichotomous questions
 Matrix questions
 Likert Scale questions
A researcher will be able to gather effective information from online surveys only when the
purpose of the survey is justified with the type of survey questions. For example, Likert scale
questions can be used to know the level of agreement of respondents with a particular
statement, or Matrix questions can be used where there is a long list of similar questions and
there is a likelihood of respondents dropping off a survey if these questions are not combined.
Researchers should understand the purpose of an online survey to ensure that the survey
questions are well-structured to garner crucial details.
Clearly defined target sample: A sample is a representative section of target respondents
who represent the required characteristics for research and whose inputs can be generalized
and applied to the entire target market. After filtering a sample from the target population, the
number of individuals who are a part of the sample will be indicative of the sample size. A
sample can be formed on the basis of various aspects such as demographics, profession or
any other factor according to the researcher’s experience and knowledge. Samples can be
formed using two sampling methods:
 Probability Sampling: A theory of probability is used to form a sample using the
Probability Sampling method. In this sampling method, every individual of a target
population has an equal opportunity to be a part of a selected sample.
 Non-probability Sampling: Non-probability sampling is a technique where the
sample is chosen on the basis of the researcher’s judgment, experience and knowledge
and not on random selection.
Collection and Analysis of respondent feedback: Including the right survey questions and
sending the online survey to the desired sample can lead to productive results only if the
collected results are well-analyzed to make informed decisions for the organization. With
online survey software such as QuestionPro, researchers can get analyzed data on a
dashboard which keeps updating real-time as respondents take the online survey. The data
presented on this dashboard is in the form charts and graphs for the ease of statistical analysis
for market research.
Transparent reporting of survey responses: The research reports created using data
obtained from online surveys should be shared with all the stakeholders of the organizations
so that each member is aware of the data gathered from surveys. Every respondent should
also understand that their inputs are being implemented by the organization – this way, they
will trust the organization in being honest about providing feedback for improvement.
1.3. Online Survey System Use Case
Online Polls, Facebook Surveys, Survey Template, Scheduling Polls ,Google Forms vs.
SurveyMonkey, Employee Satisfaction Surveys, Free Survey Templates, Mobile Surveys,
How to Improve Customer Service, AB Test Significance Calculator, NPS Calculator ,
Questionnaire Templates, Event SurveySample Size Calculator, Writing Good Surveys,
Likert Scale, Survey Analysis360 Degree Feedback, Education Surveys, Survey Questions,
NPS Calculation, Customer Satisfaction Survey Questions, Agree Disagree Questions, Create
a SurveyOnline Quizzes, Qualitative vs Quantitative Research, Customer Survey, Market
Research Surveys, NPS Survey, Survey Design Best Practices, Margin of Error Calculator,
Questionnaire, Demographic Questions, Training Survey, Offline Survey360 Review
Template
Existing System
In order to take any decision in an organization, it is essential to know what actually
workers or the members of organization want. It may not possible to listen to everybody
separately and sometimes the viewpoints are required to be kept secret. Also, the manual
system of survey is tedious and time consuming as well as uneconomical. So, an online
survey system is the solution of these existing problems.

Disadvantages
 Its manual process for earlier system.
 Its chance to lose our record or data.
 If we search any details for old records its take more time consuming process.

Proposed System
The proposed Online Survey System is easy and comfortable to use. In this software, the
answers or viewpoints of the participants are collected using radio button or check box. The
system is designed in such a way that it automatically adds the votes to each alternative and
after the deadline of survey it displays the result. All the activities in the project are
controlled by approvers like HRS.

The system plays a vital role in minimizing the budget of survey. The implementation of
project avoids the programs such as meetings, conferences etc. To take any decision or
research. With the help of this online system, one can easily forward his/her ideas and
viewpoints to the officials.

Advantages

Faster medium to reach the target audience


In comparison to the other survey techniques such as pen-and-paper surveys, online surveys
are exceedingly fast in acquiring feedback from respondents.
Real-time analysis
After collecting information, the analysis is an important step for researchers to take prompt
actions. With online survey software available, researchers can analyze collected data in real-
time from a central dashboard.
Cost-efficient
Due to the minimum required resources, online surveys are much cheaper than the other
survey methods such as telephonic or pen-and-paper surveys.
Minimum margin-of-error
Unlike the traditional survey methods, respondents directly answer the surveys, without the
involvement of a mediator. The margin-of-error in case of online surveys is hence, very
limited.
Convenient to understand for respondents
Online surveys are usually very easy to answer as they either come to the email inbox or
social media, it can be answered with a click.
Saves researchers’ time
Online surveys are quick to configure and send and due to the ease, they tend to save
researchers’ time.
Respondents are more truthful
When an online survey is conducted within a target audience, researchers allow respondents
to answer anonymously. Due to the anonymity involved in online surveys, respondents
usually depict a more honest and truthful behavior in providing feedback.
Modules:

SYSTEM MODULES:

 SURVEYOR
 PEOPLE

SURVEYOR

 Login
 Post Survey Details
 Chart Analysis Of Survey

PEOPLE

 Register
 Login
 View Survey Details
 Answer Survey

Module Description

Login Module
The main activities in the application are the user login page for user. The other modules are
followed by this login page. This module records only user and password of the user.
Registration Module
Another main function of our proposed system is registration, in order to register with the
unique application details such as name; password, email, place and time are required.

SURVEYOR

 Post Survey Details

Surveyor can post any survey details. Like politics, any new law and so on.
Surveyor can post question using radio button features or check box features or
Textarea features.
 Chart Analysis Of Survey
People can answer any question within the survey period of time after chart will
be automatically generated.

PEOPLE

 View Survey Details


people can view the surveyor posted details. In homepage then they choose a
question to answer.
 Answer Survey
Then people can answer about survey question. Every people can answer only one
time for each survey.

HARDWARE REQUIREMENTS

 Processor : Intel processor 3.0 GHz


 RAM : 2GB
 Hard disk : 500 GB
 Compact Disk : 650 Mb
 Keyboard : Standard keyboard
 Mouse : Logitech mouse
 Monitor : 15 inch color monitor

SOFTWARE REQUIREMENTS
 Front End : PHP
 Back End : MYSQL
 Server : WAMP
 Operating System : Windows OS
 System type : 32-bit or 64-bit Operating System
 IDE : DREAMWEAVER
 DLL : Depends upon the title
SOFTWARE DESCRIPTION

PHP - Overview

PHP is a recursive acronym for "PHP: Hypertext Preprocessor". PHP is a server side
scripting language that is embedded in HTML. It is used to manage dynamic content,
databases, session tracking, even build entire e-commerce sites. The PHP Hypertext
Preprocessor (PHP) is a programming language that allows web developers to create dynamic
content that interacts with databases. PHP is basically used for developing web based
software applications. This tutorial helps you to build your base with PHP.

Why to Learn PHP?

PHP started out as a small open source project that evolved as more and more people
found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in
1994.

PHP is a MUST for students and working professionals to become a great Software
Engineer specially when they are working in Web Development Domain. I will list down
some of the key advantages of learning PHP:

 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".


 PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-commerce sites.
 It is integrated with a number of popular databases, including MySQL, PostgreSQL,
Oracle, Sybase, Informix, and Microsoft SQL Server.
 PHP is pleasingly zippy in its execution, especially when compiled as an Apache
module on the Unix side. The MySQL server, once started, executes even very complex
queries with huge result sets in record-setting time.
 PHP supports a large number of major protocols such as POP3, IMAP, and LDAP.
PHP4 added support for Java and distributed object architectures (COM and CORBA),
making n-tier development a possibility for the first time.
 PHP is forgiving: PHP language tries to be as forgiving as possible.
 PHP Syntax is C-Like.

Fig 1: Basic View of PHP

Characteristics of PHP

Five important characteristics make PHP's practical nature possible −

 Simplicity
 Efficiency
 Security
 Flexibility
 Familiarity

Hello World using PHP.

Just to give you a little excitement about PHP, I'm going to give you a small
conventional PHP Hello World program, You can try it using Demo link.

<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php echo "Hello, World!";?>
</body> </html>
Applications of PHP

As mentioned before, PHP is one of the most widely used language over the web. I'm
going to list few of them here:

PHP performs system functions, i.e. from files on a system it can create, open, read,
write, and close them. and can handle forms, i.e. gather data from files, save data to a file,
through email you can send data, return data to the user. You add, delete, modify elements
within your database through PHP and access cookies variables and set cookies. Using PHP,
you can restrict users to access some pages of your website and encrypt data.

Architecture Overview

This section explains how all the different parts of the driver fit together. From the
different language runtimes, through the extension and to the PHP libraries on top. This new
architecture has replaced the old mongo extension. We refer to the new one as
the mongodb extension.

Fig 2: Overview of PHP

At the top of this stack sits a pure » PHP library, which we will distribute as a
Composer package. This library will provide an API similar to what users have come to
expect from the old mongo driver (e.g. CRUD methods, database and collection objects,
command helpers) and we expect it to be a common dependency for most applications built
with MongoDB. This library will also implement common » specifications, in the interest of
improving API consistency across all of the » drivers maintained by MongoDB (and
hopefully some community drivers, too).Sitting below that library we have the lower level
driver. This extension will effectively form the glue between PHP and our system libraries.
This extension will expose an identical public API for the most essential and performance-
sensitive functionality:

 Connection management
 BSON encoding and decoding
 Object document serialization (to support ODM libraries)
 Executing commands and write operations
 Handling queries and cursors

Prerequisites

Before proceeding with this tutorial you should have at least basic understanding of
computer programming, Internet, Database, and MySQL etc is very helpful.

PHP started out as a small open source project that evolved as more and more people
found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in
1994.

 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".


 PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-commerce sites.
 It is integrated with a number of popular databases, including MySQL, PostgreSQL,
Oracle, Sybase, Informix, and Microsoft SQL Server.
 PHP is pleasingly zippy in its execution, especially when compiled as an Apache
module on the Unix side. The MySQL server, once started, executes even very complex
queries with huge result sets in record-setting time.

Common uses of PHP

 PHP performs system functions, i.e. from files on a system it can create, open, read,
write, and close them.
 PHP can handle forms, i.e. gather data from files, save data to a file, through email
you can send data, return data to the user.
 You add, delete, modify elements within your database through PHP. Access cookies
variables and set cookies. Using PHP, you can restrict users to access some pages of your
website. It can encrypt data.

Characteristics of PHP

Five important characteristics make PHP's practical nature possible −

 Simplicity
 Efficiency
 Security
 Flexibility
 Familiarity

In order to develop and run PHP Web pages three vital components need to be
installed on your computer system.

 Web Server − PHP will work with virtually all Web Server software, including
Microsoft's Internet Information Server (IIS) but then most often used is freely available
Apache Server. Download Apache for free here − https://httpd.apache.org/download.cgi
 Database − PHP will work with virtually all database software, including Oracle and
Sybase but most commonly used is freely available MySQL database. Download MySQL for
free here − https://www.mysql.com/downloads/
 PHP Parser − In order to process PHP script instructions a parser must be installed to
generate HTML output that can be sent to the Web Browser. This tutorial will guide you how
to install PHP parser on your computer.

PHP Parser Installation

Before you proceed it is important to make sure that you have proper environment
setup on your machine to develop your web programs using PHP.

Type the following address into your browser's address box.


http://127.0.0.1/info.php

If this displays a page showing your PHP installation related information then it
means you have PHP and Webserver installed properly. Otherwise you have to follow given
procedure to install PHP on your computer.

This section will guide you to install and configure PHP over the following four
platforms −

 PHP Installation on Linux or Unix with Apache


 PHP Installation on Mac OS X with Apache
 PHP Installation on Windows NT/2000/XP with IIS
 PHP Installation on Windows NT/2000/XP with Apache

Apache Configuration

If you are using Apache as a Web Server then this section will guide you to edit
Apache Configuration Files.

Just Check it here − PHP Configuration in Apache Server

PHP.INI File Configuration

The PHP configuration file, php.ini, is the final and most immediate way to affect
PHP's functionality.

Just Check it here − PHP.INI File Configuration

Windows IIS Configuration

To configure IIS on your Windows machine you can refer your IIS Reference Manual
shipped along with IIS.

The main way to store information in the middle of a PHP program is by using a
variable.

Here are the most important things to know about variables in PHP.
 All variables in PHP are denoted with a leading dollar sign ($).
 The value of a variable is the value of its most recent assignment.
 Variables are assigned with the = operator, with the variable on the left-hand side and
the expression to be evaluated on the right.
 Variables can, but do not need, to be declared before assignment.
 Variables in PHP do not have intrinsic types - a variable does not know in advance
whether it will be used to store a number or a string of characters.
 Variables used before they are assigned have default values.
 PHP does a good job of automatically converting types from one to another when
necessary.
 PHP variables are Perl-like.

PHP has a total of eight data types which we use to construct our variables −

 Integers − are whole numbers, without a decimal point, like 4195.


 Doubles − are floating-point numbers, like 3.14159 or 49.1.
 Booleans − have only two possible values either true or false.
 NULL − is a special type that only has one value: NULL.
 Strings − are sequences of characters, like 'PHP supports string operations.'
 Arrays − are named and indexed collections of other values.
 Objects − are instances of programmer-defined classes, which can package up both
other kinds of values and functions that are specific to the class.
 Resources − are special variables that hold references to resources external to PHP
(such as database connections).

Conclusion

FINAL THOUGHT: it's very important to learn an entire subject matter. As a


programmer-in-the-making, you may be inclined to take what you've learned and start coding
immediately, but before you've learned enough of the topic at large. In reality this will lead to
you coding away, and then eventually spending hours just to research how to solve one little
aspect you need. If you learned the whole subject matter of, say, procedural PHP, you most
likely will have naturally encountered that solution, and in a faction of the time! Often it can
take very many hours to research one small solution that results in one line of code.
Fig3 : Evolution of Various Scripts

Whereas learning that trick might have been a natural thing to learn as part of learning
the whole subject, and only requires 5 minutes of study in between learning many other
tricks. In other words, a developer that has to constantly seek out solutions to things he/she
doesn't know will waste a lot more time in aggregate than someone that mastered the subject
as a whole, and then went to apply it. You're just more relaxed and in a better learning mode
when you're focused on nothing but learning. But when you're focused on producing results,
and have to learn at the same time, it can be stressful and waste you tons of time going back
and forth from testing each of the tens of wrong solutions you're trying out and googling until
you find the right one. 

MYSQL

MySQL is the most popular Open Source Relational SQL Database Management
System. MySQL is one of the best RDBMS being used for developing various web-based
software applications. MySQL is developed, marketed and supported by MySQL AB, which
is a Swedish company. This tutorial will give you a quick start to MySQL and make you
comfortable with MySQL programming.
Fig 4: Structure of Data Directory

MySQL Database

MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed and supported by MySQL AB, which is a Swedish
company. MySQL is becoming so popular because of many good reasons −

 MySQL is released under an open-source license. So you have nothing to pay to use
it.

 MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.

 MySQL uses a standard form of the well-known SQL data language.

 MySQL works on many operating systems and with many languages including PHP,
PERL, C, C++, JAVA, etc.

 MySQL works very quickly and works well even with large data sets.

 MySQL is very friendly to PHP, the most appreciated language for web development.
 MySQL supports large databases, up to 50 million rows or more in a table. The
default file size limit for a table is 4GB, but you can increase this (if your operating
system can handle it) to a theoretical limit of 8 million terabytes (TB).

 MySQL is customizable. The open-source GPL license allows programmers to


modify the MySQL software to fit their own specific environments.

MYSQL Functions

Here is the list of all important MySQL functions. Each function has been explained
along with suitable example.

 MySQL Group By Clause − The MySQL GROUP BY statement is used along with
the SQL aggregate functions like SUM to provide means of grouping the result
dataset by certain database table column(s).
 MySQL COUNT Function − The MySQL COUNT aggregate function is used to
count the number of rows in a database table.
 MySQL MAX Function − The MySQL MAX aggregate function allows us to select
the highest (maximum) value for a certain column.
 MySQL MIN Function − The MySQL MIN aggregate function allows us to select the
lowest (minimum) value for a certain column.
 MySQL SUM Function − The MySQL SUM aggregate function allows selecting the
total for a numeric column.
 MySQL CONCAT Function − This is used to concatenate any string inside any
MySQL command.
 MySQL DATE and Time Functions  − Complete list of MySQL Date and Time
related functions.
 MySQL Numeric Functions − Complete list of MySQL functions required to
manipulate numbers in MySQL.
 MySQL String Functions − Complete list of MySQL functions required to
manipulate strings in MySQL.

Discussion
MySQL is the most popular Open Source Relational SQL Database Management
System. MySQL is one of the best RDBMS being used for developing various web-based
software applications. MySQL is developed, marketed and supported by MySQL AB, which
is a Swedish company. This tutorial will give you a quick start to MySQL and make you
comfortable with MySQL programming.

WAMP Server

WAMP is an acronym that stands for Windows, Apache, MySQL, and PHP. It’s a
software stack which means installing WAMP installs Apache, MySQL, and PHP on your
operating system (Windows in the case of WAMP). Even though you can install them
separately, they are usually bundled up, and for a good reason too.

What’s good to know is that WAMP derives from LAMP (the L stands for Linux).
The only difference between these two is that WAMP is used for Windows, while LAMP –
for Linux based operating systems.

Let’s quickly go over what each letter represents “W” stands for Windows, there’s
also LAMP (for Linux) and MAMP (for Mac). “A” stands for Apache. Apache is the server
software that is responsible for serving web pages. When you request a page to be seen by
you, Apache grants your request over HTTP and shows you the site. “M” stands for MySQL.
MySQL’s job is to be the database management system for your server. It stores all of the
relevant information like your site’s content, user profiles, etc. “P” stands for PHP. It’s the
programming language that was used to write WordPress. It acts like glue for this whole
software stack. PHP is running in conjunction with Apache and communicating with
MySQL.
Fig 6: WAMP Structure

Instead of installing and testing WordPress on your hosting account, you can do it on


your personal computer (localhost).

WAMP acts like a virtual server on your computer. It allows you to test all WordPress
features without any consequences since it’s localized on your machine and is not connected
to the web.

First of all, this means that you don’t need to wait until files are uploaded to your site,
and secondly – this makes creating backups much easier.

WAMP speeds up the work process for both developers and theme designers alike.
What is more, you also get the benefit of playing around with your site to your heart’s
content. However, to actually make the website go live, you need to get some form of hosting
service and a Domain. See our beginner-friendly article about web hosting for more
information. In essence, WAMP is used as a safe space to work on your website, without
needing to actually host it online. WAMP also has a control panel. Once you install the
software package, all of the services mentioned above (excluding the operating system that
is) will be installed on your local machine. Whether you use WAMP or software packages for
the other operating systems, it’s a great way to save time. You won’t have to upload files to a
site and will be able to learn how to develop in a safe and care-free environment.

DATA FLOW DIAGRAM

Data flow Symbols:

Symbol Description

An entity. A source of data or a


destination for data.
A process or task that is
performed by the system.

A data store, a place where


data is held between processes.

A data flow.

Level 0

Login Database
Surveyor

Level 1
Register
Database

people

Login

Level 2

Survey
Admin Details Add Survey

People Detail

Chart Analysis

Survey Report

Level 3

Survey List
People Find Survey

Answer
TABLE DESIGN

Table structure for table answers


Field Type Nul Default
l
id int(30) Yes NULL
survey_id int(30) Yes NULL
user_id int(30) Yes NULL
answer text Yes NULL
question_id int(30) Yes NULL
date_create datetime Yes NULL
d

Table structure for table questions


Field Type Null Default
id int(30) Yes NULL
question text Yes NULL
frm_option text Yes NULL
type varchar(50) Yes NULL
order_by int(11) Yes NULL
survey_id int(30) Yes NULL
date_create datetime Yes NULL
d

Table structure for table survey_set


Field Type Null Default
id int(30) Yes NULL
title varchar(200) Yes NULL
description text Yes NULL
user_id int(30) Yes NULL
start_date date Yes NULL
end_date date Yes NULL
date_created datetime Yes NULL

Table structure for table users


Field Type Null Default
id int(30) Yes NULL
firstname varchar(200) Yes NULL
lastname varchar(200) Yes NULL
middlename varchar(200) Yes NULL
contact varchar(100) Yes NULL
address text Yes NULL
email varchar(200) Yes NULL
password text Yes NULL
type tinyint(1) Yes 2
date_created datetime Yes NULL

SOURCE CODE

Surveyor:

Register
<?php
include("db_connect.php");
extract($_POST);
if(isset($btn))
{

$sql="insert into
users(firstname,lastname,middlename,contact,address,email,password,type,date_created)
values
('$firstname','$lastname','$middlename','$contact','$address','$email','$password','1','$date_cre
ated')";
echo "insert into
users(firstname,lastname,middlename,contact,address,email,password,type,date_created)
values
('$firstname','$lastname','$middlename','$contact','$address','$email','$password','1','$date_cre
ated')";
$exe= mysqli_query($conn,$sql);
if($exe)
{
echo "register...";
}
else
{
echo "failed..";
}
}
?>

Login
<?php
session_start();
include('./db_connect.php');
?>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>Login | Online Survey System</title>

<?php include('./header.php'); ?>


<?php
if(isset($_SESSION['login_id']))
header("location:index.php?page=home");

?>
Home
<?php include('db_connect.php') ?>
<!-- Info boxes -->
<?php if($_SESSION['login_type'] == 1): ?>
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-users"></i></span>

<div class="info-box-content">
<span class="info-box-text">Total Subscribers</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT * FROM users where type = 3")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3">
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-poll-h"></i></span>

<div class="info-box-content">
<span class="info-box-text">Total Survey</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT * FROM survey_set")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>

<?php else: ?>


<div class="col-12">
<div class="card">
<div class="card-body">
Welcome <?php echo $_SESSION['login_name'] ?>!
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-poll-h"></i></span>

<div class="info-box-content">
<span class="info-box-text">Total Surveys Taken</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT distinct(survey_id) FROM answers where user_id =
{$_SESSION['login_id']}")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>

<?phpendif; ?>

New_user
<?php
?>
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<form action="" id="manage_user">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div class="row">
<div class="col-md-6 border-right">
<b class="text-muted">Personal Information</b>
<div class="form-group">
<label for="" class="control-label">First Name</label>
<input type="text" name="firstname" class="form-control form-control-sm" required
value="<?php echo isset($firstname) ? $firstname : '' ?>">
</div>
<div class="form-group">
<label for="" class="control-label">Middle Name</label>
<input type="text" name="middlename" class="form-control form-control-sm" value="<?
php echo isset($middlename) ? $middlename : '' ?>">
</div>
<div class="form-group">
<label for="" class="control-label">Last Name</label>
<input type="text" name="lastname" class="form-control form-control-sm" required
value="<?php echo isset($lastname) ? $lastname : '' ?>">
</div>
<div class="form-group">
<label for="" class="control-label">Contact No.</label>
<input type="text" name="contact" class="form-control form-control-sm" required
value="<?php echo isset($contact) ? $contact : '' ?>">
</div>
<div class="form-group">
<label class="control-label">Address</label>
<textarea name="address" id="" cols="30" rows="4" class="form-control" required><?php
echo isset($address) ? $address : '' ?></textarea>
</div>
</div>
<div class="col-md-6">
<b class="text-muted">System Credentials</b>
<?php if($_SESSION['login_type'] == 1): ?>
<div class="form-group">
<label for="" class="control-label">User Role</label>
<select name="type" id="type" class="custom-select custom-select-sm">
<option value="1" <?php echo isset($type) && $type == 1 ? 'selected' : ''
?>>Surveyor</option>
<option value="2" <?php echo isset($type) && $type == 2 ? 'selected' : ''
?>>people</option>

</select>
</div>
<?php else: ?>
<input type="hidden" name="type" value="2">
<?phpendif; ?>
<div class="form-group">
<label class="control-label">Email</label>
<input type="email" class="form-control form-control-sm" name="email" required
value="<?php echo isset($email) ? $email : '' ?>">
<small id="#msg"></small>
</div>
<div class="form-group">
<label class="control-label">Password</label>
<input type="password" class="form-control form-control-sm" name="password" <?php
echo isset($id) ? "":'required' ?>>
<small><i><?php echo isset($id) ? "Leave this blank if you dont want to change you
password":'' ?></i></small>
</div>
<div class="form-group">
<label class="label control-label">Confirm Password</label>
<input type="password" class="form-control form-control-sm" name="cpass" <?php echo
isset($id) ? 'required' : '' ?>>
<small id="pass_match" data-status=''></small>
</div>
</div>
</div>
<hr>
<div class="col-lg-12 text-right justify-content-center d-flex">
<button class="btnbtn-primary mr-2">Save</button>
<button class="btnbtn-secondary" type="button" onclick="location.href = 'index.php?
page=user_list'">Cancel</button>
</div>
</form>
</div>
</div>
</div>

User_lists

<?phpinclude'db_connect.php' ?>
<div class="col-lg-12">
<div class="card card-outline card-success">
<div class="card-header">
<div class="card-tools">
<a class="btnbtn-block btn-smbtn-default btn-flat border-primary" href="./index.php?
page=new_user"><i class="fa fa-plus"></i> Add New User</a>
</div>
</div>
<div class="card-body">
<table class="table tabe-hover table-bordered" id="list">
<thead>
<tr>
<th class="text-center">#</th>
<th>Name</th>
<th>Contact #</th>
<th>Role</th>
<th>Email</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$type = array('',"surveyor","people");
$qry = $conn->query("SELECT *,concat(lastname,', ',firstname,' ',middlename) as name
FROM users order by concat(lastname,', ',firstname,' ',middlename) asc");
while($row= $qry->fetch_assoc()):
?>
<tr>
<th class="text-center"><?php echo $i++ ?></th>
<td><b><?php echo ucwords($row['name']) ?></b></td>
<td><b><?php echo $row['contact'] ?></b></td>
<td><b><?php echo $type[$row['type']] ?></b></td>
<td><b><?php echo $row['email'] ?></b></td>
<td class="text-center">
<button type="button" class="btnbtn-default btn-smbtn-flat border-info wave-effect text-info
dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
Action
</button>
<div class="dropdown-menu" style="">
<a class="dropdown-item view_user" href="javascript:void(0)" data-id="<?php echo
$row['id'] ?>">View</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="./index.php?page=edit_user&id=<?php echo $row['id'] ?
>">Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item delete_user" href="javascript:void(0)" data-id="<?php echo
$row['id'] ?>">Delete</a>
</div>
</td>
</tr>
<?phpendwhile; ?>
</tbody>
</table>
</div>

New survey

<?php
if(!isset($conn)){
include 'db_connect.php' ;
}
?>
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<form action="" id="manage_survey">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div class="row">
<div class="col-md-6 border-right">
<div class="form-group">
<label for="" class="control-label">Title</label>
<input type="text" name="title" class="form-control form-control-sm" required value="<?
php echo isset($stitle) ? $stitle : '' ?>">
</div>
<div class="form-group">
<label for="" class="control-label">Start</label>
<input type="date" name="start_date" class="form-control form-control-sm" required
value="<?php echo isset($start_date) ? $start_date : '' ?>">
</div>
<div class="form-group">
<label for="" class="control-label">End</label>
<input type="date" name="end_date" class="form-control form-control-sm" required
value="<?php echo isset($end_date) ? $end_date : '' ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="" cols="30" rows="4" class="form-control" required><?
php echo isset($description) ? $description : '' ?></textarea>
</div>
</div>
</div>
<hr>
<div class="col-lg-12 text-right justify-content-center d-flex">
<button class="btnbtn-primary mr-2">Save</button>
<button class="btnbtn-secondary" type="button" onclick="location.href = 'index.php?
page=survey_list'">Cancel</button>
</div>
</form>
</div>
</div>
</div>
Survey_list
<?phpinclude'db_connect.php' ?>
<div class="col-lg-12">
<div class="card card-outline card-primary">
<div class="card-header">
<div class="card-tools">
<a class="btnbtn-block btn-smbtn-default btn-flat border-primary" href="./index.php?
page=new_survey"><i class="fa fa-plus"></i> Add New Survey</a>
</div>
</div>
<div class="card-body">
<table class="table tabe-hover table-bordered" id="list">
<colgroup>
<col width="5%">
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
<col width="15%">
</colgroup>
<thead>
<tr>
<th class="text-center">#</th>
<th>Title</th>
<th>Description</th>
<th>Start</th>
<th>End</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$qry = $conn->query("SELECT * FROM survey_set order by date(start_date)
asc,date(end_date) asc ");
while($row= $qry->fetch_assoc()):
?>
<tr>
<th class="text-center"><?php echo $i++ ?></th>
<td><b><?php echo ucwords($row['title']) ?></b></td>
<td><b class="truncate"><?php echo $row['description'] ?></b></td>
<td><b><?php echo date("M d, Y",strtotime($row['start_date'])) ?></b></td>
<td><b><?php echo date("M d, Y",strtotime($row['end_date'])) ?></b></td>
<td class="text-center">
<!--<button type="button" class="btnbtn-default dropdown-toggle" data-toggle="dropdown"
aria-expanded="true">
Action
</button>
<div class="dropdown-menu" style="">
<a class="dropdown-item" href="./index.php?page=edit_survey&id=<?php echo $row['id'] ?
>">Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item delete_survey" href="javascript:void(0)" data-id="<?php echo
$row['id'] ?>">Delete</a>
</div> -->
<div class="btn-group">
<a href="./index.php?page=edit_survey&id=<?php echo $row['id'] ?>" class="btnbtn-
primary btn-flat">
<i class="fas fa-edit"></i>
</a>
<a href="./index.php?page=view_survey&id=<?php echo $row['id'] ?>" class="btnbtn-info
btn-flat">
<i class="fas fa-eye"></i>
</a>
<button type="button" class="btnbtn-danger btn-flat delete_survey" data-id="<?php echo
$row['id'] ?>">
<i class="fas fa-trash"></i>
</button>
</div>
</td>
</tr>
<?phpendwhile; ?>
</tbody>
</table>
</div>

Survey_report

<?php include 'db_connect.php' ?>


<?php
$answers = $conn->query("SELECT distinct(survey_id) from answers where user_id
={$_SESSION['login_id']}");
?>
<div class="col-lg-12">
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
<label for="" class="control-label">Find Survey</label>
<div class="input-group input-group-sm col-sm-5">
<input type="text" class="form-control" id="filter" placeholder="Enter keyword...">
<span class="input-group-append">
<button type="button" class="btnbtn-primary btn-flat" id="search">Searh</button>
</span>
</div>
</div>
<div class=" w-100" id='ns' style="display: none"><center><b>No
Result.</b></center></div>
<div class="row">
<?php
$survey = $conn->query("SELECT * FROM survey_set order by rand() ");
while($row=$survey->fetch_assoc()):
?>
<div class="col-md-3 py-1 px-1 survey-item">
<div class="card card-outline card-primary">
<div class="card-header">
<h3 class="card-title"><?php echo ucwords($row['title']) ?></h3>

<div class="card-tools">
<button type="button" class="btnbtn-tool" data-card-widget="collapse">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body" style="display: block;">
<?php echo $row['description'] ?>
<div class="row">
<hr class="border-primary">
<div class="d-flex justify-content-center w-100 text-center">
<a href="index.php?page=view_survey_report&id=<?php echo $row['id'] ?>" class="btnbtn-
smbg-gradient-primary"><i class="fa fa-poll"></i> View Report</a>
</div>
</div>
</div>
</div>
</div>
<?phpendwhile; ?>
</div>
</div>

View survey

<?php include 'db_connect.php' ?>


<?php
$qry = $conn->query("SELECT * FROM survey_set where id = ".$_GET['id'])-
>fetch_array();
foreach($qry as $k => $v){
if($k == 'title')
$k = 'stitle';
$$k = $v;
}
$answers = $conn->query("SELECT distinct(user_id) from answers where survey_id
={$id}")->num_rows;
?>
<div class="col-lg-12">
<div class="row">
<div class="col-md-4">
<div class="card card-outline card-primary">
<div class="card-header">
<h3 class="card-title">Survey Details</h3>
</div>
<div class="card-body p-0 py-2">
<div class="container-fluid">
<p>Title: <b><?php echo $stitle ?></b></p>
<p class="mb-0">Description:</p>
<small><?php echo $description; ?></small>
<p>Start: <b><?php echo date("M d, Y",strtotime($start_date)) ?></b></p>
<p>End: <b><?php echo date("M d, Y",strtotime($end_date)) ?></b></p>
<p>Have Taken: <b><?php echo number_format($answers) ?></b></p>

</div>
<hr class="border-primary">
</div>
</div>
</div>
<div class="col-md-8">
<div class="card card-outline card-success">
<div class="card-header">
<h3 class="card-title"><b>Survey Questionaire</b></h3>
<div class="card-tools">
<button class="btnbtn-block btn-smbtn-default btn-flat border-success new_question"
type="button"><i class="fa fa-plus"></i> Add New Question</button>
</div>
</div>
<form action="" id="manage-sort">
<div class="card-body ui-sortable">
<?php
$question = $conn->query("SELECT * FROM questions where survey_id = $id order by
abs(order_by) asc,abs(id) asc");
while($row=$question->fetch_assoc()):
?>
<div class="callout callout-info">
<div class="row">
<div class="col-md-12">
<span class="dropleft float-right">
<a class="fa fa-ellipsis-v text-dark" href="javascript:void(0)" data-toggle="dropdown" aria-
haspopup="true" aria-expanded="false"></a>
<div class="dropdown-menu" style="">
<a class="dropdown-item edit_question text-dark" href="javascript:void(0)" data-id="<?php
echo $row['id'] ?>">Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item delete_question text-dark" href="javascript:void(0)" data-id="<?
php echo $row['id'] ?>">Delete</a>
</div>
</span>
</div>
</div>
<h5><?php echo $row['question'] ?></h5>
<div class="col-md-12">
<input type="hidden" name="qid[]" value="<?php echo $row['id'] ?>">
<?php
if($row['type'] == 'radio_opt'):
foreach(json_decode($row['frm_option']) as $k => $v):
?>
<div class="icheck-primary">
<input type="radio" id="option_<?php echo $k ?>" name="answer[<?php echo $row['id'] ?
>]" value="<?php echo $k ?>" checked="">
<label for="option_<?php echo $k ?>"><?php echo $v ?></label>
</div>
<?phpendforeach; ?>
<?phpelseif($row['type'] == 'check_opt'):
foreach(json_decode($row['frm_option']) as $k => $v):
?>
<div class="icheck-primary">
<input type="checkbox" id="option_<?php echo $k ?>" name="answer[<?php echo
$row['id'] ?>][]" value="<?php echo $k ?>" >
<label for="option_<?php echo $k ?>"><?php echo $v ?></label>
</div>
<?phpendforeach; ?>
<?php else: ?>
<div class="form-group">
<textarea name="answer[<?php echo $row['id'] ?>]" id="" cols="30" rows="4" class="form-
control" placeholder="Write Something Here..."></textarea>
</div>
<?phpendif; ?>
</div>
</div>
<?phpendwhile; ?>
</div>
</form>
</div>
</div>
</div>

Survey widget

<?php include 'db_connect.php' ?>


<?php
$answers = $conn->query("SELECT distinct(survey_id) from answers where user_id
={$_SESSION['login_id']}");
$ans = array();
while($row=$answers->fetch_assoc()){
$ans[$row['survey_id']] = 1;
}
?>
<div class="col-lg-12">
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
<label for="" class="control-label">Find Survey</label>
<div class="input-group input-group-sm col-sm-5">
<input type="text" class="form-control" id="filter" placeholder="Enter keyword...">
<span class="input-group-append">
<button type="button" class="btnbtn-primary btn-flat" id="search">Searh</button>
</span>
</div>
</div>
<div class=" w-100" id='ns' style="display: none"><center><b>No
Result.</b></center></div>
<div class="row">
<?php
$survey = $conn->query("SELECT * FROM survey_set where '".date('Y-m-d')."' between
date(start_date) and date(end_date) order by rand() ");
while($row=$survey->fetch_assoc()):
?>
<h3 class="card-title"><?php echo ucwords($row['title']) ?></h3>
<div class="card-tools">
<button type="button" class="btnbtn-tool" data-card-widget="collapse">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body" style="display: block;">
<?php echo $row['description'] ?>
<div class="row">
<hr class="border-primary">
<div class="d-flex justify-content-center w-100 text-center">
<?php if(!isset($ans[$row['id']])): ?>
<a href="index.php?page=answer_survey&id=<?php echo $row['id'] ?>" class="btnbtn-
smbg-gradient-primary"><i class="fa fa-pen-square"></i> Take Survey</a>
<?php else: ?>
<p class="text-primary border-top border-primary">Done</p>
<?phpendif; ?>
</div>
</div>
</div>
</div>
</div>
<?phpendwhile; ?>
</div>

SCREENSHOT
Admin-surveyor
Login
Register

Home
Add_new_user

User lists
New survey

Survey list
Radio Button

Check Box
Text Area

Survey report
View survey
People-users
Home
Survey widget

Find survey
Print
CONCLUSION:

Web-based surveys have had a profound influence on the survey process in a number
of ways. The survey taking process has become more democratized because of Web surveys.
Since the ability to gather data through Web surveys is quite widely available, ordinary
citizens, as well as government organizations, university researchers and big businesses, are
now conducting surveys on the Web. Leadership in Web-based survey design is coming from
people with a strong technology background not, just the experts in survey methodology. The
visual aspect of surveys is even more important in Web-based surveys than with other
surveys. What was visible in a paper survey can be made invisible in a Web and vice versa.
Web surveys have reduced the cost of data collection and made data analysis more efficient.
Although there are concerns about Web-based surveys and many aspects of conducting
surveys on the Web have yet to studied, a number of researchers have produced a body of
literature that is improving the design and effectiveness of the Web-based survey process.

You might also like