• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

JSP实现树型组织架构(2)--显示orgView

发布: 2007-7-04 13:34 | 作者: admin | 来源:  网友评论 | 查看: 14次 | 进入软件测试论坛讨论

领测软件测试网 //orgView.jsp

<%@ page contentType="text/html;charset=Big5"%>
<%@ include file="orgConnInclude.jsp"%>

<%
request.setCharacterEncoding("big5");
PreparedStatement ps=null;
ResultSet rs=null;

String queryCount=" select count(*) "+
" from ngb_org "+
" where total like ? ORDER BY TOTAL ";

String queryName=" select * "+
" from ngb_org "+
" where total like ? ORDER BY TOTAL ";

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Big5">
<title>組織架構</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<font color="#0099FF" size=4><center>*****有限公司組織架構圖</center></font>
<div align="right"><a href="orgManage.jsp">管理入口</a>
</div>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<!--th width="7%" rowspan="2" bgcolor="#0099FF" scope="col">&nbsp;&nbsp;&nbsp;</th-->
<th width="29%" bgcolor="#0099FF" scope="col"><span class="style1">總經理</span></th>
<th width="19%" bgcolor="#0099FF" scope="col"><span class="style1">總經理直屬</span></th>
<th width="19%" bgcolor="#0099FF" scope="col"><span class="style1">處級所屬</span></th>
<th width="19%" bgcolor="#0099FF" scope="col"><span class="style1">部級所屬</span></th>
</tr>
<%
try{
int i=1;
ps=conn.prepareStatement(queryCount);
ps.setString(1, "A10%");
rs=ps.executeQuery();
int result=1;
while(rs.next())
{ result++;}
//out.println(result);

for( i=1; i<=result; i++){
ps=conn.prepareStatement(queryName) ;
String queryNameCondition="A"+(9+i)+"%";
//out.println(queryNameCondition);
ps.setString(1, queryNameCondition);
ResultSet rs1=ps.executeQuery();
String qa=null;
String qaTemp=null;
String qaTemp1=null;

while( rs1.next()){
qa=rs1.getString("total");
qaTemp=qa.substring(0,3);
qaTemp1=qa.substring(3,6);

%>

<tr bgcolor="#F0F8FF">
<td width="29%" height="18"><%=rs1.getString("name")%></td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
</tr>
<%

queryNameCondition=qaTemp1+"%";
//out.println(queryNameCondition);
ps.setString(1, queryNameCondition);
ResultSet rs2=ps.executeQuery();
int result1=1;
while(rs2.next())
{ result1++;}
//out.println(result1);
for( i=1; i<=result1; i++){
ps=conn.prepareStatement(queryName) ;
ps.setString(1, queryNameCondition);
ResultSet rs3=ps.executeQuery();
String qb=null;
String qbTemp=null;
String qbTemp1=null;
while( rs3.next()){

qb=rs3.getString("total");
qbTemp=qb.substring(3,5);
qbTemp1=qb.substring(3,6);
%>
<tr bgcolor="#F0F8FF">
<td width="29%" height="18">&nbsp;</td>
<td width="19%" height="18"><%=rs3.getString("name")%></td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
</tr>
<%
ps=conn.prepareStatement(queryCount);

queryNameCondition=qbTemp1+"%";



//out.println(queryNameCondition);
ps.setString(1, queryNameCondition);
ResultSet rs4=ps.executeQuery();
int result2=1;
while(rs4.next())
{ result2++;}
//out.println(result);
for( i=1; i<=result2; i++){
ps=conn.prepareStatement(queryName) ;
ps.setString(1, queryNameCondition);
ResultSet rs5=ps.executeQuery();
String qc=null;
String qcTemp=null;
String qcTemp1=null;
while( rs5.next()){
qc=rs5.getString("total");
qcTemp=qc.substring(3,5);
qcTemp1=qc.substring(3,6);
%>

<tr bgcolor="#F0F8FF">
<td width="29%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18"><%=rs5.getString("name")%></td>
<td width="19%" height="18">&nbsp;</td>
</tr>
<%

/* ps=conn.prepareStatement(queryC2);
ResultSet qd2=ps.executeQuery();
int cd2=0;
while(qd2.next())
{cd2++;}
out.println(cd2);
ps=conn.prepareStatement(queryCount);
if(cd2>0)
{ queryNameCondition="D"+(i+19)+"%";}
else
{ queryNameCondition="D"+(i+9)+"%";}*/
ps=conn.prepareStatement(queryCount);

queryNameCondition=qcTemp1+"%";

//out.println(queryNameCondition);
ps.setString(1, queryNameCondition);
ResultSet rs6=ps.executeQuery();
int result3=1;
while(rs6.next())
{ result3++;}
//out.println(result3);
for( i=1; i<=result3; i++){
ps=conn.prepareStatement(queryName) ;
ps.setString(1, queryNameCondition);
ResultSet rs7=ps.executeQuery();
while( rs7.next()){
%>
<tr bgcolor="#F0F8FF">
<td width="29%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18">&nbsp;</td>
<td width="19%" height="18"><%=rs7.getString("name")%></td>
</tr>
<%
ps=conn.prepareStatement(queryCount);
queryNameCondition="E"+(i+9)+"%";
//out.println(queryNameCondition);
ps.setString(1, queryNameCondition);
ResultSet rs8=ps.executeQuery();
int result4=1;
while(rs8.next())
{ result4++;}
//out.println(result3);
for( i=1; i<=result4; i++){
ps=conn.prepareStatement(queryName) ;
ps.setString(1, queryNameCondition);
ResultSet rs9=ps.executeQuery();
while(rs9.next()){
rs9.getString("name"); %>
<%}}%>
<%}}%>
<% }}%>
<% }}%>
<%}}%>
</table>
</body>
<%}
catch(SQLException se1)
{se1.printStackTrace();}
finally{conn.close();}%>
</html>



文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网