📄 searchsd.jsp
字号:
<%@ page language = "java" %>
<%@ page import = "java.io.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.math.*" %>
<%@ page import = "java.util.*" %>
<%@ page import = "common.*"%>
<%@ page contentType="text/html; charset=gb2312"%>
<%
request.setCharacterEncoding("gb2312");
Tools t = new Tools();
String sLevel = t.GetSessionAttribute(session,"level");
int Level = t.StrToInt(sLevel);
if(Level==0)
{
out.print(t.JSMsgGURL("请先登录!","../index.jsp"));
return;
}
/*-----------------------------------------------------------------------------------*/
String error = "";
int count = 0;//总记录条数
int perPage = 10;//每页显示数量
int pageCount = 0;//页数总量
int pageNum = 1;//当前页数
String pageNo = "1";//当前页数
SailingDate sd = new SailingDate();
SailingDate outsd = new SailingDate();
Vector v_sd = new Vector();
String sSearchType,Keywords;
int SearchType=0;
sSearchType = t.GetRequestParameter(request,"SearchType");
SearchType = t.StrToInt(sSearchType);
Keywords = t.GetRequestParameter(request,"Keywords");
try{pageNo = request.getParameter("Page").trim();}catch(Exception e){pageNo = "1";}
try{pageNum = Integer.parseInt(pageNo);}catch(Exception e){pageNum = 1;}
String SqlCondition="";
//out.print(SearchType);
switch(SearchType)
{
case 1:SqlCondition="where SRoute LIKE '%"+Keywords+"%' ";
break;
case 2:SqlCondition="where SLPort LIKE '%"+Keywords+"%' ";
break;
case 3:SqlCondition="where SDPort LIKE '%"+Keywords+"%' ";
break;
case 4:SqlCondition="where SSMaster LIKE '%"+Keywords+"%' ";
break;
}
if(error.equals(""))
{
try
{
error = sd.list(pageNum,perPage,SqlCondition+"ORDER BY SID DESC");
v_sd = sd.v_sd;
count = sd.count;
}catch(Exception e){}
pageCount = count%perPage==0?(count/perPage):(count/perPage+1);
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE><% Control cc = new Control();out.print(cc.SysName);%>——船期搜索</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META http-equiv="Content-Language" content="zh-CN">
<META content="all" name="robots">
<META content="xiaoqingfeng" name="author">
<META content="<%=cc.SysName%>" name="description">
<META content="<%=cc.SysName%>" name="keywords">
<!-- 调用样式表st -->
<LINK media="all" href="../css/css1.css" type=text/css rel=stylesheet>
<!-- 调用样式表end -->
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<script language="javascript">
function selectPage(ff)
{
ff.submit();
}
</script>
</HEAD>
<BODY>
<DIV align=center>
<SCRIPT src="../JS/top1.js" type=text/javascript></SCRIPT>
</DIV>
<TABLE width="750" height="312" border="0" align="center" cellPadding="0" cellSpacing="0">
<TBODY>
<TR>
<TD width="750" height="380" valign="top" class="bj_body_01">
<!---->
<form action="SearchSD.jsp" method="post" name="searchform">
<TABLE class="bgcolor_FF6500" cellSpacing="1" cellPadding="5" width="746" align="center" border="0">
<TBODY>
<TR>
<TD colspan="9"><div align="center" class="font_fff">
<p>船期搜索</p>
</div></TD>
</TR>
<TR class="bgcolor_eeeeee">
<TD colspan="9"><div align="center">共找到符合条件船期<%=count%>条 每页<%=perPage%>条 当前为第<%=pageNo%>页 共<%=pageCount%>页</div></TD>
</TR>
<TR class="bgcolor_eeeeee">
<TD>航线</TD>
<TD width=12%>船名</TD>
<TD width=5%>航次</TD>
<TD width=9%>起运港</TD>
<TD width=10%>起运日期</TD>
<TD width=15%>目的港</TD>
<TD width=10%>到达日期</TD>
<TD width=14%>船东</TD>
<TD width=10%>操作</TD>
</TR>
<% for(int i=0;i<v_sd.size();i++)
{
try{outsd = (SailingDate)v_sd.get(i);}catch(Exception e){}
%>
<TR class="bgcolor_FFFFFF">
<TD><%=outsd.SRoute%></TD>
<TD><%=outsd.SShip%></TD>
<TD vAlign=top width=5%><%=outsd.SSNumber%></TD>
<TD width=9% vAlign=top><%=outsd.SLPort%></TD>
<TD width=10% vAlign=top><%=t.FormatDate(outsd.SLDate)%></TD>
<TD width=15% vAlign=top><%=outsd.SDPort%></TD>
<TD width=10%><%=t.FormatDate(outsd.SDDate)%></TD>
<TD width=14%><%=outsd.SSMaster%></TD>
<TD width=10%><a href="../viewsd.jsp?SID=<%=outsd.SID%>">查看详细</a></TD>
</TR>
<% }
if(v_sd.size()==0)
{
%>
<TR class="bgcolor_FFFFFF">
<TD colspan="9" align="center" height="250">没有找到符合条件的船期</TD>
</TR>
<% }
%>
<TR>
<TD colspan="9" class="bgcolor_eeeeee">
<div align="center">
<%if(pageNum>1){%>
<a href="SearchSD.jsp?Page=<%=pageNum-1%>">上一页</a>
<%}else{%>
上一页
<%}%>
<%if(pageNum<pageCount){%>
<a href="SearchSD.jsp?Page=<%=pageCount%>">下一页 </a>
<%}else{%>
下一页
<%}%>
跳到第 <select name="Page" onChange="javascript:selectPage(myform)">
<option value="<%=pageNo%>"><%=pageNo%></option>
<%for(int i=1;i<=pageCount;i++)
if(pageNum!=i){%><option value="<%=i%>"><%=i%></option><%}%>
</select> 页 </div> </TD>
</TR>
</TBODY>
</TABLE>
<!---->
<table cellpadding="0" cellspacing="0" border="0" width="746" align="center" class="bgcolor_FF6500">
<tr>
<td width="114" height="30"> <span class="font_fff">船期搜索</span></td>
<td width="180">
<label>
<select name="SearchType" size="1">
<option value="1"<% if(SearchType==1) out.print(" selected");%>>按航线搜索</option>
<option value="2"<% if(SearchType==2) out.print(" selected");%>>按起运港搜索</option>
<option value="3"<% if(SearchType==3) out.print(" selected");%>>按目的港搜索</option>
<option value="4"<% if(SearchType==4) out.print(" selected");%>>按船东搜索</option>
</select>
</label></td>
<td width="173">
<label>
<input name="Keywords" type="text" id="Keywords" size="20" maxlength="15" value="<%=Keywords%>">
</label> </td>
<td width="279"><img src="../images/search.gif" alt="搜索" width="54" height="21" border="0" style="cursor:hand;" onClick="if(searchform.Keywords.value==''){alert('请输入搜索关键字!');searchform.Keywords.focus();}else{searchform.submit();}"></td>
</tr>
</table>
</form>
</TD>
</TR>
<tr>
<td align="center"><a href="#" onClick="location.href='VIPIndex.jsp';"><img src="../images/GoBackVIPIndex.gif" alt="返回会员首页" width="171" height="27" border="0"></a><a href="#" onClick="location.href='ListSD.jsp';"><img src="../images/GoBackListSD.gif" alt="返回会员首页" width="171" height="28" border="0"></a></td>
</tr>
</TBODY>
</TABLE>
<DIV align=center>
<SCRIPT src="../JS/end1.js" type=text/javascript></SCRIPT>
</DIV>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -