📄 tongxun_yuangong.jsp
字号:
<%@ page language="java" import="java.util.*,cn.jx.ecjtu.oa.ps.pojo.*,cn.jx.ecjtu.oa.servlets.dept.*,java.text.SimpleDateFormat,cn.jx.ecjtu.oa.services.*" pageEncoding="GBK"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>无标题文档</title>
<link href="../common/defaultFa/css/all.css" rel="stylesheet" type="text/css" />
<link href="../common/defaultFa/css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function Read(id){
window.showModalDialog("showDetailServlet?userId="+id, "dialogHeight:320px;dialogWidth:520px" );
}
function doCheck(){
var selectIndex=document.form1.selecta.selectedIndex;
var v=document.form1.selecta.options[selectIndex].value;
var keyword=document.form1.text.value;
if(v==2){
return true;
}
else if(v==4){
return true;
}
else{
if(!/^\d+$/.test(keyword)){
alert("输入格式不正确!\n请输入数字");
document.form1.text.select();
document.form1.text.focus();
return false;
}
else{
return true;
}
}
}
function initSelect(obj,setTo){
var options=obj.options;
for(i=0;i<options.length;i++){
if(options[i].value==setTo) options[i].selected=true;
if(setTo==4){
document.getElementById("dept").style.display= "block";
document.getElementById("other").style.display= "none";
}
}
}
function init(){
initSelect(document.form1.selecta,"${param.selecta}");
initSelect(document.form1.selectb,"${param.selectb}");
initSelect(document.form1.dept,"${param.dept}");
document.form1.elements["text"].value="${param.text}";
document.form1.elements["page"].value="${param.page}";
}
function changeKeyWord(obj){
if(obj.selectedIndex==3){
document.getElementById("dept").style.display= "block";
document.getElementById("other").style.display= "none";
}
else{
document.getElementById("dept").style.display= "none";
document.getElementById("other").style.display= "block";
}
}
function changePage(page){
if(page==0){
page=1;
}
document.form1.page.value=page;
document.form1.submit();
}
</script>
</head>
<%!
private String getChildrenTree(List<Node> children,int level){
StringBuffer str=new StringBuffer();
for(Node node:children){
str.append("<option value='");
str.append(node.getId());
str.append("'>");
for(int i=0;i<level;i++){
str.append("|");
str.append(" ");
}
str.append("|─");
str.append(node.getName());
str.append("</option>\n");
if(node.getChildren() != null && node.getChildren().size()>0){
str.append(getChildrenTree(node.getChildren(),level+1));
}
}
return str.toString();
}
%>
<body style="overflow-y:auto" onLoad="init();" background="summer_relaxation_JD047.jpg">
<form id="form1" name="form1" method="post" action="findDetailServlet" onsubmit="return doCheck();">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="tb_title">
<tr>
<th align="left" valign="middle">公司通讯录</th>
<td> </td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" class="tb_form" height="25">
<!--DWLayoutTable-->
<tr>
<td width="150" height="21" valign="top">查询类型:
<select name="selecta" onchange="changeKeyWord(this)">
<option id="word1" value="1">员工编号</option>
<option id="word2" value="2">员工姓名</option>
<option id="word3" value="3">联系电话</option>
<option id="word4" value="4">部门ID</option>
</select>
</td>
<td width="300"><span id="other" style="display: block;">
<select name="selectb" >
<option id="type1" value="=">等于</option>
<option id="type2" value=">">大于</option>
<option id="type3" value="<">小于</option>
<option id="type4" value="like">模糊</option>
</select>
<input type="text" name="text" value="" style="width: 100px;">
</span><span id="dept" style="display:none;">
<select name="dept" >
<option id="deptnum" value='0'>请选择部门</option>
<%
RootNode root=(RootNode)request.getAttribute("depts");
String str=null;
try{
str= getChildrenTree(root.getChildren(),0);
}
catch(Exception e){
}
out.println(str);
%>
</span>
</td>
<td ><input name="btn_new4" type="submit" id="btn_query" value=" 查 询 "></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="tb_data" id="tb_query">
<thead>
<tr>
<td width="21%" align="center">员工姓名</td>
<td width="19%" align="center">联系电话</td>
<td width="18%" align="center">家庭住址</td>
<td width="23%" align="center">电子邮件</td>
<td width="19%" align="center">操作</td>
</tr>
</thead>
<c:forEach items="${DETAIL}" var="detail">
<tr>
<td align="center">${detail.name}</td>
<td align="center" nowrap="nowrap">${detail.phone}</td>
<td align="center" nowrap="nowrap">${detail.address}</td>
<td height="20"><div align="center">${detail.email }</div></td>
<td align="center" nowrap="nowrap"><a href="#" onClick="Read(${detail.user_id})">详细信息</a></td>
</tr>
</c:forEach>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tb_foot">
<tr>
<td align="center"><a href="javascript:changePage(1)" onclick="">首页 </a>
<a href="javascript:changePage(${requestScope.pageNum-1 })">上一页</a>
<a href="javascript:changePage(${requestScope.pageNum+1 })">下一页 </a>
<a href="javascript:changePage(${requestScope.ALLPAGE})">最后一页</a>
<input name="page" type="text" value="${requestScope.pageNum }" size="3" />
<input name="btn_new" type="button" id="btn_new" value=" 跳转 "
onClick="form1.submit()" /></td>
</tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="tb_foot">
<tr>
<td align="center"> </td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -