<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../c_Public/Intro_Cookies.asp" -->
<% 
'地区分站参数
Dim c_City,c_Name
If Session("c_City") = "" Then 
 Response.Redirect "../Index.asp"
 Response.End()
End if
c_City = Session("c_City")
c_Name = Session("c_Name")

Dim Corid,Username,Tmp,Temp(3)
Dim Cmd,Rs,Action

Action = Request.QueryString("action")
If Action = "del" Then Call Del_Submit()

'//获取会员登陆的标记
If Not IsArray(Session("Intro")) Then 
 Response.write "<script>alert('-登录后才能进行该操作！-');location.href='../Public/MemberLogin.asp';</script>"
Else
 Username  = Session("Intro")(0)
 Corid     = Session("Intro")(2)
End if

'//调用存储过程
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Inr_Account"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Corid",200,1,30)
Cmd.Parameters("@Corid") = Corid
Set Rs = Cmd.Execute
If Rs.Eof Then
 CloseRs
 Set Cmd = Nothing
 CloseDB
 Response.write "没有找到会员资料！"
 Response.End()
End if
Tmp = Rs.GetRows() '//将数据填充到数组
CloseRs
Set Cmd = Nothing
'//功能代码
CorpName              = Tmp(0,0)

'判断会员是否通过审核
Flag		   = Tmp(1,0)
If Flag = False Then 
 Response.redirect "../Public/Error.asp?Param=2003"
 Response.End()
End if
'//判断该会员能否发布信息
Set Rs = Conn.Execute("Select p_Job From [pH_Intro_Purview] Where Ncid=1")
p_Job = Rs(0)
Rs.Close
If Session("Nc_Vip") <> 1 And p_Job = False Then 
 Response.redirect "../Public/Error.asp?param=2001"
End if

'//查询记录
Set Rs = Server.Createobject("ADODB.Recordset")
SQL = "Select Ncid,Com_Name,JobName,Valids,Flag,AddDate From [pH_Intro_Job] Where Corid='"&Corid&"' Order by AddDate Desc"
Rs.open SQL,Conn,1,1

Set Comm    = Nothing '//关闭Command对象

Rs.Pagesize = 15
Psize       = Rs.PageSize
PCount      = Rs.PageCount
RCount      = Rs.RecordCount

PageNo = Cint(Request.QueryString("PageNo"))
If PageNo < 1 Then
 PageNo = 1
Elseif PageNo > PCount Then
 PageNo = PCount
End if
TheRecord = (PageNo-1)*Psize '//计算记录编号的基数
If Not Rs.Eof Then Rs.AbsolutePage = PageNo

 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Style.css" type=text/css rel=stylesheet>
<title><%= Cls_WebName&" | "&c_Name&"站" %> -- 中介用户管理中心 -- 职位管理</title>
</head>
<script language="JavaScript">
function SelectAllItem(item)
{
    if( typeof(item.length) == "undefined" )
    {
        item.checked = !item.checked
    }
    else
    {
        for(i=0;i<item.length;i++)
        {
            item[i].checked=!item[i].checked
        }
    }
}

function theForm_Submit(id)
{
		
		if (id=="deljob")
		{
		  if(confirm('确认彻底删除选定的记录'))
		  {
		    form.target='rslt';
			form.action="Cor_Option.asp?param=deljob";
			openwin();
			form.submit();	   
		   }
		}
		if (id=="flagjob")
		{
		    form.target='rslt';
			form.action="Cor_Option.asp?param=flagjob";
			openwin();
			form.submit();	   
		}
		if (id=="noflagjob")
		{
		  if(confirm('确认屏蔽指定的记录！'))
		  {
		    form.target='rslt';
			form.action="Cor_Option.asp?param=noflagjob";
			openwin();
			form.submit();	   
		   }
		}
		
		
}
function openwin()
  {
    disp=window.open("","rslt","width=500,height=320,resizable=yes");
	disp.focus();
  }
</script>

<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../c_Header/Intro_User.asp" -->
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td height="4"></td>
        </tr>
        <tr> 
          <td height="1" bgcolor="#eeeeee"></td>
        </tr>
      </table>
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td width="175" valign="top"><!--#include file="../Lefter/Intro_All.asp" --></td>
          <td width="5">&nbsp;</td>
          <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="25"><img src="../Images/icon.gif" width="11" height="11" align="absmiddle"> 
                  尊敬的<%= Cls_WebName %>用户：<font color=#ff0000><%= CorpName %></font>，欢迎您进入中介管理中心</td>
              </tr>
            </table>
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <Form action="" method="post" name="form">
                <tr> 
                  <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="eeeeee">
                      <tr> 
                        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr> 
                              <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                                  <tr> 
                                    <td bgcolor="#FFFFFF"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr> 
                                          <td height="2"></td>
                                        </tr>
                                      </table>
                                      <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                                        <tr> 
                                          <td height="25" bgcolor="f5f5f5"><b><font color="#000000">&nbsp;招聘职位管理</font></b></td>
                                        </tr>
                                      </table>
                                      <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr> 
                                          <td><%= Cls_Page("Cor_Job_Manage.asp",PageNo,PCount,RCount) %></td>
                                        </tr>
                                      </table>
                                      <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="dddddd">
                                        <tr align="center" bgcolor="f5f5f5"> 
                                          <td width="6%" height="25">选择</td>
                                          <td width="28%" height="25" bgcolor="f5f5f5">职位名称</td>
                                          <td width="28%" bgcolor="f5f5f5">单位名称</td>
                                          <td width="7%" height="25" bgcolor="f5f5f5">状态</td>
                                          <td width="7%" height="25" bgcolor="f5f5f5">有效</td>
                                          <td width="15%" bgcolor="f5f5f5">发布时间</td>
                                          <td height="25" bgcolor="f5f5f5">操作</td>
                                        </tr>
                                        <% 
For i = 1 to Psize
 If Rs.Eof Then Exit For
 Ncid        = Rs("Ncid")
 Com_Name	 = Rs("Com_Name")
 JobName	 = Rs("JobName")
 Valids		 = Rs("Valids")
 Flag		 = Rs("Flag")
 AddDate	 = FormatDateTime(Rs("AddDate"),2)
 Valids_Date = DateAdd("d",Valids,AddDate)
 '获取状态
 Flag_Str = ""
 If Flag = True Then
  Flag_Str = "<font color=#009900>√</font>"
 Else
  Flag_Str = "<font color=#ff0000>×</font>"
 End if
 '获取职位有效性
 Valids_Str = ""
 If Valids = 0 Then
  Valids_Str = "<font color=#009900>√</font>"
 Elseif DateDiff("d",Valids_Date,Date()) <= 0 Then
  Valids_Str = "<font color=#009900>√</font>"
 Else
  Valids_Str = "<font color=#FFCC00>!</font>"
 End if
 %>
                                        <tr align="center"> 
                                          <td height="25" bgcolor="#FFFFFF"><INPUT type=checkbox value=<%= Ncid %> name=perid></td>
                                          <td height="25" align="left" bgcolor="#FFFFFF"><a href="Info/Job.asp?Corid=<%= Corid %>&Param=<%= Ncid %>" target="_blank"><%= Jobname %></a>
                                          </td>
                                          <td height="25" align="left" valign="baseline" bgcolor="#FFFFFF"><%= Com_Name %> 
                                          </td>
                                          <td height="25" align="center" bgcolor="#FFFFFF"><%= Flag_Str %></td>
                                          <td height="25" align="center" bgcolor="#FFFFFF"><%= Valids_Str %></td>
                                          <td height="25" align="center" bgcolor="#FFFFFF"><%= AddDate %></td>
                                          <td height="25" bgcolor="#FFFFFF"> <a href="Cor_Job_Edit.asp?Param=<%= Ncid %>">编辑</a> 
                                          </td>
                                        </tr>
                                        <% 
 Rs.Movenext
Next
Rs.Close
 %>
                                      </table>
                                      <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr> 
                                          <td align="right"> <INPUT onclick=SelectAllItem(this.form.perid) type=checkbox value=all name=chk_all>
                                            选中所有记录 </td>
                                        </tr>
                                      </table>
                                      <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr> 
                                          <td height="2"></td>
                                        </tr>
                                      </table></td>
                                  </tr>
                                </table></td>
                            </tr>
                            <tr> 
                              <td height="30" align="right"> 
                             <input name="delete" type="button" id="delete" onClick="javascript:theForm_Submit('deljob')" value="删除记录">
							  <input name="delete2" type="button" id="delete2" onClick="javascript:theForm_Submit('noflagjob')" value="屏蔽职位">
							   <input name="delete3" type="button" id="delete3" onClick="javascript:theForm_Submit('flagjob')" value="开通职位">
                              </td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </Form>
            </table>
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td>说明：</td>
              </tr>
              <tr> 
                <td>职位的状态<font color="#009900">√</font> 表示该职位处于打开状态 ;<font color="#FF0000">×</font> 
                  表示职位处于关闭状态 ;</td>
              </tr>
              <tr> 
                <td>职位的有效性<font color="#009900">√</font> 表示该职位有效期内 ;<strong><font color="#FFCC00">!</font></strong> 
                  表示该职位已经过期 ;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table> 
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="1" bgcolor="#eeeeee"></td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../c_Include/Footer.asp" -->
    </td>
  </tr>
</table>
</body>
</html>
<% 
Sub Del_Submit()
 Corid             = Session("Intro")(2)
 Param			   = Replace_Text(Request.QueryString("Param"))
 Conn.Execute("Delete From [pH_Job_Base] Where Usertype='Cor' And Comid='"&Corid&"' And PublishName='"&Param&"'")
 Response.Redirect("Cor_Company.asp")
End Sub

'//关闭数据库连接
CloseDB

 %>
