Design and implementation of web-based online questionnaire survey system (PHP+Html+MySQL)

Table of contents

Chinese Abstract 1
Abstract II
Chapter 1 Introduction 1
1.1 Research background 1
1.2 Design goals 1
1.3 Structure of this article 1
Chapter 2 Introduction to system and program architecture and related technologies 3
2.1 System architecture and program architecture 3
2.1.1 Introduction to nginx 3
2.1. 2 Introduction to thinkPHP 3
2.2 Introduction to development related technologies 4
2.2.1 PHP technology 4
2.2.2 MySQL technology 5
Chapter 3 System Requirements Analysis and Design 7
3.1 Requirements Analysis 7
3.1.1 Platform System Requirements Analysis 7
3.1.2 Customer System Requirements Analysis 7
3.1.3 Analysis of ordinary user requirements 7
3.1.4 Use case diagram 8
Chapter 4 System and database design 9
4.1 System design 9
4.2 Database design 10
Chapter 5 System detailed design and function implementation 16
5.1 Folder structure of system project 16
5.2 Detailed design of platform management system 17
5.2.1 Login function 17
5.2.2 User list management 18
5.2.3 Questionnaire management function 19
5.2.4 Question type management function 20
5.2.5 Peripheral functions 21
5.3 Detailed design of customer management system 21
5.3.1 Registration and login function 21
5.3.2 Questionnaire list management 22
5.3.3 Customer personal information 22
5.4 User system design 23 5.4.1
Website homepage promotion 23
5.4.2 Login and registration function 23
5.4.3 Questionnaire details and questionnaire submission 23
Summary 25
References 26
Acknowledgments 27
Chapter 3 System Requirements Analysis and Design

本套问卷调查系统,针对使用的人群分为平台,客户,普通用户三种角色。下面对这三种角色做一简要的说明:

(1) The platform is the website administrator and has ownership.
(2) Customer is the organization or individual who created the questionnaire. Because ordinary users may also be potential customers, ordinary users are also one of the customers.
(3) Users are the respondents who fill out the questionnaire.

3.1 Requirements Analysis
3.1.1 Platform System Requirements Analysis
The platform, as the manager of the entire system, has the highest authority and needs to provide many functions. It should have the following functions:
(1) User management function: You can view the list of platform administrators and registered users and modify basic information on the system, or delete an existing user.
(2) Questionnaire management function: For questionnaires published by customers, the platform system needs to provide the function of viewing the questionnaire list, modifying the basic information of the questionnaire, changing the questionnaire questions, and saving the published functions.
(3) Question type management function: manage the list of question types that customers are allowed to use in the management system.
(4) Log function: log some operations so that you can query them in case of misoperation.
(5) Peripheral functions: In addition to the above main functions, it still provides some additional intuitive information display, such as how many customers the current system has, how many questionnaires have been submitted, and how many times it has been submitted. and a list of the latest and most popular questionnaires.

3.1.2 Analysis of customer system requirements
In order to provide customers with a good questionnaire generation platform, the platform needs to have the following functions:
(1) Registration and login function: users can register to become a customer of the platform based on their email, mobile phone or custom nickname, or simply of ordinary users.
(2) Questionnaire management function: Customers can create specific questionnaires on the system, set themes, and provide a variety of question types for customers to choose from. After editing the questionnaire questions, users can preview the questionnaire, save the questionnaire, and publish the questionnaire.
(3) Personal information modification function: Customers can modify their personal information, email address, login password, etc. on the system.

3.1.3 Analysis of Ordinary User Requirements
Ordinary users are divided into two types, one is registered and logged in users, and the other is tourist users. For logged-in and registered users, potential customers can also create their own questionnaires on the customer system.
In addition, the most important thing for ordinary users is to browse the questionnaires on the website, as well as fill in and submit the questionnaires.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>
	问卷调查网
    </title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link type="text/css" rel="stylesheet" href="{$Think.STATIC_DOMAIN}/css/index.css" /> 
    <script src="{$Think.STATIC_DOMAIN}/js/jquery.js"></script>
    <script src="{$Think.STATIC_DOMAIN}/js/index.js"></script>
