JSP Implementation Tree organization structure (7)--Modify orgmanage.jsp

Source: Internet
Author: User
Tags modify
js| Architecture

<%@ 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 is like?" Order by Total ";

String queryname= "SELECT *" +
"From ngb_org" +
"Where Total is like?" Order by Total ";
%>

<meta http-equiv= "Content-type" content= "text/html; Charset=big5 ">
<title> Management organizations </title>
<style type= "Text/css" >
<!--
. style1 {color: #FFFFFF}
. style2 {color: #0066FF}
-->
</style>
<body>
<form action= "orginsert.jsp" >
<fieldset>
<legend align= "Right" >
<span class= "Style2" > New tissue Structure </span>
</legend>
<p align= "left" class= "Style2" > Department



<select name= "FDEP" >
<optgroup label= "president's Room" >
<option value= "The president's Room" > the manager's Room
<%
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 Ors1=ps.executequery ();
String Qa=null;
String Qatemp=null;
String Qatemp1=null;
String Obdep=null;
String Ocdep=null;

while (Ors1.next ()) {
Qa=ors1.getstring ("Total");
Qatemp=qa.substring (3,5);
Qatemp1=qa.substring (3,6);

%>


<%
querynamecondition=qatemp1+ "%";
Out.println (querynamecondition);
Ps.setstring (1, querynamecondition);
ResultSet Ors2=ps.executequery ();
int oresult1=1;
while (Ors2.next ())
{oresult1++;}
Out.println (RESULT1);
For (I=1 i<=oresult1; i++) {
Ps=conn.preparestatement (queryname);
Ps.setstring (1, querynamecondition);
ResultSet Ors3=ps.executequery ();
String Qb=null;
String Qbtemp=null;
String Qbtemp1=null;
while (Ors3.next ()) {

Qb=ors3.getstring ("Total");
Qbtemp=qb.substring (3,5);
Qbtemp1=qb.substring (3,6);
Obdep=ors3.getstring ("name");
%>
<br>
<optgroup label= "<%=obdep%>" >
<option value= "<%=obdep%>" ><%=obdep%>
<%
Ps=conn.preparestatement (Querycount);

querynamecondition=qbtemp1+ "%";



Out.println (querynamecondition);
Ps.setstring (1, querynamecondition);
ResultSet Ors4=ps.executequery ();
int oresult2=1;
while (Ors4.next ())
{oresult2++;}
OUT.PRINTLN (result);
For (I=1 i<=oresult2; i++) {
Ps=conn.preparestatement (queryname);
Ps.setstring (1, querynamecondition);
ResultSet Ors5=ps.executequery ();
String Qc=null;
String Qctemp=null;
String Qctemp1=null;
while (Ors5.next ()) {
Qc=ors5.getstring ("Total");
Qctemp=qc.substring (3,5);
Qctemp1=qc.substring (3,6);
Ocdep=ors5.getstring ("name");
%>
<option value=<%=ocdep%>><%=ocdep%>

<br>
<%
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 ()) {}}
}
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 ()) {
}}
%> </optgroup><%
}

}}


}

}
%>




<!--optgroup label= "Manufacturing" >
<option value= "manufacture" > Manufacturing
<option value= "making one" > Making a
<option value= "Manufacturing two" > manufacturing two parts
<option value= "Manufacturing three" > manufacturing three Parts
</optgroup-->

<%
}
catch (SQLException ose1)
{Ose1.printstacktrace ();}
%>

</select>
</p>
<p align= "left" class= "Style2" > New name
<input type= "text" name= "dep"/>
<input type= "Submit" id= "Submit" value= "Confirm" >
</p>
</fieldset>
</form>
<font color= "#0099FF" size=4></font>
<center>


<font color= "#0099FF" size=4><center>****** Co., Ltd. Organization Chart </center></font>

<table width= "100%" border= "1" cellspacing= "1" cellpadding= "1" >
<tr>
<!--th width= "7%" rowspan= "2" bgcolor= "#0099FF" scope= "col" > </th-->
<th width= "29%" bgcolor= "#0099FF" scope= "col" ><span class= "Style1" > Manager </span></th>
<th width= "19%" bgcolor= "#0099FF" scope= "col" ><span class= "Style1" > the manager of the direct metal </span></th>
<th width= "19%" bgcolor= "#0099FF" scope= "col" ><span class= "Style1" > Level </span></th>
<th width= "19%" bgcolor= "#0099FF" scope= "col" ><span class= "Style1" > Department </span></th>
<th width= "19%" bgcolor= "#0099FF" scope= "col" ><span class= "style1" > Delete Department </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 (3,5);
Qatemp1=qa.substring (3,6);

%>

<tr bgcolor= "#F0F8FF" >
&LT;TD width= "29%" height= "><%=rs1.getstring" ("name")%></td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "> <!--a href=" orgdelete.jsp?name=<%=rs1.getstring ("name")%> "> Erase Department < /a--></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" >
&LT;TD width= "29%" height= "> </td>
&LT;TD width= "19%" height= "><%=rs3.getstring" ("name")%></td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "><a href=" orgdelete.jsp?name=<%=rs3.getstring ("name")%> "> Delete Department </a ></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" >
&LT;TD width= "29%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "><%=rs5.getstring" ("name")%></td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "><a href=" orgdelete.jsp?name=<%=rs5.getstring ("name")%> "> Delete Department </a ></td>
</tr>
<%

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" >
&LT;TD width= "29%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "> </td>
&LT;TD width= "19%" height= "><%=rs7.getstring" ("name")%></td>
&LT;TD width= "19%" height= "><a href=" orgdelete.jsp?name=<%=rs7.getstring ("name")%> "> Delete Department </a ></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 ();} %>

The parent department can be dynamically displayed when the modification is added




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.