?? search.jsp
字號:
<%@ include file="conn.jsp"%>
<%request.setCharacterEncoding("GB2312");
String key=request.getParameter("key");
String stype=request.getParameter("stype");
String gzdd=request.getParameter("gzdd");
String stype1="company" ;
String gzdd1="noxz" ;
if(key==null){
key="";
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" href="inc/index.css" type="text/css">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>天天人才—>人才市場—>站內搜索</title>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function check()
{
if (isNaN(go2to.page.value))
alert("請正確填寫轉到頁數!");
else if (go2to.page.value=="")
{
alert("請輸入轉到頁數!");
}
else
go2to.submit();
}
//-->
</SCRIPT>
<body topmargin="0" leftmargin="0">
<SCRIPT language=JavaScript src="inc/f-index.js"></SCRIPT>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" height="358">
<tr>
</center>
<td width="293" height="284" valign="top">
<% int intPageSize;
int intRowCount;//記錄總數
int intPageCount;//總頁數
int intPage;//頁面參數
String strPage;//定義變量用來傳遞page
int i,j;
intPageSize=5;//定義每頁顯示5條記錄
strPage=request.getParameter("page");//取得當前的頁碼
if(strPage==null){//判斷初始頁面,如果沒有顯示記錄,就置為第一頁
intPage=1;
}else{
intPage=Integer.parseInt(strPage);//將strPage轉化為整數
if(intPage<1) intPage=1;
}
String sqlname,sqlname1;
if(stype1.equals(stype)){
if(gzdd1.equals(gzdd)){
sqlname="select * from scott.company where job like '%"+key+"%' or cname like '%"+key+"%' and job is not null order by id desc" ;
sqlname1="select count(id) from scott.company where job like '%"+key+"%' or cname like '%"+key+"%' and job is not null order by id desc" ;
}else{
sqlname="select * from scott.company where (job like '%"+key+"%' or cname like '%"+key+"%') and gzdd='"+gzdd+"' and job is not null order by id desc" ;
sqlname1="select count(id) from scott.company where (job like '%"+key+"%' or cname like '%"+key+"%') and gzdd='"+gzdd+"' and job is not null order by id desc" ;
}
} else{
if(gzdd1.equals(gzdd)){
sqlname="select * from scott.person where job like '%"+key+"%' or iname like '%"+key+"%' and job is not null order by id desc" ;
sqlname1="select count(id) from scott.person where (job like '%"+key+"%' or iname like '%"+key+"%') and job is not null order by id desc" ;
}else{
sqlname="select * from scott.person where (job like '%"+key+"%' or iname like '%"+key+"%') and gzdd='"+gzdd+"' and job is not null and gzdd='"+gzdd+"'order by id desc" ;
sqlname1="select count(id) from scott.person where (job like '%"+key+"%' or iname like '%"+key+"%') and gzdd='"+gzdd+"' and job is not null order by id desc" ;
}
}
ResultSet rt=stmt.executeQuery(sqlname1);
rt.next();
intRowCount=rt.getInt(1);//取得整數保存與intRowCount變量中
intPageCount=(intRowCount+intPageSize-1)/intPageSize;//計算出總頁數(記錄總數+每頁顯示的記錄-1)/每頁顯示的記錄)
if(intPage>intPageCount)
intPage=intPageCount;
i=(intPage-1)*intPageSize;
ResultSet rs=stmt.executeQuery(sqlname);
%>
<div align="left">
<table border="1" cellpadding="0" cellspacing="0" width="430" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td height="17" colspan="3" valign="bottom" width="426"></td>
</tr>
<tr>
<td width="426" height="6" colspan="3" valign="bottom"><font color="#000000"></font><font color="#000000">
共有[<font color="#ff0000"><%=intRowCount%></font>]條 頁次:<font color="#0000AE"><%=intPage%></font>/<%=intPageCount%></td>
<tr>
<td width="426" height="6" colspan="3" valign="bottom">
<% for(j=0;j<i;j++)
%>
<%-- 設置intPage參數 --%>
<FORM action=index.jsp method=POST>
<p align='center' vAlign='bottom'>
第<%=intPage%>頁 共<%=intPageCount%>頁
<%if(intPage<intPageCount){%>
<a href="search.jsp?page=<%=intPage+1%>&key=<%=key%>&stype=<%=stype%>&gzdd=<%=gzdd%>">下一頁</a>
<%}%>
<%if(intPage>1){%>
<a href="search.jsp?page=<%=intPage-1%>&key=<%=key%>&stype=<%=stype%>&gzdd=<%=gzdd%>">上一頁</a>
<%}%>
</form>
</td>
</tr>
<% if(stype1.equals(stype)){%>
<tr>
<td height="3" valign="top" colspan="3" bgcolor="#000000">
</td>
</tr>
<tr>
<td width="174" height="18" bgcolor="#EBEEF3" valign="bottom"> 公司名稱</td>
<td width="174" height="18" bgcolor="#EBEEF3" valign="bottom"> 招聘職位</td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="75"><p align="center">發布日期</p></td>
</tr>
<%
i=0;
while(i<intPageSize&&rs.next()){
%>
<tr>
<td width="174" height="18" bgcolor="#EBEEF3" valign="bottom"> <a href="javascript:openwin('company.jsp?uid=<%=rs.getString("uname")%>','top=10,left=80,width=460,height=420')"><%=rs.getString("cname")%></a></td>
<td width="174" height="18" bgcolor="#EBEEF3" valign="bottom"> <a href="javascript:openwin('job.jsp?uid=<%=rs.getString("uname")%>','top=10,left=80,width=460,height=420')"><%=rs.getString("job")%></a></td>
<td width="74" height="18" bgcolor="#EBEEF3" valign="bottom"><p align="center"><%=rs.getString("idate")%></p></td>
</tr>
<% i++;//通過I循環設置每頁的頁數
} %>
<tr>
<td height="3" valign="top" colspan="3" bgcolor="#000000">
</td>
</tr>
<tr>
<td width="422" height="8" valign="bottom" colspan="3">
<p align="center"><br>
【<a href="javascript:window.close()">關閉窗口</a>】</td>
</tr>
</table>
</div>
<% }else{ %>
<div align="left">
<table border="1" cellpadding="0" cellspacing="0" width="430" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td height="3" valign="top" colspan="5" bgcolor="#000000">
</td>
</tr>
<tr>
<td width="67" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="left"> 姓名</p>
</td>
<td width="45" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">性 別</p>
</td>
<td width="56" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">學 歷
</td>
<td width="178" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="left"> 應聘職位</td>
<center>
<td width="75" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">登錄日期</p>
</td>
</tr>
<%
i=0;
while(i<intPageSize&&rs.next()){
%>
</center>
<tr>
<td width="64" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="left"> <a href="javascript:openwin('person.jsp?uid=<%=rs.getString("uname")%>','top=10,left=80,width=460,height=420')"><%=rs.getString("iname")%></a></p>
</td>
<td width="48" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">[<%=rs.getString("sex")%>]</p>
</td>
<center>
<td width="55" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">[<%=rs.getString("edu")%>]</td>
<td width="179" height="18" bgcolor="#EBEEF3" valign="bottom"> <%=rs.getString("job")%></td>
<td width="72" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center"><%=rs.getString("idate")%></p>
</td>
</tr>
<% i++;//通過I循環設置每頁的頁數
} %>
<tr>
<td height="3" valign="top" colspan="5" bgcolor="#000000">
</td>
</tr>
<tr>
<td width="418" height="7" valign="bottom" colspan="5">
<p align="center"><br>
【<a href="javascript:window.close()">關閉窗口</a>】
</td>
</tr>
</table>
</center>
</div>
<% } %>
</td>
<center>
</tr>
</center>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -