【JSP开源代码栏目提醒】:网学会员为广大网友收集整理了,fav.jsp,希望对大家有所帮助!
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GB18030" import="java.sql.*,java.util.*,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="fav_add.jsp" target="_top">
<img src="images/fav-add.jpg" align="left" style="border-style: solid; border-width: 0" width="131" height="45"></a></td>
<td width="50%">
<img src="images/n-fav.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="fav.jsp" name="form1">
<p align="right">
<span style="font-size: 9pt">关键词:<input type="text" name="s_title" size="10" style="border: 1px solid #0A9EE4">
分类:<select size="1" name="s_sort" style="border: 1px solid #0A9EE4">
<option selected value="all">全部</option>
<option value="网站">网站
</option>
<option value="图片">图片</option>
<option value="音乐">音乐</option>
<option value="视频">视频</option>
<option value="Flash">Flash</option>
<option value="其他">其他</option>
</select>
<input type="submit" value="搜索" name="B1" style="border: 1px solid #0A9EE4">
</span></p>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" width="574" id="table7" cellspacing="0" cellpadding="2" bordercolorlight="#0A9EE4" bordercolordark="#FFFFFF">
<tr>
<td width="79" height="22">
<p align="center"><font color="#0A9EE4">
<span style="font-weight: 700; font-size: 9pt">
分类</span></font></td>
<td width="284" height="22" align="center">
<font color="#0A9EE4">
<span style="font-weight: 700; font-size: 9pt">
标题</span></font></td>
<td height="22" align="center" colspan="3">
<font color="#0A9EE4">
<span style="font-size: 9pt; font-weight: 700">
操 作</span></font></td>
</tr>
<%
String s_title=codeToString(request.getParameter("s_title"));
String s_sort=codeToString(request.getParameter("s_sort"));
sqlstr="select id,title,sort,urlstr from fav where user='"+iCan+"'";
if(s_title!=null)
{sqlstr=sqlstr+" and title like '%"+s_title.trim()+"%'";}
if(s_sort!=null&&(!s_sort.equals("all")))
{sqlstr=sqlstr+" and sort='"+s_sort+"'";}
sqlstr=sqlstr+" ORDER BY sort";
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");
String title=rs.getString("title");
String sort=rs.getString("sort").trim();
String urlstr =rs.getString("urlstr");
String sortimg="other.gif";
if(sort.equals("网站")){sortimg="web.gif";}
if(sort.equals("图片")){sortimg="pic.gif";}
if(sort.equals("音乐")){sortimg="music.gif";}
if(sort.equals("视频")){sortimg="vedio.gif";}
if(sort.equals("Flash")){sortimg="flash.gif";}
if(sort.equals("其他")){sortimg="other.gif";}
String sortaction="<a href='fav_read.jsp?id="+id+"' target=_top><font color=#0A9EE4>播放</font></a>";
if(sort.equals("网站")||sort.equals("其他")||sort.equals("图片")){sortaction="<a href='"+urlstr+"' target=_blank><font color=#0A9EE4>打开</font></a>";}
%>
<tr>
<td width="79" height="22" align="center"><img src=images/<%=sortimg%> alt="<%=sort%>"></td>
<td width="284" height="22">
<p align="left">
<span style="font-size: 9pt"><%=title%></span></td>
<td width="68" height="22" align="center"><span style="font-size: 9pt">
<font color="#0A9EE4">[ </font> <%=sortaction%><font color="#0A9EE4"> ]</font></span></td>
<td width="69" height="22" align="center"><span style="font-size: 9pt">
<font color="#0A9EE4">[ </font> <a href="fav_edit.jsp?id=<%=id%>" target=_top>
<font color="#0A9EE4">修改</font></a><font color="#0A9EE4"> ]</font></span></td>
<td height="22" width="69">
<p align="center"><span style="font-size: 9pt">
<font color="#0A9EE4">[ </font> <a href="fav_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("fav.jsp",out);
%></td></tr></table>
<%
}
else
{
%>
<tr>
<td height="25" colspan="5"><span style="font-size: 9pt">
暂无记录!</span></td>
</tr></table>
<%
}
}
catch(Exception e)
{
out.print("<script>");
out.print("alert('数据库错误!');");
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='fav.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>
上一篇:
fastadd.jsp
下一篇:
顶棚装饰工程施工