房产管理系统2

主界面

shouye.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 14:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="Bean.*" %>
<%@ page import="java.util.List" %>
<%@ page import="Dao.dao" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>房产管理系统</title>
    <style type="text/css">
        *{font-style: "微软雅黑"}

        #table th{background-color: #fff7d5;border: 1px solid black;}
        #table td{background-color: #cfecfc;border: 1px solid black;padding: 15px;color: #000;}
        #table a{text-decoration: none;font-weight: bold;}
        #table a:hover {text-decoration: underline;}
    </style>
</head>
<body>

<form  method="get"  action="houtai.jsp"  class="form-login">
    <h2 style="text-align: center;">房产管理系统</h2>
    <br>
    <div style="text-align: center;">
        <tr>
            <td>身份:

                <select name="profession">
                    <option value="1">系统管理员</option>
                    <option value="2">房产经纪</option>
                    <option value="3" selected>顾客</option>
                </select>
            </td>
        </tr>
        <div style="text-align: center;">
        <tr><td>
            用户名:<input type="text" name="username"><br></tr>

        <tr><td>
            密码:<input pattern="[a-zA-Z0-9]{6,12}" type="password" name="password"></td> </tr>
    </div>

    <tr>
        <td colspan="2"><div align="center">
            <input type="submit" value="登录"></div></td> </tr>
            <input type="button" value="注册" onclick="location.href='zhuce.jsp'" />
    </div>
</form>
</div>
</body>
</html>

houtai.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.*"    contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="Dao.dao" %>
<html>
<head>
    <title>从index获取数据</title>

</head>
<body>
<jsp:useBean id="util" class="Dao.dao"/>
<%
    //获取前端index的登录数据
    request.setCharacterEncoding("UTF-8");//编码一定设置
    String profession=request.getParameter("profession");
    //  String username=request.getParameter("username");
    String name =request.getParameter("username");
    String mima=request.getParameter("password");//取出login.jsp的值


        switch(profession) {
            case "1":
                if(util.judgeguanli(name, mima)){
                    response.sendRedirect("guanliyuan.jsp");break;
                }
                else {
                out.print("<script language='javaScript'> alert('密码错误');</script>");
                response.setHeader("refresh", "0;url=index.jsp");
            }

            case "2":     if(util.judgejingji(name, mima)){
                response.sendRedirect("jingjiren.jsp");break;
            }
            else {
                out.print("<script language='javaScript'> alert('密码错误');</script>");
                response.setHeader("refresh", "0;url=index.jsp");
            }
            case "3":    if(util.judgeguke(name, mima)){
                response.sendRedirect("guke.jsp");break;
            }
            else {
                out.print("<script language='javaScript'> alert('密码错误');</script>");
                response.setHeader("refresh", "0;url=index.jsp");
            }

        }
%>


</body>
</html>

<%!
    private void judgeguanli() {
    }
%>

zhuce.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>录入</title>
</head>
<form id="1" action ="zhuce-backstage.jsp" method="get">
    <p style="text-align:center;color:black; font-size:20px">
        <br>
        身份证号码:
        <label>
            <input type="text" name="IdNumber"size="15"/>
        </label>
        <br><br>
        姓名:
        <label>
            <input type="text" name="UserName"size="3"/>
        </label>
        <br><br>
        性别:
        <label>
            <input type="radio" name="sex" value="男" />
        </label><label>
            <input type="radio" name="sex" value="女" />
        </label>女
        手机号码:
        <label>
            <input type="text" name="Phone"size="10"/>
        </label>
        <br><br>
        家庭住址:
        <label>
            <input type="text" name="Address"size="10"/>
        </label>
        <br><br>
        密码:
        <label>
            <input type="text" name="mima"size="10"/>
        </label>
        <br><br>
        <input type="submit" value="注册"/>
        <input type="reset" value="重置"/>
    </p>
</form>
</html>
zhuce-backstage.jsp
<%@ page contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>处理</title>
</head>

