⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 note.jsp

📁 基于jsp的网络百宝箱
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GB18030" import="java.sql.*,java.util.Date,java.io.*"%>
<%@ include file="config.ini"%>
<%@ include file="conn.jsp"%>
<%@ include file="readlogin.jsp"%>
<jsp:useBean id="iCanDipage" class="com.iCan.DipageBean" scope="page" />
<%
    iCanDipage.setCountPageRecord(recordsPerPage);
%>
<html>

<head>
<%@ include file="head.jsp"%>
</head>

<body>
<center>
<table border="0" width="768" id="table1" cellspacing="0" cellpadding="0">
	<tr>
	<%@ include file="top.jsp"%>
	</tr>
	<tr>
		<td width="90" valign="top">
	<%@ include file="menu.jsp"%>		</td>
		<td width="588" valign="top">
		<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
			<tr>
				<td>
				<table border="1" width="100%" id="table4" bordercolorlight="#0A9EE4" cellspacing="0" cellpadding="5" bordercolordark="#0A9EE4"  height=300>
					<tr>
						<td valign="top">
						<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">
							<tr>
								<td>
								<table border="0" width="100%" id="table6" cellspacing="0" cellpadding="0">
									<tr>
										<td valign="bottom" width="50%">
										<a href="note_add.jsp" target="_top">
										<img src="images/note-add.jpg" align="left" style="border-style: solid; border-width: 0" width="131" height="45"></a></td>
										<td width="50%">
										<img src="images/n-note.jpg" align="right" width="230" height="70"></td>
									</tr>
								</table>
								</td>
							</tr>
							<tr>
								<td><hr noshade color="#0A9EE4" size="1"></td>
							</tr>
							<tr>
								<td>
								<table border="0" width="100%" id="table8" cellspacing="0" cellpadding="0">
									<tr>
										<td>
										<form method="POST" target="_top" action="note.jsp" name="form1">
											<p align="right">
											<span style="font-size: 9pt">关键词:<input type="text" name="key" size="14" style="border: 1px solid #0A9EE4">&nbsp;&nbsp;&nbsp;&nbsp;
											<input type="submit" value="搜索" name="B1" style="border: 1px solid #0A9EE4">&nbsp;&nbsp;&nbsp;
											</span></p>
										</form>
										</td>
									</tr>
								</table>
								</td>
							</tr>
							<tr>
								<td>
								<table border="1" width="100%" id="table7" cellspacing="0" cellpadding="0" bordercolorlight="#0A9EE4" bordercolordark="#FFFFFF">
<tr>
										<td width="14%" height="22">
										<p align="center"><font color="#0A9EE4">
										<span style="font-weight: 700; font-size: 9pt">
										日期</span></font></td>
										<td width="59%" height="22" align="center">
										<font color="#0A9EE4">
										<span style="font-weight: 700; font-size: 9pt">
										主&nbsp; 题</span></font></td>
										<td width="21%" height="22" align="center" colspan="2">
										<font color="#0A9EE4">
										<span style="font-size: 9pt; font-weight: 700">
										操&nbsp; 作</span></font></td>
									</tr>
<%
String keyword=codeToString(request.getParameter("key"));
sqlstr="select id,date,title from note1 where user='"+iCan+"'";
if(keyword!=null)
{sqlstr=sqlstr+" and title like '%"+keyword.trim()+"%'";}
try
{
  rs=iCanDb.doSelect(sqlstr);
  if(rs.next())
  {
    rs.last();
    int count=rs.getRow();
    rs.beforeFirst();
    
    iCanDipage.setCountRecord(count);
    String pages=request.getParameter("dipage");
    if(iCanDipage.isFirstPage(pages))
       rs.beforeFirst();
    else
      rs.absolute(iCanDipage.getAbsoluteLocation());
    int dipagei=0;
    
    while(rs.next())
     {
      String id=rs.getString("id");
      Date datetemp1=rs.getDate("date");
      java.text.SimpleDateFormat datetemp2=new java.text.SimpleDateFormat("yyyy-MM-dd");   
      String date=datetemp2.format(datetemp1);
      String title=rs.getString("title");
%>
									<tr>
										<td width="14%" height="22">
										<p align="center"><span style="font-size: 9pt">
										<font color="#0A9EE4"><%=date%></font></span></td>
										<td width="59%" height="22" align="left"><span style="font-size: 9pt">&nbsp;&nbsp;<a href=note_read.jsp?id=<%=id%> target=_top><font color="#0A9EE4"><%=title%></font></a></span></td>
										<td width="9%" height="22">
										<p align="center">
										<span style="font-size: 9pt">
										<font color="#0A9EE4">[ </font> <a href="note_edit.jsp?id=<%=id%>" target=_top>
										<font color="#0A9EE4">修改</font></a><font color="#0A9EE4"> ]</font></span></td>
										<td height="22" width="9%">
										<p align="center"><span style="font-size: 9pt">
										<font color="#0A9EE4">[ </font> <a href="note_del.jsp?action=confirm&id=<%=id%>" target=_top>
										<font color="#0A9EE4">删除</font></a><font color="#0A9EE4"> ]</font></span></td>
									</tr>
<%
        dipagei++;
        if(dipagei>=iCanDipage.getCountPageRecord()) break; //当前页显示完,则退出循环
    }
%>
</table><table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" style="font-size: 9pt; font-family: 宋体" height="20">
<tr><td width="100%" valign="bottom">
<%
iCanDipage.showDipageBar("note.jsp",out);
%></td></tr></table>
<%
  }
  else
  {
%>
									<tr>
										<td height="25" colspan="4"><span style="font-size: 9pt">&nbsp;&nbsp;&nbsp; 
										暂无记录!</span></td>
									</tr></table>
<%
  }
}
catch(Exception e)
{
  out.print("<script>");
  out.print("alert('"+e+"');");
  out.print("location.href='index.jsp';");
  out.print("</script>");
}
%>
								</td>
							</tr>
							<tr>
								<td> </td>
							</tr>
							<tr>
								<td>
								<p align="center"><input type="button" value="返回" name="B2" style="border: 1px solid #156FC7" onclick="javascript:location.href='note.jsp';"></td>
							</tr>
							<tr>
								<td> </td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td width="90"> </td>
	</tr>
	<tr>
		<td width="90" valign="top">
	 </td>
		<td width="588" valign="top">
<%@ include file="copyright.jsp"%>
		</td>
		<td width="90"> </td>
	</tr>
</table>
<p>
</center>
</p>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -