📄 card_find.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
BODY {
BACKGROUND-IMAGE: none; BACKGROUND-COLOR: #ade3ff
}
.STYLE5 {color: #FFFFFF; font-weight: bold; }
.STYLE6 {color: #FF0000}
-->
</style>
<jsp:useBean id="ConnBean" scope="page" class="com.bean.db.conn" />
</head>
<body>
<h2 align="center" class="STYLE6">借书证查询</h2>
<form id="form1" name="form1" method="post" action="?act=find">
<label>
<select name="titl" id="titl">
<option value="c_id">借书证编号</option>
<option value="Name">姓名</option>
<option value="xid">学号</option>
</select>
<input name="strText" type="text" id="strText" />
<input type="submit" name="Submit" value="确定" />
</label>
</form>
<p> </p>
<table width="96%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr align="center">
<td width="23%" bgcolor="#000099"><span class="STYLE5">借书证编号</span></td>
<td width="14%" bgcolor="#000099"><span class="STYLE5">学生姓名</span></td>
<td width="11%" bgcolor="#000099"><span class="STYLE5">班级</span></td>
<td width="11%" bgcolor="#000099"><span class="STYLE5">学号</span></td>
<td width="17%" bgcolor="#000099"><span class="STYLE5">地址</span></td>
<td width="10%" bgcolor="#000099"><span class="STYLE5">电话</span></td>
<td width="14%" bgcolor="#000099"><span class="STYLE5">操作</span></td>
</tr>
<%
try{
String str=request.getParameter("act");//注销
String id=request.getParameter("id");
if (str.equals("del"))
{
String sql="delete from card where id="+id;
if(ConnBean.execute(sql).equals("OK")){
out.println("<script language='javascript'>alert('借书证注销成功!');window.location.href='card_manage.jsp';</script>");
}
}
}
catch(Exception e){}
//-----------
try{
String str=request.getParameter("act");//挂失
String id=request.getParameter("id");
if (str.equals("lose"))
{
String sql="update card set lose=not(lose) where id="+id;
if(ConnBean.execute(sql).equals("OK")){
out.println("<script language='javascript'>alert('借书证挂失成功!');//window.location.href='card_manage.jsp';</script>");
}
}
}
catch(Exception e){}
//---------------
try{
String sql="";
String Titl=request.getParameter("titl");
String strText=request.getParameter("strText");
String str=request.getParameter("act");
if (str.equals("find"))
{
if (strText!=null){
sql="select * from card where "+Titl+"='"+strText+"'";
}else{
sql="select * from card";
}
for(ResultSet rs = ConnBean.executeQuery(sql);rs.next();){
String ids=rs.getString("id");
%>
<tr>
<td> <%=rs.getString("c_id")%></td>
<td> <%=rs.getString("name")%></td>
<td> <%=rs.getString("class")%></td>
<td> <%=rs.getString("xid")%></td>
<td> <%=rs.getString("adder")%></td>
<td> <%=rs.getString("dh")%></td>
<td align="center"><a href="?act=lose&id=<%=ids%>"><%if(rs.getBoolean("lose")){out.print("取消");}%>挂失</a>|<a href="?act=del&id=<%=ids%>" >注销</a></td>
</tr>
<%
}}}
catch(Exception e){}
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -