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

📄 student_man.jsp

📁 该程序实现的是部门管理系统
💻 JSP
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="student.dao.StudentInfo,java.util.*,commons.PageInation" %>
  <%
  	String path=request.getContextPath();
	ArrayList datalist=(ArrayList)request.getAttribute("DataList");
	if(datalist==null){
		datalist=new ArrayList();
	}
	request.removeAttribute("DataList");
	PageInation pageInation=(PageInation)request.getAttribute("PageInation");
	request.removeAttribute("PageInation");
	StudentInfo student=(StudentInfo)request.getAttribute("StudentInfo");
	request.removeAttribute("StudentInfo");
%>		 
<HTML>
 <head>
 	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
 <link rel="stylesheet" type="text/css" href="<%=path%>/css/student.css">
   </head>
 
<BODY>
<form name="frm" method="post">
	<input type="hidden" name="fileType" value="">
	
 	<input type="hidden" name="currentPage" value="<%=pageInation.getCurrentPage()%>">
 	<input type="hidden" name="totalCount" value="<%=pageInation.getTotalCount()%>">
 	<input type="hidden" name="pageSize" value="<%=pageInation.getPageSize()%>">
 	
 	<input type="hidden" name="id" value="<%=student.getId()==null?"":student.getId()%>">
 	<input type="hidden" name="name" value="<%=student.getName()==null?"":student.getName()%>">
 	
	<table  border=0>
        <tr class='td_header'>
            <th width=50></th><th width=100>id</th>
            <th width=100>name</th><th width=100>math</th>
            <th width=100>english</th><th width=100>physic</th>
            <th width=100>photo</th><th width=100>resume</th>
       <tr> 
		<% 
		for(int i=0;i<datalist.size();i++){
			StudentInfo st=(StudentInfo)datalist.get(i);
		%>
        <tr class='td_<%=i%2+1%>'>
        	<td><input type='checkbox' name='key' value='<%=st.getId()%>'></td>
        	<td><%=st.getId()%></td>
	       	<td><%=st.getName()==null?"":st.getName()%></td>
	       	<td><%=st.getMath()==null?"":st.getMath()%></td>
	       	<td><%=st.getEnglish()==null?"":st.getEnglish()%></td>
	       	<td><%=st.getPhysic()==null?"":st.getPhysic()%></td>
	       	<td>
	       	<% String photo=st.getPhoto();
	       		if(photo!=null&&!photo.equals("")){
	       		%>
	       		<a href="<%=path%>/upFile/<%=photo %>" target="new">
	       		<img src="<%=path %>/images/fjgl.gif">
	       		</a>
	       		<% 
	       		}	       	
	       	%>
	       	</td>
	       	<td>
	       	<% String resume=st.getResume();
	       		if(resume!=null&&!resume.equals("")){
	       		%>
	       		<a href="<%=path%>/upFile/<%=resume %>" target="new">
	       		<img src="<%=path %>/images/fjgl.gif">
	       		</a>
	       		<% 
	       		}	       	
	       	%>
	       	</td>
        </tr>
  <%         
 	}
%>
<tr>
<td colspan=8 width="100%" align="right">
	<TABLE bgColor="#C6E3FF"  width="100%" height="25" cellpadding="0" cellspacing="0" >
		<TR>
          <TD align="right" bgColor="#C6E3FF">
    	共<%=pageInation.getTotalCount()%>条&nbsp;|&nbsp;每页<%=pageInation.getPageSize()%>条&nbsp;|&nbsp;第<%=pageInation.getCurrentPage()%>/<%=pageInation.getTotalPages()%>页&nbsp;|&nbsp;
    <% if(pageInation.getCurrentPage() >1){%>
		<A HREF="javascript:gotoPage(1)">首页</A>&nbsp;|&nbsp;	
		<A HREF="javascript:gotoPage(<%=pageInation.getCurrentPage()-1%>)">上一页</A>&nbsp;|&nbsp;
	<%}
	else {%>
		首页&nbsp;|&nbsp;		
		上一页&nbsp;|&nbsp;		
	<%}
	if(pageInation.getCurrentPage() <pageInation.getTotalPages()){%>
		<A HREF="javascript:gotoPage(<%=pageInation.getCurrentPage()+1%>)">下一页</A>&nbsp;|&nbsp;	
		<A HREF="javascript:gotoPage(<%=pageInation.getTotalPages()%>)">尾页</A>&nbsp;|&nbsp;
	<%}
	else {%>
		下一页&nbsp;|&nbsp;	
		尾页&nbsp;|&nbsp;		
	<%}%>
    	<input type="button" value="GO" onclick="gotoPage(frm.pageNo.value)">
    	<input type="text" name="pageNo" size="3" >页&nbsp;&nbsp;
        </TD>
        </TR>
        </TBODY>
       </TABLE>
</td>
</tr>
</table>


<table> 
 <tr>
 <td onclick="add();" style="cursor:hand">添加&nbsp;|&nbsp;</td>
 <td onclick="edit();" style="cursor:hand">修改&nbsp;|&nbsp;</td> 
 <td onclick="del();" style="cursor:hand">删除&nbsp;|&nbsp;</td> 
 <td onclick="file(0);" style="cursor:hand">照片上传&nbsp;|&nbsp;</td> 
 <td onclick="file(1);" style="cursor:hand">简历上传&nbsp;|&nbsp;</td> 
 <td onclick="search();" style="cursor:hand">查询</td>
 <td>学号<input type="text" name="id1" value="">
 姓名<input type="text" name="name1" value=""> 
 </td> 
 </tr>
 </table>
</form>
</BODY></HTML>
<script type="text/javascript">
<!--
	function edit(){
		var key=frm.key;
		var count=0;
		for(i=0;i<key.length;i++){
			if(key[i].checked==true){
				count++;
			}
		}
		if(count==0){
			alert("未选中要修改的数据项!");
			return;
		}else if(count>1){
			alert("只能选中一条数据项!");
			return;
		}
		 
		frm.action="<%=path%>/servlet/GetStudentAction";
		frm.submit();
	}
	function del(){
		var key=frm.key;
		var count=0;
		for(i=0;i<key.length;i++){
			if(key[i].checked==true){
				count++;
			}
		}
		if(count==0){
			alert("未选中要删除的数据项!");
			return;
		}
		frm.action="<%=path%>/servlet/DelAction";
		frm.submit();
	}
	function add(){
		frm.action="<%=path%>/admin/student_add.jsp";
		frm.submit();
	}
	function file(fileType){
		var key=frm.key;
		var count=0;
		for(i=0;i<key.length;i++){
			if(key[i].checked==true){
				count++;
			}
		}
		if(count==0){
			alert("未选中要修改的数据项!");
			return;
		}else if(count>1){
			alert("只能选中一条数据项!");
			return;
		}
		 
		//frm.action="<%=path%>/servlet/UpdatePhotoAction";
		frm.fileType.value=fileType;
		frm.action="<%=path%>/admin/upload_file.jsp";
		frm.submit();
	}
function gotoPage(pageno){  
  if(pageno <= <%=pageInation.getTotalPages()%> && pageno > 0){
	  document.frm.currentPage.value = pageno;
	  document.frm.action="<%=path%>/servlet/GetListAction";
	  document.frm.submit();	    
  } else{
    alert("请输入合法页码!");
  	return false;
  }
}
function search(){  
	  document.frm.currentPage.value = "";
	  document.frm.id.value = document.frm.id1.value;
	  document.frm.name.value = document.frm.name1.value;
	  document.frm.action="<%=path%>/servlet/GetListAction";
	  document.frm.submit();	    
}

//-->
</script>

⌨️ 快捷键说明

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