<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="cinfo.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/ctime1.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	admin_company_name=ReplaceBadChar(Request.Cookies("admin_company_name"))
	set rs=server.createobject("adodb.recordset")
	sql="select * from company where uname='"&admin_company_name&"'"
	rs.open sql,conn,1,1
	jobnum=rs("jobnum")
	rs.close                                                                    
	set rs=nothing
	
	set rs=server.createobject("adodb.recordset")
	sql="select * from zp where uname='"&admin_company_name&"' and zhuangtai=1"
	rs.open sql,conn,1,1
	zpnum1=rs.recordcount
	if zpnum1="" then zpnum1=0
	rs.close                                                                    
	set rs=nothing
	
	action=ReplaceBadChar(Request("action"))
	id=ReplaceBadChar(Trim(Request.Form("j_id")))
	
	if action="delete" then
		sql="delete from zp where id in("&id&")"
		conn.Execute sql
		response.write"<SCRIPT language=JavaScript>alert('职位删除成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'whzp.asp'"&" </script>"
		response.end
	end if
	
	if action="activate" then
		sql="update zp set zhuangtai=1 where id in ("&id&")"
		conn.Execute sql
		response.write"<SCRIPT language=JavaScript>alert('职位激活成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'whzp.asp'"&" </script>"
		response.end
	end if
	
	if action="disable" then
		sql="update zp set zhuangtai=0 where id in ("&id&")"
		conn.Execute sql
		response.write"<SCRIPT language=JavaScript>alert('职位屏蔽成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'whzp.asp'"&" </script>"
		response.end
	end if
	
	if action="refresh" then
		sql="update zp set idate=GetDate() where id in ("&id&")"
		sql1="update zp set youxiaos=GetDate()+120 where id in ("&id&")"
		conn.Execute sql
		conn.Execute sql1
		conn.execute "update company set refresh=GetDate() where id="&Request.Cookies("admin_company_id")&""
		response.write"<SCRIPT language=JavaScript>alert('职位数据更新成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'whzp.asp'"&" </script>"
		response.end
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="images/css.css" type=text/css rel=stylesheet />
<script language="JavaScript">
function checkBoxStatus() {
    var someBoxChecked=false;
      if (document.all.JID_BOX!=null) {
       if (document.all.JID_BOX.length==null) {
         if (document.all.JID_BOX.checked==true) {
          someBoxChecked=true;
        }
      } else {
        for (var i=0 ;i<document.all.JID_BOX.length;i++) {
          if (document.all.JID_BOX[i].checked==true){
            someBoxChecked=true;
            break;
          }
        }
      }
    }
     if (!someBoxChecked) {
      return false;
    } else {
      return true;
    }
  }

