<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../Public/Intro_Cookies.asp" -->
<% 
Dim Corid,Username,Tmp,Temp(3)
Dim Cmd,Rs,Action
Param  = Replace_Text(Request.QueryString("Param"))
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)


'//企业的职位列表
Set Rs = Server.Createobject("ADODB.Recordset")
'SQL = "Select DistInct PublishName From [pH_Job_Base] Where UserType='Cor' And Comid='"&Corid&"'"
SQL = "Select Jobid,JobName,JobFlag,ViewClicks,SendClicks,End_Date,LastUpdate_Time From [pH_Job_Base] Where Comid='"&Corid&"' And PublishName='"&Param&"' Order By LastUpdate_Time Desc,Jobid Desc"
Rs.open SQL,Conn,1,1

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

Rs.Pagesize = 10
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 %> -- 中介用户管理中心</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==2001)
        {
		  	form.target='_self';
			form.action="Cor_JobOption.asp?action=refreshs&publishname=<%= Param %>";
			form.submit();
		}
		
		if (id==2002)
		{
		    form.target='_self';
			form.action="Cor_JobOption.asp?action=opens&publishname=<%= Param %>";
			form.submit();
		}

		if (id==2003)
		{
		    form.target='_self';
			form.action="Cor_JobOption.asp?action=closes&publishname=<%= Param %>";
			form.submit();
		}
		
		if (id==2004)
		{
		  if(confirm('确认删除？'))
		  {
		    form.target='_self';
			form.action="Cor_JobOption.asp?action=dels&publishname=<%= Param %>";
			form.submit();	   
		   }

		}
		
	    if (id==2005)
        {
		  	form.target='_self';
			form.action="Cor_JobOption.asp?action=publishs&publishname=<%= Param %>";
			form.submit();
		}
}

</script>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../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 name="form" method="post">
                <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 color=#ff0000><%= Param %></font>的相关职位</font></b></td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
								  <td><%= Cls_Page2("Cor_Company_Job.asp?Param="&Param,PageNo,PCount,RCount) %></td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="eeeeee">
                            <tr align="center" bgcolor="f5f5f5"> 
                              <td width="8%" height="23">编号</td>
                              <td width="25%" height="23" bgcolor="f5f5f5">招聘职位</td>
                              <td width="10%" height="23" bgcolor="f5f5f5">状 态</td>
                              <td width="12%" height="23" bgcolor="f5f5f5">浏览/应聘</td>
                              <td width="24%" height="23" bgcolor="f5f5f5">招聘起止日期</td>
                              <td height="23">单项操作</td>
                              <td width="7%" height="23">选择</td>
                            </tr>
                            <% 
For i = 1 to Psize
 If Rs.Eof Then Exit For
 Jobid               = Rs("Jobid")
 JobName             = Rs("JobName")
 JobFlag             = Cls_JobFlag(Rs("JobFlag"))
 ViewClicks          = Rs("ViewClicks")
 SendClicks          = Rs("SendClicks")
 LastUpdate_Time     = Rs("LastUpdate_Time")
 BeginAndEndDate     = FormatDateTime(LastUpdate_Time,2)&"～"&Rs("End_Date")				  
%>
                            <tr align="center"> 
                              <td height="23" bgcolor="#FFFFFF"><%= TheRecord+i %></td>
                              <td height="23" align="left" bgcolor="#FFFFFF"><a href="Info/ViewJob_Info.asp?Corid=<%= Corid %>&Param=<%= Jobid %>" target="_blank"><%= JobName %></a></td>
                              <td height="23" bgcolor="#FFFFFF"><%= JobFlag %></td>
                              <td height="23" bgcolor="#FFFFFF"><%= ViewClicks&"/"&SendClicks %></td>
                              <td height="23" bgcolor="#FFFFFF"><%= BeginAndEndDate %></td>
                              <td height="23" bgcolor="#FFFFFF"><a href="Cor_JobEdit.asp?Param=<%= Jobid %>">编辑</a></td>
                              <td height="23" bgcolor="#FFFFFF"><INPUT type=checkbox value=<%= JobId %> name=param></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.param) 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="40" align="center"> <input type="button" name="refresh" value="刷新职位" onClick="javascript:theForm_Submit(2001)"> 
                    <input type="button" name="publish" value="重新发布" onClick="javascript:theForm_Submit(2005)"> 
                    <input type="button" name="open" value="激活职位" onClick="javascript:theForm_Submit(2002)"> 
                    <input type="button" name="close" value="屏蔽职位" onClick="javascript:theForm_Submit(2003)"> 
                    <input type="button" name="delete" value="删除职位" onClick="javascript:theForm_Submit(2004)"> 
                  </td>
                </tr>
              </form>
            </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="../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='Inr' And Comid='"&Corid&"' And PublishName='"&Param&"'")
 Response.Redirect("Cor_Company.asp")
End Sub

'//关闭数据库连接
CloseDB

 %>
