<!--#include file="../Conn.asp" -->
<!--#include file="../Comm/Site_Class.asp" -->
<%
Dim strMenu,PageTitle
strMenu = ""
PagePath = "../"

Set Qsite = New Site_Class

Qsite.SiteConfig()
Qsite.GotoErrPage()

PageTitle = Qsite.SiteName & " - 企业会员管理中心"

Qsite.Nav_Company()
%>
<!--#include file="Check_Login.asp" -->
<%
Dim Rs,act,RecruitId
Dim jRs
Set Rs = server.CreateObject("ADODB.recordset")

act = Request.QueryString("action")
RecruitId = Request.QueryString("RecruitId")

If RecruitId = "" Or IsNull(RecruitId) Or Not IsNumeric(RecruitId) Then RecruitId = 0

If act = "sxjob" Then
	Set jRs = Conn.Execute("select * from RecruitTbl where RecruitId = "& RecruitId)
	If jRs("ValidityDate") < Qsite.FormatDate(Date()) Then
		Conn.Execute("update RecruitTbl set AddDate = '"& Qsite.FormatDate(Now()) &"' , EditDate = '"& Qsite.FormatDate(Now()) &"' , ValidityDate = '"& Qsite.FormatDate(Date() + 90) &"' , IsPause = '0' where RecruitId = "& RecruitId &" and ComId = "& Session("ComId"))
	Else
		Conn.Execute("update RecruitTbl set EditDate = '"& Qsite.FormatDate(Now()) &"' , IsPause = '0' where RecruitId = "& RecruitId &" and ComId = "& Session("ComId"))
	End If
	Set jRs = Nothing
	
	Conn.Execute("update CompanyTbl set EditDate = '"& Qsite.FormatDate(Now()) &"' where ComId = "& Session("ComId"))
	
	Response.Redirect("Job_Manage.asp")
	Response.End()
End If

If act = "pausejob" Then

	Conn.Execute("update RecruitTbl set EditDate = '"& Qsite.FormatDate(Now()) &"' , IsPause = '1' where RecruitId = "& RecruitId)
	
	Conn.Execute("update CompanyTbl set EditDate = '"& Qsite.FormatDate(Now()) &"' where ComId = "& Session("ComId"))
	
	Response.Redirect("Job_Manage.asp")
	Response.End()
End If
%>
<script language="javascript">
function JobDel(RecruitId)
{
	var question = confirm("你确定要删除此条记录吗？");
	if (question !="0")
	{
		window.showModalDialog("Job_Del.asp?RecruitId=" + RecruitId,"RecruitDel","");
		location.reload();
	}
}
</script>
 <table width="974" height="413" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="181" valign="top"> 
<!--#include file="Left_Menu.asp" -->
         </td>
        <td width="793" align="left" valign="top">
 <table width="768" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="26" background="../images/Member_Center_r7_c8.jpg"><table width="768" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="60">&nbsp;</td>
                    <td width="708"><span style="font-size:14px;color:#FF7706"><b>招聘职位管理</b></span><span style="font-size:14px;color:#333333"> 
                      <strong>Admin Jobs</strong></span></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td height="136" align="left" valign="top" background="../images/Member_Center_r10_c8.jpg" style="padding-top:5px;padding-left:10px;padding-right:10px;padding-bottom:5px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td width="100%" height="23"><img src="../images/ico_2.gif" width="15" height="12" align="absmiddle" />友情提示：本系统保留过期职位三个月，三月后，系统将自动删除过期职位！</td>
                  </tr>
                </table>
                <table width="100%" height="7" border="0" cellpadding="0" cellspacing="0">
                  <tr height="1">
                    <td background="../images/ico_point.gif"></td>
                  </tr>
				  <tr height="6">
                    <td></td>
                  </tr>
                </table>
							<table width="95%" align=center border="0" cellpadding="5" cellspacing="3">
										<tr>
											<td width="23%" height="30" class="td_line_col_FFFFFF"><strong>职位名称(浏览次数)</strong></td>
											<td width="13%" height="30" align="center" class="td_line_col_FFFFFF"><strong>招聘人数</strong></td>
											<td width="11%" height="30" align="center" class="td_line_col_FFFFFF"><strong>发布时间</strong></td>
											<td width="13%" height="30" align="center" class="td_line_col_FFFFFF"><strong>更新时间</strong></td>
											<td width="10%" height="30" align="center" class="td_line_col_FFFFFF"><strong>状态</strong></td>
											<td width="30%" height="30" align="center" class="td_line_col_FFFFFF"><strong>操作</strong></td>
										</tr>
<%
Rs.Open "select * from RecruitTbl where ComId = "& Session("ComId") &" order by IsPause asc , EditDate desc" , Conn , 1 , 1
Do While Not Rs.Eof
%>
										<tr>
											<td height="30" class="td_line_col_FFFFFF"><%=Rs("JobName")%> (<%=Rs("ViewQuantity")%>)</td>
											<td height="30" align="center" class="td_line_col_FFFFFF">
											<%
											If Cint(Rs("Quantity")) = 0 Then
												Response.Write("若干人")
											Else
												Response.Write(Rs("Quantity") & " 人")
											End If
											%>											</td>
											<td height="30" align="center" class="td_line_col_FFFFFF"><%=FormatDateTime(Rs("AddDate") , 2)%></td>
											<td height="30" align="center" class="td_line_col_FFFFFF"><%=FormatDateTime(Rs("EditDate") , 2)%></td>
											<td height="30" align="center" class="td_line_col_FFFFFF"><%
											If Rs("ValidityDate") < Qsite.FormatDate(Date()) Then
												Response.Write("<font color=""#FF0000"">已过期</font>")
											ElseIf Rs("IsPause") = "1" Then
												Response.Write("<font color=""#FF0000"">停止招聘</font>")
											Else
												Response.Write("正在招聘")
											End If
											%></td>
											<td height="30" align="center" class="td_line_col_FFFFFF"><a href="Job_Manage.asp?action=sxjob&RecruitId=<%=Rs("RecruitId")%>">更新</a> | 
											<%
											If Rs("ValidityDate") < Qsite.FormatDate(Date()) Then
												Response.Write("<a href=""Job_Manage.asp?action=sxjob&RecruitId="& Rs("RecruitId") &""">重新招聘</a>")
											ElseIf Rs("IsPause") = "1" Then
												Response.Write("<a href=""Job_Manage.asp?action=sxjob&RecruitId="& Rs("RecruitId") &""">重新招聘</a>")
											Else
												Response.Write("<a href=""Job_Manage.asp?action=pausejob&RecruitId="& Rs("RecruitId") &""">暂停招聘</a>")
											End If
											%> | <a href="Job_Edit.asp?RecruitId=<%=Rs("RecruitId")%>">修改</a> | <a href="#" onclick="JobDel('<%=Rs("RecruitId")%>');return false;">删除</a></td>
										</tr>
<%
Rs.MoveNext
Loop
Rs.Close
%>
						</table> 
 </td>
            </tr>
            <tr height="14">
              <td height="14" background="../images/Member_Center_r18_c8.jpg"></td>
            </tr>
          </table></td>
      </tr>
    </table>
 
<table width="974" height="8" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr height="8">
        <td height="8"></td>
      </tr>
    </table>
<%
Qsite.Bottom()
%>
%>