</head>
<body>
    <input type="hidden" id="last_selected_type" value="{$last_selected_type}"><!--隐藏域,上次选中的导航栏-->
    <input type="hidden" id="last_search_keywords" value="{$last_search_keywords}"><!--隐藏域,上次的搜索词-->
    <div id="BS">
        <div class="headerwraper">
            <div id="header" style="height:80px">
                <div class="sojump_logo" style="padding-top:15px;margin-top:0px;width:250px;height:65px;">
                        <a href="{$Think.const.STATIC_DOMAIN}" style="display:inline-block;font-size:24px;color:#3C763D;" >在线问卷调查网</a>
                        <a href="{$Think.const.STATIC_DOMAIN}">qss.codiy.net</a>
                </div>
                <div class="Header_r" style="margin:0px;height:82px;">
                    <div id="ctl00_divLogin" class="header_reg" style="margin:0px;">
                        <ul>
                            <li>
                                <a href="/User/Public/register">
                                    <span style="cursor: pointer;" class="header_btn">注册</span>
                                </a>
                            </li>
                            <li id="ctl00_liLogin">
                                <a href="/User/Public/login" class="new_titxt" style="font-size: 14px;">登录</a>
                            </li>
                        </ul>
                    </div>
                    <div id="NMenu" style="margin:0px;margin-top:15px;">
                        <ul style="float:right;">
                            <li id="ctl00_liIndex"><i></i><a href="{$Think.const.STATIC_DOMAIN}" class="indexnav">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
                            <li id="ctl00_liCustomer" style="border: 0; padding-right: 0;"><i></i><a href="{$Think.const.STATIC_DOMAIN}" class="indexnav">问卷中心</a></li>
                            <li id="ctl00_liCustomer" style="border: 0; padding-right: 0;"><i></i><a href="#footer" class="indexnav">联系我们</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            
        </div>
        <div style="margin:0 auto;  width:945px; text-align:left; margin-top:30px;;">
            
<div style="margin: 0 auto;">
    <div>
        <ul  class="stat_tab" style="padding-left:45px; padding-top:0px;">
            <if condition="$Think.get.type eq 'all'"><li class="current"><elseif condition="$Think.get.type eq ''"/><li class="current"><else /><li></if>
                <a href="?type=all"><span>所有</span></a>
            </li>
            <if condition="$Think.get.type eq '1'"><li class="current"><else /><li></if>
                <a href="?type=1"><span>心理</span></a>
            </li>
            <if condition="$Think.get.type eq '2'"><li class="current"><else /><li></if>
                <a href="?type=2"><span>生活</span></a>
            </li>
            <if condition="$Think.get.type eq '3'"><li class="current"><else /><li></if>
                <a href="?type=3"><span>情感</span></a>
            </li>
            <if condition="$Think.get.type eq '4'"><li class="current"><else /><li></if>
                <a href="?type=4"><span>科技</span></a>
            </li>
            <if condition="$Think.get.type eq '5'"><li class="current"><else /><li></if>
                <a href="?type=5"><span>企业</span></a>
            </li>
            <if condition="$Think.get.type eq '6'"><li class="current"><else /><li></if>
                <a href="?type=6"><span>产品</span></a>
            </li>
            <if condition="$Think.get.type eq '7'"><li class="current"><else /><li></if>
                <a href="?type=7"><span>教育</span></a>
            </li>
            <if condition="$Think.get.type eq '0'"><li class="current"><else /><li></if>
                <a href="?type=0"><span>其他</span></a>
            </li>
        </ul>
    </div>
</div>
 <div style="clear:both;"></div>
    <div style="margin: 10px 0 0 40px;">
        <div>
            <input id="search_keywords" style="width:380px; padding:3px 0 2px 5px; height:23px;border:2px #68ACFF solid;outline:none;vertical-align:middle;"
            onfocus="if(value=='请输入关键词'){this.style.color='#000000';value='';}"
            onblur="if(value==''){this.style.color='#666666';value='请输入关键词'}" value="请输入关键词"
            type="text" />
            <a class="btnbgbig" style="vertical-align:middle;" onclick="search_click();">
                <span>搜索问卷</span>
            </a>
        </div>
        <div style="clear:both;"></div>
   </div>
    <div style="clear:both;"></div>
    <div class="divhead864">
<div id="postmain">
    <div id="post_list" style="padding-top:1px;">
    <iframe  style=" position:absolute; z-index:1; display:none;" id="iframeObj" frameborder="0"></iframe>
    <div id="divComplete" style="position:absolute;width:370px;z-index:2;"></div>

        <div style="clear:both;"></div>
        <div id="ctl00_ContentPlaceHolder1_post_list"></div>
               <foreach name="left_list" item="record">
               <div class="post_item">
                    <div class="post_item_body">
                        <h3>
                            <a href="{$record['url']}" target="_blank">{
    
    $record['title']}</a>    
                        </h3>
                        <div class="post_item_summary">

                        </div>
                        <div class="post_item_foot">
                                <span>{
    
    $record['create_time']|date='Y-m-d H:i:s',###}</span>
                                &nbsp;&nbsp;题目数(<span>{
    
    $record['question_num']}</span>)
                                <span class="article_view">
                                    <a href="{$record['url']}" class="grayline" target="_blank">查看问卷(<span>{
    
    $record['post_time']}</span>)</a>&nbsp;&nbsp;</span> 
                       </div>
                    </div>
                </div>
                </foreach>
                <div class="clear">
                </div>
    </div>
    
    <div style="width: 540px; margin-top: 10px; text-align: center;" class="pager">
       <div id="ctl00_ContentPlaceHolder1_divPager">
 
       <span class="text" style="padding-left: 10px">{
    
    $pageinfo}</span>
                </div>
    </div>
   <div style="clear:both;"></div>
</div>
<div id="side_right">
    <div style="clear:both;"></div>
    <div>
        <a href="/newsurveys.aspx" style="float:left;" class='link-666'><b>热门问卷列表</b></a> 
        <div class="divclear"></div>
    </div>
    <div class="widget_right"> 
        <h2 class="right_topic_title">热门问卷排行榜</h2>
        <div class="widget_right_body">
            <ul>
                <assign name='num' value='1'/>
                <foreach name="hot_list" item="record">
                    <li>
                        <div style="float:left;"><img src="img/index_icon{$num++}.gif" style="border-width:0px;padding-right:5px;padding-top:3px; vertical-align:middle;" /></div>
                        <div style="float:left;width:240px;">
                            <a class="link-666" href="{$record['url']}" target="_blank">{
    
    $record['title']}({
    
    $record['post_time']})</a></div>
                        <div style="clear:both;"></div>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
   
    <div>
        <a href="/newsurveys.aspx" style="float:left;" class='link-666'><b>最新问卷列表</b></a> 
        <div class="divclear"></div>
    </div>
    <div class="widget_right"> 
        <h2 class="right_topic_title">最新问卷排行榜</h2>
        <div class="widget_right_body">
            <ul>
                <assign name='num' value='1'/>
                <foreach name="new_list" item="record">
                    <li>
                        <div style="float:left;"><img src="img/index_icon{$num++}.gif" style="border-width:0px;padding-right:5px;padding-top:3px; vertical-align:middle;" /></div>
                        <div style="float:left;width:240px;">
                            <a class="link-666" href="{$record['url']}" target="_blank">{
    
    $record['title']}({
    
    $record['post_time']})</a></div>
                        <div style="clear:both;"></div>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
</div>
</div>  
<div style="clear:both;"></div>
 
        </div>
        <div style="height:100px;"></div>
    </div>
    <div id="footer" style="height:70px;">
        <div class="coypright">
            <div style="float: left;">
                <img width="127" height="49" alt="" src="/images/indexnew/bottomlogo.gif"></div>
            <ul class="alCons">
                <li>Contact US</li>
                <li>Tel:18650346179</li>
                <li>E-mail:mail@codiy.net</li>
            </ul>
          
            <ul class="alCons alcons_txt">
                <li style="letter-spacing: 13px;">
                    <img width="210" height="25" alt="" src="{$Think.const.STATIC_DOMAIN}/img/bottom_right.gif"><br>
                    专业的问卷调查网站</li>
            </ul>
        </div>
        
    </div>
    <div style='display:none;'></div>

</body>
</html>

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/newlw/article/details/133544994