<%--
  Created by IntelliJ IDEA.
  User: Vie
  Date: 2019/10/24
  Time: 16:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>修改密码</title>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="Style/Style.css" rel="stylesheet" type="text/css" />
</head>
<script language="JavaScript">
    function mycheck(){
        if(isNull(form1.Password.value)){
            alert("请输入原密码！");
            return false;
        }
        if(isNull(form1.Password2.value)){
            alert("请输入新密码！");
            return false;
        }
        if(isNull(form1.Password3.value)){
            alert("请输入重复密码！");
            return false;
        }
        if (document.form1.Password2.value != document.form1.Password3.value) {
            alert("您两次输入的新密码不一致！请重新输入！");
            return false;
        }
    }

    function isNull(str){
        if ( str == "" ) return true;
        var regu = "^[ ]+$";
        var re = new RegExp(regu);
        return re.test(str);
    }


</script>
<body>
<div align="right" style="color: lavender">欢迎你，<%=request.getParameter("Username")%></div>
<center>
    <table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="60" bgcolor="#E6F5FF" style="color:#06F; font-size:19px; font-weight:bolder; padding-left:50px;">高校公寓管理系统</td>
        </tr>
        <tr>
            <td height="30" background="Images/MenuBg.jpg">&nbsp;</td>
        </tr>
        <tr>
            <td height="500" align="center" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="191" height="500" align="center" valign="top" background="Images/leftbg.jpg">
                        <%@ include file="StudentLeft.jsp"%>
                    </td>
                    <td width="709" align="center" valign="top" bgcolor="#F6F9FE"><table width="709" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="30" background="Images/mainMenuBg.jpg" style="padding-left:25px;">修改密码</td>
                        </tr>
                        <tr>
                            <td height="470" align="center" valign="top" bgcolor="#F6F9FE"><form name="form1" method="post" action="PasswordUpdateSave.action" onSubmit="return mycheck()" >
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="33%" height="30" align="right">&nbsp;</td>
                                        <td width="67%">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="right"><span style="color:red;">*</span>请输入原密码：</td>
                                        <td><input name="Password" type="password" class="text2" id="Password">
                                            <%if(request.getAttribute("Msg")!=null){%>
                                            <span style="color:red;"><%=request.getAttribute("Msg")%></span>
                                            <%}%></td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="right"><span style="color:red;">*</span>请输入新密码：</td>
                                        <td><input name="Password2" type="password" class="text2" id="Password2"></td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="right"><span style="color:red;">*</span>请重复新密码：</td>
                                        <td><input name="Password3" type="password" class="text2" id="Password3"></td>
                                    </tr>
                                    <tr>
                                        <td height="30">&nbsp;</td>
                                        <td><input type="submit" name="button" id="button" value="修改密码"></td>
                                    </tr>
                                </table>
                            </form></td>
                        </tr>
                    </table></td>
                </tr>
            </table></td>
        </tr>
        <tr>
            <td height="35" background="Images/bootBg.jpg">&nbsp;</td>
        </tr>
    </table>

</center>
<div align="center" style="width: 100%;position: fixed;bottom: 0;color:yellow">
    <%!Date time= new Date();%>
    <%
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日 E HH时mm分ss秒");
    %>
    <h3><% out.println(sdf1.format(time)); %></h3>
</div>
</body>
</html>

