📄 admin_005fviewallborrows_jsp.java
字号:
package org.apache.jsp.admin;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class admin_005fviewallborrows_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.List _jspx_dependants;
static {
_jspx_dependants = new java.util.ArrayList(2);
_jspx_dependants.add("/admin/../ch.jsp");
_jspx_dependants.add("/admin/checkadmin.jsp");
}
public Object getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
request.setCharacterEncoding("gb2312");
response.setContentType("text/html;charset=gb2312");//½â¾öÖÐÎÄÂÒÂë
out.write('\r');
out.write('\n');
if(session.getAttribute("name")==null){
session.setAttribute("error","Äã·Ç·¨µÇ¼Ŷ!Çë´ÓÕýÈ·µÄµØÖ·µÇ¼£¡");
out.println("<script>document.location='../errorpage.jsp';</script>");
}
out.write('\r');
out.write('\n');
conndb.DbConnBean viewborrow = null;
synchronized (_jspx_page_context) {
viewborrow = (conndb.DbConnBean) _jspx_page_context.getAttribute("viewborrow", PageContext.PAGE_SCOPE);
if (viewborrow == null){
viewborrow = new conndb.DbConnBean();
_jspx_page_context.setAttribute("viewborrow", viewborrow, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
String sql="select * from borrowBook";
int temp=-2;
int id=0;
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>图书借阅信息</title>\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write("body,td,th {\r\n");
out.write("\tfont-size: 13px;\r\n");
out.write("}\r\n");
out.write("body {\r\n");
out.write("\tbackground-image: url(../images/R6C.GIF);\r\n");
out.write("}\r\n");
out.write("-->\r\n");
out.write("</style></head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
if(temp==0){out.println("对不起,目前还没有师生来借书!");}else{
out.write(" \r\n");
out.write("当前图书借阅信息\r\n");
out.write("<table width=\"95%\" border=\"2\" align=\"center\" cellpadding=\"4\" cellspacing=\"0\" bordercolor=\"#CCCCFF\">\r\n");
out.write(" <tr bordercolor=\"#009900\" bgcolor=\"#CCFFCC\">\r\n");
out.write(" <td width=\"6%\" align=\"center\"><strong>序号</strong></td>\r\n");
out.write(" <td width=\"8%\" align=\"center\"><strong>借书人</strong></td>\r\n");
out.write(" <td width=\"14%\" align=\"center\"><strong>借书证号</strong></td>\r\n");
out.write(" <td width=\"32%\" align=\"center\"><strong>图书名称</strong></td>\r\n");
out.write(" <td width=\"15%\" align=\"center\"><strong>图书编号</strong></td>\r\n");
out.write(" <td width=\"12%\" align=\"center\"><strong>借书时间</strong></td>\r\n");
out.write(" <td width=\"13%\" align=\"center\"><strong>还书截止日期</strong></td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
String sqll="select user.name,book.title,borrowBook.bookID,borrowBook.begintime,borrowBook.endtime,borrowBook.borrowID from borrowBook inner join book on book.bookid=borrowbook.bookid inner join user on user.borrowid=borrowbook.borrowid";
Connection conn=viewborrow.getConn();
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery(sqll);
while(rs.next()){
id++;
String username=rs.getString(1);
String bookname=rs.getString(2);
String bookid=rs.getString(3);
//String begintime=rs.getString(4).substring(0,10);
//String returntime=rs.getString(5).substring(0,10);
String borrowid=rs.getString(6);
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"center\">");
out.print(id );
out.write(" </td>\r\n");
out.write(" <td align=\"left\">");
out.print(username );
out.write(" </td>\r\n");
out.write(" <td align=\"left\">");
out.print(borrowid );
out.write(" </td>\r\n");
out.write(" <td align=\"left\">");
out.print(bookname );
out.write(" </td>\r\n");
out.write(" <td>");
out.print(bookid );
out.write(" </td>\r\n");
out.write("\r\n");
out.write(" </tr>\r\n");
out.write(" ");
}}
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td colspan=\"7\"> </td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -