Volunteer management system based on ssm (idea+spring+springmvc+mybatis+jsp)

1. System introduction

This project is developed usingidea tools, jsp+spring+spring-mvc+mybatis+jquery< /span> development tool. navicatTechnically written, the database uses mysql,

The system is divided into 4 roles: administrator, volunteer, visitor, and initiator.

2. Module Introduction

administrator

1. Login

2. Manage volunteers

3. Manage tourists

4. Management initiator

5. Management announcement

6. Management activity categories

7. Management activities

8. Manage event registration

9. Statistics

initiator

1. Login

2. Personal information management

3. Volunteer activity management

4. Volunteer activity registration management

5. Announcement management

volunteer

1. Log in and register (the login operation needs to be approved by the administrator)

2. View activities

3. Registration activities

4. Check the announcement

5. Personal information management

6. Historical activity record query

tourists

1. Log in and register (the login operation needs to be approved by the administrator)

2. Personal information management

3. Apply to become a volunteer

4. Check the announcement

5. View activities


Project Introduction
Difficulty Level: ✩✩
User Type: 4 Roles (Administrator, Volunteer, Visitor, Initiator) Whether there is pagination: There is pagination JSP page Quantity: more than 20 pieces Number of database tables: 7 tables Whether it uses a framework: Yes Whether it is based on Maven environment: No Running server: Tomcat7.0/8.0/8.5/9.0 and other versions Database: MySQL5.5/5.7/8.0 version Running tools: This system is developed using idea. It only supports idea running and does not support MyEclipse and eclipse running. Because the skeletons of the three are different, forcing the import to open and run may lead to unknown errors. Running environment: Windows 7 or 10, JDK1.8 Back-end technology: JSP, ssm framework Front-end Technology: HTML, CSS, JS, JQuery, etc. Development language: Java language Project architecture: B/S architecture
Design pattern: MVC












Related screenshots

 

Related code

Log in

<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录</title>
    <link type="text/css" rel="stylesheet" href="<%=path %>/resource/login/css/login.css" />
    <link rel="stylesheet" type="text/css" href="<%=path %>/resource/layui/css/layui.css"/>
    <link href="<%=path %>/resource/login/css/bootstrap.min.css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=path %>/resource/login/js/jquery-1.11.1.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            var height=$(document).height();
            $('.main').css('height',height);
        })
    </script>
</head>

<body>
<div class="main">
    <div class="main0">
        <div class="main_left">
            <img src="<%=path %>/resource/login/images/login-image-3.png" class="theimg"/>
            <img src="<%=path %>/resource/login/images/login-image-2.png" class="secimg"/>
            <img src="<%=path %>/resource/login/images/login-image-1.png" class="firimg"/>
        </div>
        <div class="main_right">
            <div class="main_r_up">
                <img src="<%=path %>/resource/login/images/user.png" />
                <div class="pp">登录</div>
            </div>
            <form id="loginForm"  method="post">
                <div class="sub"><p>我是志愿者?<a href="toIndex"><span class="blue">前往主页面</span></a></p></div>
                <div class="txt">
                    <span style="letter-spacing:8px;">用户名:</span>
                    <input name="username" id="username" type="text" class="txtphone" placeholder="请输入注册手机号或用户名"/>
                    <br>
                    <span id="userNameErr" style="color:red" >${msg}</span>
                </div>
                <div class="txt">
                    <span style="letter-spacing:4px;">登录密码:</span>
                    <input name="password" id="password" type="password" class="txtphone" placeholder="请输入登录密码"/>
                </div>
                <div class="txt">
                    <span style=" float:left;letter-spacing:8px;">角色:</span>
                    <select name="type" id="type" class="form-control" style="margin-left:105px;width:200px;">
                        <option value="0">管理员</option>
                       <%-- <option value="1">游客</option>
                        <option value="2">志愿者</option>--%>
                        <option value="3">志愿发起者</option>
                    </select>
                </div>
                <button style="margin-left:105px;letter-spacing:22px; width:250px;margin-top:20px;"
                        class="btn btn-info" id="btnLogin"  type="button" >登录</button>

            </form>
        </div>
    </div>
</div>

<script src="<%=path %>/resource/component/layui/layui.js"></script>
<script src="<%=path %>/resource/component/pear/pear.js"></script>
<script>
    layui.use(['layer', 'form','jquery'], function(){
        var form = layui.form,
            layer = layui.layer,
            $= layui.jquery;
        form.render();//这句一定要加,占坑

            $('#btnLogin').click(function(){
                var username = $.trim($('#username').val());
                var password = $.trim($("#password").val());
                var type = $.trim($("#type").val());
                if(username == ''){
                    layer.msg('用戶名不能为空',function() {time:2000});
                    return false;
                }
                if(password == ''){
                    layer.msg('密码不能为空',function() {time:2000});
                    return false;
                }

                $.ajax({
                    type: "post", // post或get
                    url: "login", // 提交路径
                    data: {
                        username: username,
                        password: password,
                        type:type,
                    },
                    // dataType: "json", // 指定后台传来的数据是json格式
                    success: function(data) {

                        if (data == "ok") {
                            layer.msg('登陆成功!', {icon: 6});
                            // 延迟跳转
                            window.setTimeout("window.location='toMain'",900);
                        } else if(data == 'toIndex'){
                            layer.msg('登陆成功!', {icon: 6});
                            window.setTimeout("window.location='toIndex'",900);

                        }else {
                            layer.msg('账号或密码错误!', {icon: 5});


                        }

                    },

                    error: function(err) {}

                })
            })


        setTimeout(function(){ $("#userNameErr").html("")},3000);
    });
</script>
</body>
</html>

    @RequestMapping("/login")
    @ResponseBody
    public  String login(@RequestParam("username")String username,
                         HttpServletRequest request, @RequestParam("password")String password, @RequestParam("type")String type,
                         HttpSession session, HttpServletResponse response, ModelAndView mv) throws ServletException, IOException {
        session.removeAttribute("admin");
        session.removeAttribute("user");
        session.removeAttribute("organizer");
        User user =new User();
        Admin admin = new Admin();
        Organizer Organizer = new Organizer();
        request.getSession().setAttribute("type", type);
        String message = "error";
        if(type != null && type.equals("0")){
            admin.setUsername(username);
            admin.setPassword(password);
            Admin admin1 = service.selectAdmin(admin);
            if(admin1 != null){
                request.getSession().setAttribute("admin", admin1);
                message = "ok";
            }
        }else if(type != null && type.equals("1")){//游客
             user.setPhone(username);
             user.setPwd(password);
             user.setRole(type);
             User te = service.selectUser(user);
             if(te != null){
                request.getSession().setAttribute("user", te);
                message = "toIndex";
             }
        }else if(type != null && type.equals("2")){//志愿者
            user.setPhone(username);
            user.setPwd(password);
            user.setRole(type);
            User te = service.selectUser(user);
            if(te != null){
                request.getSession().setAttribute("user", te);
                message = "toIndex";
            }
        }else if(type != null && type.equals("3")){//志愿发起者
            Organizer.setPhone(username);
            Organizer.setPwd(password);
            Organizer Organizers = service.selectOrganizer(Organizer);
            if(Organizers != null){
                request.getSession().setAttribute("organizer", Organizers);
                message = "ok";
            }
        }
        return message;

    }

Not open source! ! ! ! ! !
Many of the data in the project screenshots are used for testing. You need to add appropriate data pictures by yourself.


Like and follow friends who are interested. Students can study it! ! ! ! !
Thanks = v =

Guess you like

Origin blog.csdn.net/qq_43485489/article/details/126504534