<%
set rs_job=server.createobject("adodb.recordset")
sqljob="select DISTINCT Duix from job"
rs_job.open sqljob,conn,1,1
%>
<td height="174" colspan="3">
<form action="search1.asp?mark=southidc" method="post" name="form" target="_blank">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>选择职位</td>
</tr>
<tr>
<td><select name="zhiwei">
<option value="所有职位">所有职位</option>
<%do while not rs_job.eof%>
<option value="<%=rs_job("Duix")%>"><%=rs_job("Duix")%></option>
<%rs_job.movenext
loop
rs_job.close%>
</select></td>
</tr>
<%
set rs_job1=server.createobject("adodb.recordset")
sqljob1="select DISTINCT Did from job"
rs_job1.open sqljob1,conn,1,1
%>
<tr>
<td>选择地区</td>
</tr>
<tr>
<td><select name="diqu">
<option value="所有地区">所有地区</option>
<%do while not rs_job1.eof%>
<option value="<%=rs_job1("Did")%>"><%=rs_job1("Did")%></option>
<%rs_job1.movenext
loop
rs_job1.close%>
</select></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input name="tijiao" type="submit"></td>
<td><input name="congzhi" type="reset"></td>
</tr>
</table>
</form>
</td>
search1.asp的代码:
<!--#include file="Inc/syscode.asp" -->
<%if Request.QueryString("mark")="southidc" then%>
<%
zhiwei=Request.Form("zhiwei")
diqu=Request.Form("diqu")
%>
<%
if zhiwei="所有职位" and diqu="所有地区" then
sql="select * from Job"
elseif zhiwei<>"所有职位"and diqu="所有地区" then
sql="select * from Job where Duix='"&zhiwei&"'"
elseif zhiwei="所有职位"and diqu<>"所有地区" then
sql="select * from Job where Did='"&diqu&"'"
elseif zhiwei<>"所有职位"and diqu<>"所有地区" then
sql="select * form Job where Duix='"&zhiwei&"' and Did='"&diqu&"'"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
end if
%>
<table width="750" border="0">
<tr>
<td width="20%"> </td>
<td width="80%"> </td>
</tr>
<tr>
<td width="30%"></td>
<td width="70%">
<%i=1
do while not rs.eof%>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>职位<%=i%></tr>
<tr>
<td width="20%" align="center">招聘对象</td>
<td width="80%"><%=rs("Duix")%></td>
</tr>
<tr>
<td align="center">招聘人数</td>
<td><%=rs("Rens")%></td>
</tr>
<tr>
<td align="center">工作地点</td>
<td><%=rs("Did")%></td>
</tr>
<tr>
<td align="center">工资待遇</td>
<td><%=rs("Daiy")%></td>
</tr>
<tr>
<td align="center"> </td>
<td><%=rs("Did")%></td>
</tr>
<tr>
<td align="center">有效期限</td>
<td><%=rs("Qix")%></td>
</tr>
<tr>
<td align="center">招聘要求</td>
<td><%=rs("Yaoq")%></td>
</tr>
</table>
<%i=i+1
rs.movenext
loop%>
</td>
</tr>
<tr>
<td width="30%"> </td>
<td width="70%"> </td>
</tr>
</table>