<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Public/Person_Cookies.asp" -->
<!--#include file="../Include/Class_Main.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 Rs,Cmd,Tmp,Action
Dim Perid,UserName,UserType,RealName

Action = Request.QueryString("action")
If Action = "del" Then 
 Call Del_Submit() '跳转到删除函数
Elseif Action = "email" Then
 Call Email_Submit()
End if

'//获取个人用户的登陆标记
If IsArray(Session("Person")) Then
 Perid = Session("Person")(2)
 UserName = Session("Person")(0)
Else
 Session.Abandon() 
 Response.write "<script>alert('-登录后才能进行该操作！-');location.href='../Public/MemberLogin.asp';</script>"
End if

'//调用存储过程
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Per_Account"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Perid",200,1,30)
Cmd.Parameters("@Perid") = Perid
Set Rs = Cmd.Execute

If Rs.Eof Then
 CloseRs
 Set Cmd = Nothing
 CloseDB
 Response.write "没有找到会员资料！"
 Response.End()
End if
Tmp = Rs.GetRows() '//将数据填充到数组
'//0姓名,1会员类型
'//如：Tmp(0,0)表示 用户的姓名
Rs.Close
Set Cmd = Nothing
'//功能代码
RealName = Tmp(0,0)
UserType = Cls_Usertype(Tmp(1,0))
RealName = Tmp(0,0)

 %>
<!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" src="../js/Person_education.js"></script>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>
      <!--#include file="../c_Header/Person_Resume.asp" -->
    </td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="4"></td>
        </tr></table>
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="175" valign="top"> 
            <!--#include file="../Lefter/Person_Search.asp" -->
          </td>
          <td width="5">&nbsp;</td>
          <td valign="top">
<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 height="2"></td>
                          </tr>
                        </table>
                        <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                          <tr bgcolor="f5f5f5"> 
                            <td height="24">&nbsp;搜索器名称</td>
                            <td width="25%" height="24" align="center">操 作</td>
                          </tr>
<% 
SQL = "Select Ncid,Searcher_Name,EmailFlag From [pH_Person_Searcher] Where Perid='"&Perid&"'"
Set Rs = Conn.Execute(SQL)
If Rs.Eof Then
 Response.write "<tr bgcolor=""f9f9f9""><td height=""25"">&nbsp;暂时没有创建搜索器</td><td height=""25"" align=""center"">&nbsp;</td></tr>"
Else
 While Not Rs.Eof
  Ncid           = Rs(0)
  Searcher_Name  = Rs(1)
  EmailFlag      = Rs(2)

  If EmailFlag = 1 Then 
   Flag_Str = "(已订阅招聘职位)"
   Flag_Url = "<a href=?action=email&param="&ncid&"&flag=0><u>退订职位</u></a>"
  Else
   Flag_Str = "(未订阅招聘职位)"
   Flag_Url = "<a href=?action=email&param="&ncid&"&flag=1><u>订阅职位</u></a>"
  End if
 %>
                          <tr bgcolor="f9f9f9"> 
                            <td height="25">&nbsp;<a href="Per_Searcher_Base.asp?Param=<%= Ncid %>" target="_blank"><u><%= Searcher_Name %></u></a> <font color="#666666"><%= Flag_Str %></font></td>
                            <td height="25" align="center">
							<a href="?action=del&param=<%= Ncid %>" onClick="return confirm('是否删除该记录');"><u>删除</u></a> 
							<a href="Per_Searcher_Edit.asp?Param=<%= Ncid %>"><u>编辑</u></a>
							<%= Flag_Url %>
							</td>
                          </tr>
<% 
  Rs.Movenext
 Wend
End if 
Rs.Close 
 %>
                        </table> 
                        <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"><font color="#000000"><strong>&nbsp;</strong></font><strong>说明</strong><br>
                              &nbsp;■点击搜索器名称可以按您的搜索条件来查询符合条件的职位信息<br>
                              &nbsp;■编辑：查看/修改搜索器中的搜索条件<br>
                              &nbsp;■删除：将搜索器删除</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="Submit" value=" 新增职位搜索器 " style="height:30px;" onClick="location.href='Per_Searcher_Add.asp';"> 
                  </td>
                </tr>
             
            </table></td>
        </tr>
      </table>

<!--#include file="../c_Include/Footer.asp" -->
	  </td>
  </tr>
</table>

</body>
</html>
<% 

Sub Del_Submit() '删除搜索器的记录
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2)
 Ncid                = Replace_Text(Request("param"))
 Check_Id(Ncid)
 
 SQL = "Delete From [pH_Person_Searcher] Where Perid='"&Perid&"' And Ncid="&Cstr(Ncid)
 Conn.Execute(SQL)

 CloseDB
 Response.redirect "Per_Searcher.asp"

End Sub

Sub Email_Submit() 
 Call Check_url()    '防止外部站点提交数据
 '//提交数据
 Perid                = Session("Person")(2)
 Ncid                 = Replace_Text(Request("param"))
 Flag				  = Replace_Text(Request("flag")) 
 Check_Id(Ncid)
 
 SQL = "Update [pH_Person_Searcher] Set EmailFlag="&Flag&" Where Perid='"&Perid&"' And Ncid="&Cstr(Ncid)
 Conn.Execute(SQL)

 CloseDB
 Response.redirect "Per_Searcher.asp"

End Sub

'//关闭数据库连接
CloseDB
 %>
