<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=3
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	action=Trim(Request("action"))
	if action="viptj" then
	id=Trim(Request.QueryString("id"))
		sql="update zp set tj=1 where id in("&id&")"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('该职位推荐成功！');"    
		response.write"this.location.href='company_zp.asp';</script>"
		response.End
	end if
	
	if action="downputong" then
	id=Trim(Request.QueryString("id"))
		sql="update zp set tj=0 where id in("&id&")"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('该职位已成功设置为普通的级别！');"    
		response.write"this.location.href='company_zp.asp';</script>"
		response.End
	end if
	
	if action="del" then
	id=Trim(Request.Form("id"))
		if id="" then
			response.write"<script language=JavaScript>alert('参数为空，请选择您要删除的职位');"    
			response.write"this.location.href='company_zp.asp';</script>"
			response.end
		end if
		sql="delete from zp where id in("&id&")"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('职位删除成功！');"    
		response.write"this.location.href='company_zp.asp';</script>"
		response.End
	end if
	if action="delall" then
		sql="delete from zp"
		conn.Execute sql
		response.write"<script language=JavaScript>alert('职位全部删除成功！');"    
		response.write"this.location.href='company_zp.asp';</script>"
		response.End
	end if
	if action="refresh" then
		id=Trim(Request.Form("id"))
		if id="" then
			response.write"<script language=JavaScript>alert('参数为空，请选择您要更新的职位');"    
			response.write"this.location.href='company_zp.asp';</script>"
			response.end
		end if
		sql="update zp set idate=now() where id in ("&id&")"
		conn.Execute sql
		response.write"<SCRIPT language=JavaScript>alert('职位数据更新成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'company_zp.asp'"&" </script>"
		response.end
	end if
%>
<script language="JavaScript">
function checkBoxStatus() {
    var someBoxChecked=false;
      if (document.all.id!=null) {
       if (document.all.id.length==null) {
         if (document.all.id.checked==true) {
          someBoxChecked=true;
        }
      } else {
        for (var i=0 ;i<document.all.id.length;i++) {
          if (document.all.id[i].checked==true){
            someBoxChecked=true;
            break;
          }
        }
      }
    }
     if (!someBoxChecked) {
      return false;
    } else {
      return true;
    }
  }
function delall() {
  document.selform.action.value='delall';
  document.selform.submit();
}
function del() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.selform.action.value='del';
  document.selform.submit();
}
function refreshall() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.selform.action.value='refresh';
  document.selform.submit();
}
</script>
<script src='Include/Common.js'></script>
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="sortbutton">
<tr>    
<td width="16%" height="23" align="center" valign="middle">企业招聘信息管理
<td width="84%" align="center" valign="middle"><table width="100%" border="0">
<form name="form2" method="get">
<input name="action" type="hidden" value="search" />
        <tr>
          <td width="57%">
		  搜索关键字：
		    <Input maxLength=30 name="Keyword" value="关键字" onMouseOver="if(this.value=='关键字'){this.value=''}" title="关键字">&nbsp;<input name="type" type="radio" value="uname" checked>用户名&nbsp;<input name="type" type="radio" value="iname">公司名称&nbsp;
		  </td>
          <td width="43%"><input class="button" type="submit" value="提交条件"></td>
        </tr>
		</form>
</table>
</tr>
</table>
<table width="100%" style="MARGIN-TOP: 3px" border="0" align="center" cellspacing="1" cellpadding="1"  class="Border">
<tr height="25" align="center" class='title'>
	<td width='6%' nowrap>选择</td>
	<td width="8%" nowrap>用 户 名</td>
	<td width="13%" nowrap>职 位</td>
	<td width="13%" nowrap>公 司</td>
	<td width="8%" nowrap>学历</td>
	<td width="15%" nowrap>刷新日期</td>
	<td width="23%" nowrap>招聘时间</td>
	<td width="8%" nowrap>职位级别</td>
	<td width="8%" nowrap>推荐</td>
</tr>

<form name="selform" method="post" action="company_zp.asp">
<%
	searchtype=""
	
	if Trim(Request.QueryString("action"))="search" then
	
		type1=Trim(Request.QueryString("type"))
		Keyword=Trim(Request.QueryString("Keyword"))
		if Keyword<>"" and Keyword<>"关键字" then
			if type1="uname" then
				searchtype="where uname like '%"&Keyword&"%'"
			else
				searchtype="where cname like '%"&Keyword&"%'"
			end if
		end if
		
	end if

	dim i,intPage,page,pre,last,filepath'定义变量
	set rs_user = server.CreateObject("adodb.recordset")'创建对象
	sql="select * from zp "&searchtype&" order by id desc"'定义SQL语句
	rs_user.PageSize = 14 '这里设定每页显示的记录数
	rs_user.CursorLocation = 3
	rs_user.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs_user.PageCount then
				intpage = rs_user.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs_user.eof then
		rs_user.AbsolutePage = intpage
	end if
	if rs_user.eof then
		response.Write "<tr><td colspan=9><div align=center><font size=3 color=red><b>没有招聘信息，请查询后再重试</b></font></div></td></tr>"
		response.End
	else
	for i=1 to rs_user.PageSize
	if rs_user.EOF or rs_user.BOF then exit for
	if rs_user("jobtype")=0 then
		jobnameid=int(rs_user("jtzw"))
%>
<!--#include file="../inc/jobname.asp"-->
<%
	else
		jobname=rs_user("jobname")
	end if
%>
<tr height="25" align=center class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
	<td><input type="checkbox" name="id" value="<%= rs_user("id") %>"></td>
	<td><%= rs_user("uname") %></td>
	<td><a href="../view_job.asp?id=<%= rs_user("id") %>" target="_blank" title="浏览该职位的详细信息？"><%=left(jobname,7)%><% If len(jobname)>7 Then Response.Write("...")%></a></td>
	<td><a href="../view_company.asp?id=<%= rs_user("uid") %>" target="_blank" title="浏览该公司的详细内容？"><%=left(rs_user("cname"),7)%><% If len(rs_user("cname"))>7 Then Response.Write("...")%></a></td>
	<td><%= rs_user("edus") %></td>
	<td><%=year(rs_user("idate"))%>-<%=month(rs_user("idate"))%>-<%=day(rs_user("idate"))%></td>
	<td><u><%=year(rs_user("addtime"))%>-<%=month(rs_user("addtime"))%>-<%=day(rs_user("addtime"))%></u>&nbsp;至&nbsp;<u><%=year(rs_user("youxiaos"))%>-<%=month(rs_user("youxiaos"))%>-<%=day(rs_user("youxiaos"))%></u></td>
	<td><%if rs_user("tj")=1 then %><font color="#006633">已推荐</font><% else %><font color="#990000">未推荐</font><% end if %></td>
	<td><%if rs_user("tj")=0 then %><a href="?action=viptj&id=<%= rs_user("id") %>"><font color="#FF0000">推荐</font></a><% Else %><a href="?action=downputong&id=<%= rs_user("id") %>"><font color="#FF0000">普通</font></a><% End If %></td>
</tr>
<%
	rs_user.movenext
	next
	End If
%>
<tr>
<td colspan=9>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs_user.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs_user.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>">下页</a> |<%end if%>
<a href="?page=<%=rs_user.PageCount%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs_user.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>&action=<%= Trim(Request.QueryString("action")) %>&Keyword=<%= Trim(Request.QueryString("Keyword")) %>&type=<%= Trim(Request.QueryString("type")) %>"><%=i%></option>
<%
	end if
	next
	rs_user.close
	set rs_user=nothing
	conn.close
	set conn=nothing
%>
</select>页</font></td>
</tr>
</table></td>
</tr>
<tr>
	<td  class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" height='25' colspan=9>
	&nbsp;&nbsp;<input id="chkAll" onClick="CheckAll(this.form)" type="checkbox" value="checkbox"  name="chkAll">全选
	<input class=Button type="submit" name="Submit2" value=" 删 除 " onClick="del()">
	<input class=Button type="button" name="Submit3" value="清空所有职位" onClick="delall()">
	<input class=Button type="submit" name="Submit4" value="刷新职位  " onClick="refreshall()"></td>
</tr>
<input type="hidden" name="action" value="">
</form>
<tr>
	<td  class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" colspan=9 align=right>	</td>
</tr>
</table>