<body>
<jsp:useBean id="util" class="Dao.dao"/>
<%
    String sfnum= request.getParameter("IdNumber");
    String name= request.getParameter("UserName");
    String sex= request.getParameter("sex");
    String sjnum= request.getParameter("Phone");
    String home= request.getParameter("Address");
    String mima= request.getParameter("mima");

    if(util.queryEmpty(sfnum,name,sex,sjnum,home,mima)){
        out.print("<script language ='javaScript'> alert('输入不能为空,请完成填写');window.history.back(-1); </script>");
    }else if(util.sfzhm(sfnum)){
        out.print("<script language ='javaScript'> alert('身份证必须为18位,且只能最后一位为X或数字');window.history.back(-1); </script>");
    }else if(util.chachong(sfnum)){
        out.print("<script language ='javaScript'> alert('录入身份证号码重复');window.history.back(-1); </script>");
    }else{
        util.input(sfnum,name,sex,sjnum,home,mima);
        out.print("<script language='javaScript'> alert('录入成功');</script>");
        response.setHeader("refresh", "0;url=main.jsp");
    }
%>
</body>
</html>

guke.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>顾客功能页面</title>
    <style type="text/css">
        .bg {
            background-image:url(images/bg_2.jpg);
            background-size:cover;
        }
        *{font-style: "微软雅黑"}
        #table{ border-collapse: collapse; margin: auto;text-align: center;}
        #table th{background-color: #fff7d5;border: 1px solid black;}
        #table td{background-color:#cffcd5;border: 1px solid black;padding: 15px;color: #000;}
        #table a{text-decoration: none;font-weight: bold;}
        #table a:hover {text-decoration: underline;}
    </style>
</head>
<body class="bg">
<h2 style="text-align: center;">你好!顾客,请选择以下操作</h2>
<br>
<div style="text-align: center;">
    查看个人信息、修改个人密码、浏览房产信息,查询房产,购买房产
    <input type="button" value="查看个人信息" onclick="location.href='chakanguke.jsp'" />
    <br><br>
    <input type="button" value="修改个人密码" onclick="location.href='xiugaimimaguke.jsp'" />
    <br><br>
    <input type="button" value="浏览房产信息" onclick="location.href='liulanfangguke.jsp'" />
    <br><br>
    <input type="button" value="查询房产" onclick="location.href='chafangguke.jsp'" />
    <br><br>
    <input type="button" value="购买房产" onclick="location.href='buyhouse.jsp'" />


</div>
<br>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");

%>

</body>
</html>

jingjiren.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>经纪人功能页面</title>
    <style type="text/css">
        .bg {
            background-image:url(images/bg_2.jpg);
            background-size:cover;
        }
        *{font-style: "微软雅黑"}
        #table{ border-collapse: collapse; margin: auto;text-align: center;}
        #table th{background-color: #fff7d5;border: 1px solid black;}
        #table td{background-color:#cffcd5;border: 1px solid black;padding: 15px;color: #000;}
        #table a{text-decoration: none;font-weight: bold;}
        #table a:hover {text-decoration: underline;}
    </style>
</head>
<body class="bg">
<h2 style="text-align: center;">你好!经纪人,请选择以下操作</h2>
<br>
<div style="text-align: center;">

    <input type="button" value="查看个人信息" onclick="location.href='chakanjinngji.jsp'" />
    <br><br>
    <input type="button" value="修改个人密码" onclick="location.href='xiugaimimajingji.jsp'" />
    <br><br>
    <input type="button" value="浏览房产信息" onclick="location.href='liulanfangjingji.jsp'" />
    <br><br>
    <input type="button" value="查询房产" onclick="location.href='chafangjingji.jsp'" />
    <br><br>
    <input type="button" value="房产交易" onclick="location.href='jiaoyifangjingji.jsp'" />


</div>
<br>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");

%>

</body>
</html>

guanliyuan.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员功能页面</title>
    <style type="text/css">
        .bg {
            background-image:url(images/bg_2.jpg);
            background-size:cover;
        }
        *{font-style: "微软雅黑"}
        #table{ border-collapse: collapse; margin: auto;text-align: center;}
        #table th{background-color: #fff7d5;border: 1px solid black;}
        #table td{background-color:#cffcd5;border: 1px solid black;padding: 15px;color: #000;}
        #table a{text-decoration: none;font-weight: bold;}
        #table a:hover {text-decoration: underline;}
    </style>
</head>
<body class="bg">
<h2 style="text-align: center;">你好!管理员,请选择以下操作</h2>
<br>
<div style="text-align: center;">

    <input type="button" value="新添房产信息" onclick="location.href='addfangchan.jsp'" />
    <br><br>
    <input type="button" value="房产授权" onclick="location.href='shouquan.jsp'" />
    <br><br>
    <input type="button" value="停售房产" onclick="location.href='tingshou.jsp'" />
    <br><br>
    <input type="button" value="查询房产信息" onclick="location.href='chaxunfang.jsp'" />
    <br><br>
    <input type="button" value="顾客审核" onclick="location.href='gukeshenhe.jsp'" />
    <br><br>
    <input type="button" value="新增房产经纪人" onclick="location.href='addjingji.jsp'" />
    <br><br>
    <input type="button" value="密码重置" onclick="location.href='mimachongzhi.jsp'" />



</div>
<br>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");

%>

</body>
</html>

tianjiafangchan.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 15:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加房产</title>
</head>
<body>
<form action="addfangchan`.jsp" method="get">
    <table align="center" border="1" width="500">
        <tr>
            <td>房产编号: </td>
            <td>
                <label>
                    <input type="text" name="houseid" />
                </label>
            </td>
        </tr>
        <tr>
            <td>户型: </td>
            <td>
                <label>
                    <input type="radio" name="room" value="四室两厅">四室两厅<br>
                    <input type="radio" name="room" value="四室一厅">四室一厅<br>
                    <input type="radio" name="room" value="三室两厅">三室两厅<br>
                    <input type="radio" name="room" value="三室一厅">三室一厅<br>
                    <input type="radio" name="room" value="两室两厅">两室两厅<br>
                    <input type="radio" name="room" value="两室一厅" checked>两室一厅<br>
                </label>
            </td>
        </tr>
        <tr>
            <td>房产地址: </td>
            <td>
                <label>
                    <input type="text" name="address" />
                </label>
            </td>
        </tr>
        <tr>
        <td>建造年份: </td>
        <td>
            <label>
                <input type="text" name="year" />
            </label>
        </td>
    </tr>
        <tr>
            <td>建造面积: </td>
            <td>
                <label>
                    <input type="text" name="area" />
                </label>
            </td>
        </tr>
        <tr>
            <td>销售报价 </td>
            <td>
                <label>
                    <input type="text" name="sales" />
                </label>
            </td>
        </tr>
        <tr>
            <td>销售状态:</td>
            <td>
                <label>
                    <select name="status">
                        <option value="在售">在售</option>
                        <option value="代售">代售</option>
                        <option value="意向">意向</option>
                        <option value="售出" selected>售出</option>
                        <option value="停售">停售</option>
                    </select>
                </label>
            </td>
        </tr>


        <tr align="center">
            <td colspan="2">
                <input type="submit" value="提交" />
                <input type="reset" value="重置" />
            </td>
        </tr>
    </table>
</form>
</body>

</html>

tianjiafangchan`.jsp

<%--
  Created by IntelliJ IDEA.
  User: 榕宝
  Date: 2021/12/3
  Time: 16:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<jsp:useBean id="util" class="Dao.dao"/>
<%
    String houseid= request.getParameter("houseid");
    String room= request.getParameter("room");
    String address= request.getParameter("address");
    String year= request.getParameter("year");
    String area= request.getParameter("area");
    String sales= request.getParameter("sales");
    String status= request.getParameter("status");
util.input2(houseid,room,address,year,area,sales,status);
    out.print("<script language='javaScript'> alert('录入成功');</script>");
    response.setHeader("refresh", "0;url=guanliyuan.jsp");

%>
</body>
</html>

 前篇地址:房产管理系统1 - zrswheart - 博客园 (cnblogs.com)

后续地址:暂时为空

posted @ 2021-12-03 21:27  zrswheart  阅读(242)  评论(1编辑  收藏  举报