⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teacher_list.jsp

📁 远程教育系统中教师管理系统,包含完整的教师管理,包括现有教育体系中的复杂教师管理.推荐
💻 JSP
字号:
<%/*
    用途:查询教师
    程序员:guoyehong
    完成时间:2004-8-25 11:25
    修改情况:
    修改时间:  修改原因:  修改人:
*/ %>
<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.sql.*" %>
<%
//////////////////////////////////////////////////////////////
// Privilege Guarding

	String 	PrivXP="查找教师信息";
	String 	PrivME="00206";
	String 	PrivOUT="HTML"; // HTML | XSL | NONE
%>
<%@ include file="../pub/privGuarding.jsp" %>	
<%@ page import="oracle.jdbc.driver.*"%>
<jsp:useBean id="work" scope="application" class="com.dbConnection.dbpool" />
<html>
<head>
<title>查询教师</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<%
String search_type = request.getParameter("search_type");
String search_value = request.getParameter("search_value");
String teach_leveltemp = request.getParameter("teach_level");
if (search_value!=null)
{
	search_value=search_value.trim();
}
String query = "";
String sql_level="";

String msg = "";
String link="";
com.dbConnection.MyResultSet RS;

//out.print("search_type=" + search_type + "<br>");
//out.print("search_value=" + search_value + "<br>");
//out.print("teach_level=" + teach_leveltemp + "<br>");



String sql="";
int totalItems = 0;
//生成查询教师类别的语句
		if(teach_leveltemp.equals("all"))
			sql_level = "(select id,name,teach_level,phone,status,gender,address,work_place,position,title from lrn_teacher_info) ";
		else
			sql_level = "(select id,name,teach_level,phone,status,gender,address,work_place,position,title from lrn_teacher_info where teach_level='"+teach_leveltemp+"') ";
//如果不输入查询值,则生成如下sql语句
	if (search_value == null || search_value.equals(""))
	{
	
			
		//生成总SQL语句	
		query = "select id,name,teach_level,phone,status,gender,address,work_place,position,title from "+sql_level+" ";
		//out.print(sql);
		//翻页用的传递参数的连接link	
		link = "&search_type="+search_type+"&search_value="+search_value+"&teach_level=" + teach_leveltemp;  
		 
	}	
	
//如果输入查询值,则生成如下语句
	else
	{
		query = "select id,name,teach_level,phone,status,gender,address,work_place,position,title from "+sql_level+" where "+search_type+" like '%"+search_value+"%'";
		//out.print(query);
		//翻页用的传递参数的连接link
		link = "&search_type="+search_type+"&search_value="+search_value+"&teach_level=" + teach_leveltemp;  
	}
						
   totalItems = work.countselect(query);
   if(totalItems < 1)
   {
	out.print("没有符合条件的教师! ");
	out.print("<a href=teacher_main.jsp>返回</a>");
	return;					  			
   }
					


//----------分页开始---------------
	int pagesize =0;
	String temp_pagesize = (String)session.getValue("pagesize");
	if (temp_pagesize == null || temp_pagesize.length() == 0 || temp_pagesize.equals("null"))
	{
		pagesize = 10;
	}
	else
	{
		pagesize = Integer.parseInt(temp_pagesize);
	}
	String spageInt = request.getParameter("pageInt");
	if(null == spageInt || spageInt.equals(""))
		spageInt = "1";
	int pageInt = Integer.parseInt(spageInt);
	if (totalItems <= (pageInt - 1) * pagesize)
	{
		pageInt = pageInt - 1;
		if(pageInt < 1)
		{
			pageInt = 1;
		}
	}
	
	int maxPage = (totalItems + pagesize - 1) / pagesize;
	if(pageInt > maxPage)
		pageInt = maxPage;
	int pageNext = pageInt + 1;
	int pageLast = pageInt - 1;

	//----------分页结束---------------
	 RS=work.execute_oracle_page(query,pageInt,pagesize);
	//com.dbConnection.MyResultSet RS=work.executeQuery(query);
     int row_count=0;
%>
<html><head><title>教师列表</title></head>
<body topmargin=0 leftmargin=0 bgcolor=FFFFFF>
<br>
<table   width="80%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="3F6C61">
  <tr> 
    <td height="24" colspan="9" align="center" class="t08_bgwhite_p2"> 教师列表 </td>
  </tr>
<tr><td class="t12_14_bgE3EAE9">教师ID</td>
     <td class="t12_14_bgE3EAE9">教师姓名</td>
     <td class="t12_14_bgE3EAE9">性别</td>
     <td class="t12_14_bgE3EAE9">类别</td>
     <td class="t12_14_bgE3EAE9">电话</td>
     <td class="t12_14_bgE3EAE9">教师状态</td>
</tr>	
<%
//while(RS != null && RS.next())
while(RS != null && RS.next())
{	
 	String id=RS.getString("id");
	String name=RS.getString("name"); 
 	String teach_level=RS.getString("teach_level"); 
 	
 	String phone=RS.getString("phone");
 	String status=RS.getString("status");  
 	String gender=RS.getString("gender"); 
 		
 	String sstatus=status;
  	if(status.equals("0000")){
        	sstatus="有效";
        }
  	if(status.equals("1111")){
                sstatus="无效";
        } 	
  	if(status.equals("2222")){ 
          	sstatus="过期";
        } 
%>		
<tr> <td class="t08_bgwhite_p2"><%=id%></td>
     <td class="t08_bgwhite_p2"><a href="teacher_edit.jsp?id=<%=id%>&pageInt=<%=pageInt%>"><%=name%></a></td>
     <td class="t08_bgwhite_p2"><%=gender%></td>
     <td class="t08_bgwhite_p2"><%=teach_level%></td>
     <td class="t08_bgwhite_p2"><%=phone%></td>
     <td class="t08_bgwhite_p2"><%=sstatus%></td>
</tr>			
<%}
work.close(RS);
%>
</table>
<%@ include file="../pub/dividepage.jsp" %>
<p align=center><a href="teacher_main.jsp">返回管理界面 </a></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -