【JSP开源代码栏目提醒】:网学会员鉴于大家对JSP开源代码十分关注,论文会员在此为大家搜集整理了“AdminEntriesGrid.jsp”一文,供大家参考学习
<%@ include file="Common.jsp" %><%!
//
// Filename: AdminEntriesGrid.jsp
static final String sFileName = "AdminEntriesGrid.jsp";
static final String PageBODY = "bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\" alink=\"#FF0000\"";
static final String FormTABLE = "border=\"0\" cellspacing=\"0\" cellpadding=\"2\"";
static final String FormHeaderTD = "align=\"center\" bgcolor=\"#99CCFF\"";
static final String FormHeaderFONT = "style=\"font-size: 12pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica; font-weight: bold\"";
static final String FieldCaptionTD = "bgcolor=\"#FFFF99\"";
static final String FieldCaptionFONT = "style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\"";
static final String DataTD = "bgcolor=\"#F5F5F5\"";
static final String DataFONT = "style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica\"";
static final String ColumnFONT = "style=\"font-size: 10pt; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica; font-weight: bold\"";
static final String ColumnTD = "bgcolor=\"#FFD9E5\"";
%><%
String cSec = checkSecurity(3, session, response, request);
if ("sendRedirect".equals(cSec) ) return;
boolean bDebug = false;
String sAction = getParam( request, "FormAction");
String sForm = getParam( request, "FormName");
String sAdminEntriesGridErr = "";
String sSearchErr = "";
java.sql.Connection conn = null;
java.sql.Statement stat = null;
String sErr = loadDriver();
conn = cn();
stat = conn.createStatement();
if ( ! sErr.equals("") ) {
try {
out.println(sErr);
}
catch (Exception e) {}
}
%>
<html>
<head>
<title>YellowPages</title>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<jsp:include page="Header.jsp" flush="true"/>
<table>
<tr>
<td valign="top">
<% Search_Show(request, response, session, out, sSearchErr, sForm, sAction, conn, stat); %>
</td>
</tr>
</table>
<table>
<tr>
<td valign="top">
<% AdminEntriesGrid_Show(request, response, session, out, sAdminEntriesGridErr, sForm, sAction, conn, stat); %>
</td>
</tr>
</table>
</body>
</html>
<%%>
<%
if ( stat != null ) stat.close();
if ( conn != null ) conn.close();
%>
<%!
void AdminEntriesGrid_Show (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.jsp.JspWriter out, String sAdminEntriesGridErr, String sForm, String sAction, java.sql.Connection conn, java.sql.Statement stat) throws java.io.IOException {
String sWhere = "";
int iCounter=0;
int iPage = 0;
boolean bIsScroll = true;
boolean hasParam = false;
String sOrder = "";
String sSQL="";
String transitParams = "";
String sQueryString = "";
String sPage = "";
int RecordsPerPage = 20;
String sSortParams = "";
String formParams = "";
String pname="";
formParams = "name=" + toURL(getParam( request, "name")) + "&";
// Build WHERE statement
//-- Check name parameter and create a valid sql for where clause
pname = getParam( request, "name");
if (pname != null && ! pname.equals("")) {
hasParam = true;
sWhere += "i.name like '%" + replace(pname, "'", "''") + "%'";
}
if (hasParam) { sWhere = " AND (" + sWhere + ")"; }
// Build ORDER statement
sOrder = " order by i.name Asc";
String sSort = getParam( request, "FormAdminEntriesGrid_Sorting");
String sSorted = getParam( request, "FormAdminEntriesGrid_Sorted");
String sDirection = "";
String sForm_Sorting = "";
int iSort = 0;
try {
iSort = Integer.parseInt(sSort);
}
catch (NumberFormatException e ) {
sSort = "";
}
if ( iSort == 0 ) {
sForm_Sorting = "";
}
el