function deleteJobs() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.zwgl.action.value='delete';
  if (confirm("是否确定要删除该职位？\n如果删除该职位，简历收件箱中申请该职位的简历以及面试纪录的相应数据，也会同时删除。\n要永久保存求职者简历请先放到企业人才库。")) {
    document.zwgl.submit();
  }
}
function activateJobs() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.zwgl.action.value='activate';
  document.zwgl.submit();
}
function disableJobs() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.zwgl.action.value='disable';
  document.zwgl.submit();
}
function refreshJob() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  document.zwgl.action.value='refresh';
  document.zwgl.submit();
}
function checkAll() {
  if (document.all.JID_BOX!=null) {
      if (document.all.JID_BOX.length==null) {
        document.all.JID_BOX.checked=document.all.CKALL.checked;
      } else {
        for (var i=0;i<document.all.JID_BOX.length;i++) {
          document.all.JID_BOX[i].checked=document.all.CKALL.checked;
        }
      }
  }
}
function cloneJob() {
if (!checkBoxStatus()) {
    alert("请选中至少一个职位！");
    return ;
  }
  var jidString="";
if (document.all.JID_BOX.length==null) {
  if (document.all.JID_BOX.checked==true) {
    jidString=document.all.JID_BOX.value;
  }
} else {
  for (var i=0 ;i<document.all.JID_BOX.length;i++) {
    if (document.all.JID_BOX[i].checked==true){
      if (jidString=="") {
        jidString=document.all.JID_BOX[i].value;
      } else {
        jidString=jidString+","+document.all.JID_BOX[i].value;;
      }
    }
  }
}
  if (jidString=="") {
    alert("请至少选择一份职位来克隆！");
    return ;
  }
  document.clonejobform.jidlist.value=jidString;
  document.clonejobform.submit();
}
</script>
</head>
<body>
<!--#include file="bottom.asp"-->
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" bgcolor="#FFFFFF">
	<TABLE cellSpacing=0 cellPadding=4 width="100%" align=center border=0>
          <TBODY>
            <TR>
              <TD  style="line-height:150% "><div align="left">友情提醒：<br>
                求职者普遍先查看近三天内发布的招聘职位.
                为提高贵公司的招聘效果，建议每天及时更新正在招聘的职位！<br>
                点击“<span class="style4">更新数据</span>”对选中的职位进行更新。</div></TD>
            </TR>
          </TBODY>
    </TABLE>
      <form name="zwgl" action="whzp.asp" method=post>
        <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" style="border:1 solid #cccccc;">
          <tr align="center" valign="middle" bgcolor="#D2E9FB">
            <td height="30" colspan="2" bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB"><span class="style1" style="color: #000000">招聘职位</span></td>
            <td bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB"><span class="style1" style="color: #000000">招聘</span>人数</td>
            <td width="138" bordercolorlight="#999999" bordercolordark="#f3f3f3"><span class="style1" style="color: #000000">状态</span></td>
            <td width="132" bordercolorlight="#999999" bordercolordark="#f3f3f3"><span class="style1" style="color: #000000">级别</span></td>
            <td width="158" bordercolorlight="#999999" bordercolordark="#f3f3f3"><span class="style1" style="color: #000000">发布时间</span></td>
            <td width="151" bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB"><span class="style3">截止日期</span></td>
            <td width="96" bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB">级别控制</td>
            <td width="118" bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB">自动搜索简历</td>
            <td width="87" bordercolorlight="#999999" bordercolordark="#f3f3f3" bgcolor="#D2E9FB"><div align="center" style="color: #000000">编辑</div></td>
          </tr>
<%
	dim i,intPage,page,pre,last,filepath'定义变量
	set rs_whzp = server.CreateObject("adodb.recordset")'创建对象
	sql="select * from zp where uname='"&Request.Cookies("admin_company_name")&"' order by id desc"'定义SQL语句
	rs_whzp.PageSize = 10 '这里设定每页显示的记录数
	rs_whzp.CursorLocation = 3
	rs_whzp.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	zpnum=rs_whzp.recordcount
	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_whzp.PageCount then
				intpage = rs_whzp.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs_whzp.eof then
		rs_whzp.AbsolutePage = intpage
	end if
	for i=1 to rs_whzp.PageSize
	if rs_whzp.EOF or rs_whzp.BOF then exit for
	if rs_whzp("jobtype")=0 then
		jobnameid=int(rs_whzp("jtzw"))
%>
          <!--#include file="../inc/jobname.asp"-->
          <%
	else
		jobname=rs_whzp("jobname")
	end if
%>
          <tr align="center" bgcolor="#F9F9F9" onMouseOver="this.style.backgroundColor='F0F0F0'" onMouseOut ="this.style.backgroundColor='FFFFFF'">
            <td width="21" height="30"><input name="j_id" type="checkbox" id="JID_BOX" value="<%= rs_whzp("id") %>"></td>
            <td width="178"><a href="../view_job.asp?id=<%= rs_whzp("id") %>" target="_blank"><%= left(jobname,5) %>
                  <% If len(jobname)>5 Then Response.Write("...")%>
            </a></td>
            <td width="111"><%= rs_whzp("zpnum") %></td>
            <td><% if rs_whzp("zhuangtai")=1 then Response.Write("正常") else Response.Write("<font color='#ff0000'>屏蔽</font>")%></td>
            <td><% if rs_whzp("tj")=1 then Response.Write("<font color=red>推荐</font>") else Response.Write("未推荐") %></td>
            <td><%= year(rs_whzp("idate")) %>-<%= month(rs_whzp("idate")) %>-<%= day(rs_whzp("idate")) %></td>
            <td><%= year(rs_whzp("youxiaos")) %>-<%= month(rs_whzp("youxiaos")) %>-<%= day(rs_whzp("youxiaos")) %></td>
            <td><a href="tj_job.asp?id=<%= rs_whzp("id") %>"><img src="images/button_19.gif" alt="推荐" width="46" height="20" border="0" style="cursor:hand"></a></td>
            <td><a href="../more_person.asp?keyword=<%= jobname %>" target="_blank" title="搜索符合该职位要求的简历信息"><img src="images/button_01.gif" width="57" height="20" border="0"></a></td>
            <td><img src="images/button_66.gif" width="46" height="20" style="cursor:hand" onClick="window.location.href='publish_edit.asp?id=<%= rs_whzp("id") %>&uid=<%= rs_whzp("uid") %>'"></td>
          </tr>
          <%
	rs_whzp.movenext
	next
%>
        </table>
        <table width="99%" border="0" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs_whzp.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs_whzp.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="?page=<%=rs_whzp.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs_whzp.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>"><%=i%></option>
<%
	end if
	next
	rs_whzp.close
	set rs_whzp=nothing
	conn.close
	set conn=nothing
%>
</select>页</font></td>
</tr>
</table>
        <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
          <tr>
            <td width="82%" align="left">注意：您共发布<font color="990000"><span id=totaljob><%= zpnum %></span></font>个职位；其中有<font color="990000"><span id=openjob><%= zpnum1 %></span></font>个正在招聘中 ; 还能发布 <font color="990000"><%=jobnum-zpnum %></font> 个职位</td>
            <td width="18%" align="right"><input type="checkbox" ID="CKALL" name="checkallbox" onClick="checkAll()" value="checkbox">
        选中所有招聘职位</td>
          </tr>
          <tr>
            <td colspan="2" align="center"><img src="images/button_15.gif" width="46" height="20" style="cursor:hand" onClick="deleteJobs()" alt="删除">　<img src="images/button_17.gif" width="46" height="20" style="cursor:hand" onClick="activateJobs()" alt="激活">　<img src="images/button_18.gif" width="46" height="20" style="cursor:hand" onClick="disableJobs()" alt="屏蔽">　<img src="images/button_31.gif" width="57" height="20" style="cursor:hand" onClick="refreshJob()" alt="更新数据"> </td>
          </tr>
          <TR>
            <TD height=1 colspan="2" bgColor=#000000></TD>
          </TR>
          <tr>
            <td colspan="2" align="left"><span class="p3">　　说明：直接点击职位名称即可看到该职位发布页面，点击收到简历数即可看到该职位的应聘简历，点击编辑修改该职位。</span></td>
          </tr>
        </table>
        <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
          <tr>
            <td align="center"><img src="images/button_15.gif" width="46" height="20"></td>
            <td align="left"> 即对“已经招聘完成”，以后不再需要招聘的职位彻底进行删除。</td>
          </tr>
          <tr>
            <td align="center"><img src="images/button_17.gif" width="46" height="20"></td>
            <td align="left"> 即对“已经屏蔽”的职位重新进行招聘。</td>
          </tr>
          <tr>
            <td align="center"><img src="images/button_18.gif" width="46" height="20"></td>
            <td align="left"> 即对“暂时不需要招聘&quot;的职位进行隐藏，以后如果需要招聘时再激活该职位即可。（建议使用）</td>
          </tr>
          <tr>
            <td align="center"><img src="images/button_19.gif" width="46" height="20"></td>
            <td align="left"> 即对“需要招聘&quot;的职位进行推荐。</td>
          </tr>
          <tr>
            <td align="center"><img src="images/button_31.gif" width="57" height="20"></td>
            <td align="left"> 更新该职位发布时间为当前时间，以保证良好的招聘效果。</td>
          </tr>
        </table>
		<input type="hidden" name="action" value="">
      </form>
    </td>
  </tr>
</table>
</body>
</html>
