?? liblist.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="docBList" class="com.csbook.documentsystem.DocBaseMan" scope="page"/>
<jsp:useBean id="docBorrow" class="com.csbook.documentsystem.BorrowMan" scope="page"/>
<jsp:useBean id="docMan" class="com.csbook.documentsystem.DocMan" scope="page"/>
<jsp:useBean id="ce" class="com.csbook.documentsystem.ChangeEncoding" scope="page"/>
<html>
<head>
<title>電子政務檔案管理系統</title>
</head>
<body>
<%
String docBase=request.getParameter("docBase");
if(docBase==null)
{
ArrayList docBases=docBList.getDocBaseList();
Iterator it=docBases.iterator();
%>
<form name="form1" method="get" action="liblist.jsp">
請選擇檔案庫:
<select name="docBase">
<%
while(it.hasNext()){
%>
<option>
<%=(String)it.next()%>
</option>
<%
}
%>
</select>
<input type="submit" name="Submit" value="進入">
</form>
<%
}
else
{
String operator=(String)session.getAttribute("userId");
if(!docBList.isWritableForDocBase(docBase,operator))
{
%>
<jsp:forward page="err.jsp?err=您沒有權限管理該檔案庫"/>
<%
}
docBase=ce.changeCharset(docBase);
%>
<h3 align="center">本檔案庫中借閱申請列表</h3>
<table width="95%" border="1">
<tr>
<td><div align="center">檔案名稱</div></td>
<td><div align="center">借閱人</div></td>
<td><div align="center">操作</div></td>
</tr>
<%
ArrayList applications=docBorrow.getDocList(0);
Iterator it=applications.iterator();
StringTokenizer st=null;
int tempId,tempDoc;
String curDocBase;
while(it.hasNext()){
st=new StringTokenizer((String)it.next());
tempId=Integer.parseInt(st.nextToken());
tempDoc=Integer.parseInt(st.nextToken());
curDocBase=docMan.getDocBaseById(tempDoc);
curDocBase=ce.changeCharset(curDocBase);
if(curDocBase.equals(docBase)){
%>
<tr>
<td><div align="center"><%=docMan.getDocNameById(tempDoc)%></div></td>
<td><div align="center"><%=st.nextToken()%></div></td>
<td><div align="center"> <a href="libinfo.jsp?id=<%=tempId%>">察看</a></div></td>
</tr>
<%
}
}
%>
</table>
<%
ArrayList borrowed=docBorrow.getDocList(1);
it=borrowed.iterator();
%>
<h3 align="center">本檔案庫中已借出列表</h3>
<table width="95%" border="1">
<tr>
<td><div align="center">檔案名稱</div></td>
<td><div align="center">借閱人</div></td>
<td><div align="center">操作</div></td>
</tr>
<%
while(it.hasNext()){
st=new StringTokenizer((String)it.next());
tempId=Integer.parseInt(st.nextToken());
tempDoc=Integer.parseInt(st.nextToken());
curDocBase=docMan.getDocBaseById(tempDoc);
curDocBase=ce.changeCharset(curDocBase);
if(curDocBase.equals(docBase)){
%>
<tr>
<td><div align="center"><%=docMan.getDocNameById(tempDoc)%></div></td>
<td><div align="center"><%=st.nextToken()%></div></td>
<td><div align="center"> <a href="libinfo.jsp?id=<%=tempId%>">察看</a>
</div></td>
</tr>
<%
}
}
}
%>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -