📄 check_user.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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"><!-- InstanceBegin template="/Templates/st_template.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
//session.invalidate();
%>
<!-- InstanceBeginEditable name="doctitle" -->
<title>高校公寓综合管理平台</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.STYLE1 {color: #333333}
.STYLE4 {color: #660000}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-bottom: 0px;
}
#Layer3 { position:absolute;
left:798px;
top:109px;
width:222px;
height:15px;
z-index:2;
}
.STYLE2 {
font-size: 14px;
color: #000066;
}
-->
</style></head>
<%@ page import="java.util.Date,java.util.*,java.text.*"%>
<%@page import="myweb.DBContent.DBContent" %>
<body>
<%
if(session.getAttribute("user")==null)
{
out.print("<script>alert('请先登录!');window.open('../index.jsp','_self')</script>");
}
%>
<jsp:useBean id="db" class="myweb.DBContent.DBContent"></jsp:useBean>
<%
String dd;
Date nowdate=new Date();
int hour=nowdate.getHours();
if(hour>8&&hour<12)
{
dd="上午好,欢迎登陆高校公寓综合管理平台!";
}
else
{
dd="下午好,欢迎登陆高校公寓综合管理平台!";
}
%>
<%
String ddate=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
%>
<table width="1024" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center" background="../Templates/image/index_01.jpg"><!-- InstanceBeginEditable name="EditRegion6" -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="776" height="120">
<param name="movie" value="image/xuanjuan1.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="image/xuanjuan1.swf" width="776" height="120" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>
<!-- InstanceEndEditable -->
<div class="STYLE2" id="Layer3">今天是:
<%out.println(ddate);%>
</div></td>
</tr>
<tr>
<td colspan="2"><img src="../Templates/image/index_02.jpg" width="227" height="47" /><img src="../Templates/image/lijianxue11_03.jpg" width="797" height="47" /></td>
</tr>
<tr>
<td width="227" align="left" valign="middle"><span class="STYLE2">
<marquee scrollAmount=2 onmouseover=stop() onmouseout=start() >
<%=dd%>
</marquee>
</span> </td>
<td width="797"><!-- InstanceBeginEditable name="EditRegion7" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../Templates/image/index_056.jpg" width="797" height="25" /></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td width="227" height="49" background="../Templates/image/index_04.gif"> </td>
<td height="35" rowspan="3" align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion5" -->
<table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="120" align="center" valign="bottom">
<form action="check_user.jsp" method="post" name="form1" >
<table width="74%" border="1" align="center" bordercolor="#9999FF" bgcolor="#D7E8F2">
<tr align="left">
<td height="14" colspan="4" align="center"><font size="5"><strong>用户查询</strong></font>(请输入查询条件)</td>
</tr>
<tr>
<td width="17%" height="14" align="center"><span class="parentlink">用户名</span></td>
<td width="31%" height="14" align="left"><input name="name" type="text" class="titlebar" id="name" size="20" maxlength="10" />
</font><span class="STYLE4">*</span></td>
<td width="18%" height="14" align="center"><font color="#660000" size="3">
<input name="Submit" type="submit" class="small" value="查询" />
</font></td>
<td width="34%" height="14" align="left">加<span class="STYLE1"><span class="STYLE4">*</span></span>的为必填项!<span class="STYLE1"><font color="#660000" size="3">
<input name="check" type="hidden" id="check" value="ok" />
</font></span></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="74" align="center" valign="top">
<%@page import="myweb.bean.userlogin" %>
<jsp:useBean id="Ul" class="myweb.bean.userlogin"/>
<jsp:setProperty name="Ul" property="*"/>
<%
String d=request.getParameter("check")!=null?request.getParameter("check"):"";
String usertype=null;
if(d.equals("ok")){
String sql="select * from users where name='"+Ul.getName()+"'";
ResultSet rs=db.select(sql);
if(rs.next())
{
if((rs.getString("manager").trim()).equals("n"))
{
usertype="一般用户";
}
if((rs.getString("manager").trim()).equals("m"))
{
usertype="系统管理员";
}
if((rs.getString("manager").trim()).equals("p"))
{
usertype="维修人员";
}
%>
<table width="74%" border="1" align="center" bordercolor="#9999FF" bgcolor="#D7E8F2">
<tr align="left">
<td height="28" colspan="6" align="center"><font size="5"><strong>查询结果如下</strong></font></td>
</tr>
<tr>
<td width="12%" height="26" align="center"><span class="parentlink">用户名</span></td>
<td width="22%" align="left">
<input name="textfield" type="text" class="titlebar" value="<%=rs.getString("name")%>" /></td>
<td width="11%" align="center"><span class="parentlink">密码</span></td>
<td width="22%" height="26" align="left"><input name="textfield2" type="text" class="titlebar" value="<%=rs.getString("password")%>" readonly=""/> </td>
<td width="11%" height="26" align="center">类型</td>
<td width="22%" height="26" align="left"><input name="textfield3" type="text" class="titlebar" value=" <%=usertype%>" readonly=""/>
</td>
</tr>
</table>
<%
}
//else
// out.println("<script>alert('用户名有错误!');</script>");
}%>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -