?? s_item.jsp
字號(hào):
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=GB2312"%>
<%
String getLoginmessage=(String)session.getValue("loginSign");
String unit_ID=(String)session.getValue("unitID");
if(getLoginmessage!="OK")
{
response.sendRedirect("index2.jsp");
}
%>
<jsp:useBean id="s_item" scope="page" class="firm.firm"/>
<%
String sql="select itemID,item_name,fill_date,applicant from I_s_item where unit_ID='"+unit_ID+"'";
ResultSet rs=s_item.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_item where unit_ID='"+unit_ID+"'";
ResultSet countrs=s_item.executeQuery(sql1);
if(countrs.next())
totalRec=countrs.getInt("cnt");
countrs.close();
s_item.closeStmt();
}
catch(Exception e){
e.printStackTrace();
}
int intPageCount=0;
intPageCount=(totalRec+pageLine-1)/pageLine;
%>
<html>
<head>
<title>項(xiàng)目申報(bào)</title>
<style>
<!--
:link {color:#000099}
:visited {color:#000099}
:active {color:#000099}
A:link,A:visited,A:active {text-decoration:none}
//-->
</style>
</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_item1.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">已申報(bào)項(xiàng)目</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="100%" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0">
<tr>
<td width="60%" height="17"><font size="2" color="#000099">項(xiàng)目名稱</font></td>
<td width="25%" height="17"><font size="2" color="#000099">申報(bào)日期</font></td>
<td height="17"><font size="2" color="#000099">申請(qǐng)者</font></td>
</tr>
<%
String itemID="";
String item_name="";
if (intPageCount>0)
{
for(i=1;i<=(intPage-1)*pageLine;i++)
rs.next();
for(i=1;i<=pageLine;i++){
if(rs.next()){
itemID=rs.getString("itemID");
item_name=rs.getString("item_name");
%>
<tr>
<td><font color="#000099"><a href="s_showItem.jsp?itemID=<%=itemID%>"><%=item_name%></a> </font></td>
<td><font color="#000099"><%=(rs.getString("fill_date")).substring(0,10)%> </font></td>
<td><font color="#000099"><%=rs.getString("applicant")%> </font></td>
</tr>
<%
}
}
}
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </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='s_item.jsp'>");
out.print("<p align='left'><font color='#000099'> 分頁</font> ");
if(intPage<2)
out.print("<font color='#000099'>首頁 上一頁 </font>");
else{
out.print("<a href='s_item.jsp?page=1'><font color='#000099'>首頁</font></a> ");
out.print("<a href='s_item.jsp?page="+(intPage-1)+"'><font color='#000099'>上一頁</font></a> ");
}
if(intPage-intPageCount>=0)
out.print("<font color='#000099'> 下一頁 尾頁</font>");
else{
out.print("<a href='s_item.jsp?page="+(intPage+1)+"'><font color='#000099'>下一頁</font></a> <a href='s_item.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'>個(gè)項(xiàng)目</font><b><font color='#000099'>"+pageLine+"</font></b><font color='#000099'>條/頁</font>");
out.print("<font color='#000099'>轉(zhuǎn)到第</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="center"><a href="s_itemInfo.jsp"><img src="../images/s_item2.gif" width="90" height="22" border="0"></a></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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -