📄 list.jsp
字号:
<%@ page contentType="text/html;charset=utf-8"%>
<%@include file="conn.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="description"/>
<meta name="keywords" content="keywords"/>
<meta name="author" content="author"/>
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>Summer Breeze</title>
<style type="text/css">
<!--
.STYLE1 {
font-size: 12px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div class="header">
<h1>欢迎来到我的通讯录</h1>
</div>
<div class="navigation">
<a href="all.jsp">主 页</a>
<a href="search.jsp">查 询</a>
<a href="list.jsp">列 表</a>
<a href="new.jsp">新 增</a>
<a href="index.jsp">退 出</a>
<div class="clearer"><span></span></div>
</div>
<div class="container">
<div class="content">
<h1><cite>浏览所有通讯录记录</cite></h1>
<%
System.out.print("okokoko");
String sql="SELECT * from view_pengyou";
//String mname=new String(request.getParameter("mname").getBytes("ISO8859_1"),"utf-8");
//
//
//
//
if (request.getParameter("Submit")!=null)
{
sql="SELECT * from view_pengyou where 1=1 ";
if (request.getParameter("mname")!=null)
{
String mname=new String(request.getParameter("mname").getBytes("ISO8859_1"),"utf-8");
sql=sql+" and ming like'%"+mname+"%'";
}
if (request.getParameter("xingbie")!=null)
{
String xingbie=new String(request.getParameter("xingbie").getBytes("ISO8859_1"),"utf-8");
if (xingbie.equals("1"))
xingbie="男";
else
xingbie="女";
sql=sql+" and xingbie_ming like'%"+xingbie+"%'";
}
if (request.getParameter("QQ")!=null)
{
String QQ=new String(request.getParameter("QQ").getBytes("ISO8859_1"),"utf-8");
sql=sql+" and QQ like'%"+QQ+"%'";
}
if (request.getParameter("TEL")!=null)
{
String TEL=new String(request.getParameter("TEL").getBytes("ISO8859_1"),"utf-8");
sql=sql+" and TEL like'%"+TEL+"%'";
}
if (request.getParameter("MOD")!=null)
{
String MOD=new String(request.getParameter("MOD").getBytes("ISO8859_1"),"utf-8");
sql=sql+" and MOb like'%"+MOD+"%'";
}
System.out.println(sql);
}
else
{
sql="SELECT * from view_pengyou";
}
//where dbo.pengyou.ming like '%"+request.getParameter("bianhao")+"%'
rs=stmt.executeQuery(sql);%>
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#AEC49E">
<tr align="center" valign="middle" bgcolor="#F0F3EA">
<td height="25" bgcolor="#F0F3EA"><span class="STYLE1">编号</span></td>
<td><span class="STYLE1">姓名
</span></td>
<td><span class="STYLE1">性别</span></td>
<td><span class="STYLE1">QQ</span></td>
<td><span class="STYLE1">家庭电话</span></td>
<td><span class="STYLE1">手机</span></td>
<td><span class="STYLE1">操作</span></td>
</tr>
<%
while (rs.next())
{
int id=rs.getInt("id");%>
<tr align="center" valign="middle" bgcolor="#F0F3EA">
<td height="25"> <%=id%></td>
<td> <%=rs.getString("ming")%></td>
<td> <%=rs.getString("xingbie_ming")%></td>
<td> <%=rs.getString("qq")%></td>
<td> <%=rs.getString("tel")%></td>
<td> <%=rs.getString("mob")%></td>
<td><A HREF="modify.jsp?id=<%=id%>">修改</A>|<A HREF="delete.jsp?del=1&id=<%=id%>">删除</A></td>
</tr>
<%}%>
</table>
<% stmt.close();
conn.close();
%>
<div class="divider"></div>
</div>
<div class="footer">
© 2006 <a href="index.jsp">Website</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> & <a href="http://validator.w3.org/check?uri=referer">XHTML</a>. Design by <a href="http://arcsin.se">Arcsin</a>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -