?? z_unit.jsp
字號:
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=GB2312"%>
<%
String z_Loginmessage=(String)session.getValue("z_loginSign");
String adminID=(String)session.getValue("adminID");
if(z_Loginmessage!="OK")
{
response.sendRedirect("index4.jsp");
}
%>
<jsp:useBean id="z_unit" scope="page" class="firm.firm"/>
<%
String sql="select unit_ID,unit_name,corporation from I_s_info";
ResultSet rs=z_unit.executeQuery(sql);
int pageLine=20;
int totalRec=0;
int intPage=1;
int i;
if (request.getParameter("page")!=null)
intPage=Integer.parseInt(request.getParameter("page"));
try{
String sql1="select count(*)as cnt from I_s_info";
ResultSet countrs=z_unit.executeQuery(sql1);
if(countrs.next())
totalRec=countrs.getInt("cnt");
countrs.close();
z_unit.closeStmt();
}
catch(Exception e){
e.printStackTrace();
}
int intPageCount=0;
intPageCount=(totalRec+pageLine-1)/pageLine;
%>
<html>
<head>
<title>項目總評</title>
<script language=JavaScript>
<!--
function disConfirm(){
return confirm("確認要刪除這個單位嗎?刪除后所有關于該單位的信息將同時刪除!");
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#4f71b8">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="3"> </td>
</tr>
<tr>
<td width="33%"> </td>
<td bgcolor="#FFFFFF">
<div align="center"><img src="../images/s_unitinfo.gif" width="112" height="22"></div>
</td>
<td width="33%"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="77" bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"> </td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font color="#000099">單位信息</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="100%" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" height="17"><font size="2" color="#000099">單位代碼</font></td>
<td width="60%" height="17"><font size="2" color="#000099">單位名稱</font></td>
<td height="17" width="13%"><font size="2" color="#000099">法人代表</font></td>
<td height="17"> </td>
</tr>
<%
if (intPageCount>0)
{
for(i=1;i<=(intPage-1)*pageLine;i++)
rs.next();
for(i=1;i<=pageLine;i++){
if(rs.next()){
String unit_ID=rs.getString("unit_ID");
String unit_name=rs.getString("unit_name");
%>
<tr>
<td><font color="#000099"><a href="z_showUnit.jsp?unit_ID=<%=unit_ID%>" target="right"><%=unit_ID%></a> </font></td>
<td><font color="#000099"><%=unit_name%> </font></td>
<td><font color="#000099"><%=rs.getString("corporation")%> </font></td>
<td><font color="#000099"><a href="z_deleteUnit.jsp?unit_ID=<%=unit_ID%>&&intPage=<%=intPage%>" onClick="return disConfirm()"><font color="#FF0000">刪除</font></a></font></td>
</tr>
<%
}
}
}
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
out.print("<tr>");
if(intPageCount*pageLine<totalRec)
intPageCount++;
if(intPage>intPageCount)
intPage=intPageCount;
if(intPage<1)
intPage=1;
out.print("<form method='post' name=fPageNum action='z_unit.jsp'>");
out.print("<p align='left'><font color='#000099'> 分頁</font> ");
if(intPage<2)
out.print("<font color='#000099'>首頁 上一頁 </font>");
else{
out.print("<a href='z_unit.jsp?page=1'><font color='#000099'>首頁</font></a> ");
out.print("<a href='z_unit.jsp?page="+(intPage-1)+"'><font color='#000099'>上一頁</font></a> ");
}
if(intPage-intPageCount>=0)
out.print("<font color='#000099'> 下一頁 尾頁</font>");
else{
out.print("<a href='z_unit.jsp?page="+(intPage+1)+"'><font color='#000099'>下一頁</font></a> <a href='z_unit.jsp?page="+intPageCount+"'><font color='#000099'>尾頁</font></a>");
}
out.print(" <font color='#000099'>頁次</font>:<strong><font color='#000099'>"+intPage+"/"+intPageCount+"</font></strong><font color='#000099'>頁</font>");
out.print(" <font color='#000099'>共</font><b><font color='#000099'>"+totalRec+"</font></b><font color='#000099'>個項目</font><b><font color='#000099'>"+pageLine+"</font></b><font color='#000099'>條/頁</font>");
out.print("<font color='#000099'>轉到第</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="+intPage+">");
out.print("<font color='#000099'>頁</font><input class=buttonface type='submit' value='GO' name='cndok'></span></p></form>");
out.print("</td>");
out.print("</tr>");
%>
<tr>
<td align="right" width="50%"><a href="z_addUnit.jsp"><img src="../images/addUnit.gif" width="80" height="22" border="0"></a> </td>
<td> <INPUT onclick=javascript:window.close(); type=image src="../images/shutdown.gif" width="80" height="22"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -