<%@ Language=VBScript%>

<%
Response.Buffer=false
Response.Expires=0

%>
<!-- #include file="../dsn.asp" -->

<%
pageno=Request.QueryString("pageno")
flag=Request.QueryString("flag")
keyno=Request.QueryString("keyno")
orderby=Request.QueryString("orderby")
mode=Request.QueryString ("mode")

if pageno="" then pageno=1
if flag="" then flag="1"

htmltitle="招聘人员资料"
htmlname="enguser_admin.asp?flag="+flag+"&orderby="+orderby
htmlname2="enguser_admin.asp?flag="+flag
addhtml="enguser_register.asp?flag="+flag+"&orderby="+orderby

set cn=server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
if Request.ServerVariables("REQUEST_METHOD")="POST" and mode<>"888" then
		if not isempty(request("sel")) then
     		idlist=request("sel")
     		if instr(idlist,",")>0 then
				dim idarr
				idArr=split(idlist)
				for i = 0 to ubound(idarr)
	       			delid=clng(idarr(i))
	       			call setupdate(delid,mode)
				next
			else
				delid=clng(idlist)
				call setupdate(delid,mode)
			end if	
		end if
		delid=0
		if err<>1 then
				Response.Redirect htmlname
		end if		
end if
  sub setupdate(keyno,mm)
    if mm="999" then
		sqltext="delete from engage_user where keyno="&keyno
		cn.Execute sqltext
	end if	
  end sub  
select case orderby 
	case "1"
		ordertxt="order by bb.keyno"
	case else	
		ordertxt="order by aa.keyno desc"
end select

%>
<html>
<head>
<title><%=htmltitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;line-height:130%}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:12px 宋体;color:ffffff} 
.t3 {font:12px 宋体;color:336699} 
.t4 {font:12px 宋体;color:ff0000} 
.t5 {font:12px 宋体;color:ff6600}

.bt1 {font:14px 宋体;color=000000} 
.bt2 {font:12px 宋体;color:ffffff} 
.bt3 {font:14px 宋体;color:336699} 
.bt4 {font:14px 宋体;color:ff0000} 
.bt5 {font:14px 宋体;color:0000ff}
.bt10 {font:14px 宋体;color:0000ff}

.td1 {font-size:12px;background-color:#3388bb;color:#ffffff}
.td2 {font-size:12px;background-color:#ffffff;color:#000000;}

A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}

A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#ff6600;}

A.r2:link {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:visited {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
-->
</style>
</head>
<body topmargin=5>
<table width="100%" align=center>
	<tr>
	<td valign="top" align="left" width="100%">
		<table width="100%" height="20" border="0">
			<tr>
			<td style="font-size:12px;"></td>
			<td><font class=t5>当前位置：网站综合管理→  应聘人员列表</font></td>
			<td align="right">
			</td>
			</tr>
		</table>
		<table width="100%" height="20" border="0">
		<form action="<%=htmlname%>" method=post name="listform">
			<tr>
		<%
		sqltext="select aa.keyno,aa.username,aa.phone,aa.email,bb.title from engage_user aa,engage bb where aa.engageno=bb.keyno "+ordertxt
		'Response.Write sqltext
		rs.Open sqltext,cn,1,1

		listcs=30
		rs.PageSize=listcs
		if pageno="" then 
			pageno=1
		else
			pageno=cint(pageno)	
		end if	
		if rs.PageCount>0 then rs.AbsolutePage=pageno
	%>
		<td class=t1 align="left" width=200>
			<a href="Javascript:window.location.reload()">[刷新列表]</a>
			<a href="javascript:delrows()">[删除]</a>
			</td>
		<td  align="right">
		<%if rs.PageCount>1 then%>
			[第<b><%=pageno%></b>页, 共<b><%=rs.PageCount%></b>页<b><%=rs.RecordCount%></b>条记录]		              
			<%if pageno>1 then%>
				<a class=r href="<%=htmlname%>&pageno=1">首页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno-1%>">上页</a>              
			<%end if              
			if pageno<rs.PageCount then%>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno+1%>">下页</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=rs.PageCount%>">末页</a>              
			<%end if%>              
		<%end if              
		%>              
		</td>
		</tr>
		</table>
			<table width="100%" border="0" cellspacing="1" cellpadding="1" style="font-size:14.5px;line-height:100%">
				<tr bgcolor="666699" style="color:#ffffff" align="center">
				<td class=bt2></td><td class=bt2>姓名</td>
				<td class=bt2>联系电话</td><td class=bt2>Email</td><td class=bt2><a class=r2 href="<%=htmlname2%>&orderby=1">应聘岗位</a></td></tr>
		<%
		i=0
		do while not rs.EOF and i<listcs 
			if (i mod 2)=1 then
				Response.Write("<tr bgcolor=fefefe>")
			else
				Response.Write("<tr bgcolor=efefef>")
			end if	
		%>
			<td width="20" align="center"><input type="checkbox" name="sel" value="<%=(rs("keyno"))%>"></td>
			<td align=center width=50><a href="<%=addhtml%>&keyno=<%=rs("keyno")%>"><%=trim(rs("username"))%></td>
			<td width="200" align="center"><%=trim(rs("phone"))%></td>
			<td width="115" align="center"><%=trim(rs("email"))%></td>
			<td width="200" align="center"><%=trim(rs("title"))%></td>
			</tr>
		<%	
			i=i+1
			rs.MoveNext
		loop
		%>
			</table>
		</td></tr>
		<table width="100%"> 
		<tr><td bgcolor="336699">

		<%if rs.PageCount>1 then%>
			<tr><td><center>
			<%if pageno>1 then%>
				<a class=r href="<%=htmlname%>&pageno=1">[首页]</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno-1%>">[上页]</a>              
			<%end if              
			if pageno<rs.PageCount then%>              
				<a class=r href="<%=htmlname%>&pageno=<%=pageno+1%>">[下页]</a>              
				<a class=r href="<%=htmlname%>&pageno=<%=rs.PageCount%>">[末页]</a>              
			<%end if%>              
				[第<b><%=pageno%></b>页, 共<b><%=rs.PageCount%></b>页<b><%=rs.RecordCount%></b>条记录]		              
			</center></td></tr>              
		<%end if              
		%>              
		</table>
		</form>
</td></tr><table>
</body>
</html>

<script language="Javascript">

    function delrows()
    {
        if (confirm('您确认要删除你所选中的项目吗？')==true)
        {        
        document.listform.action="<%=htmlname%>&mode=999";
        document.listform.submit();
        }
    }

</script>

