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

Set Qsite = New Site_Class

Qsite.SiteConfig_Master()
%>
<!--#include file="../Check_Login.asp" -->
<%
Qsite.Check_AdminFlag(arrAdminFlag(1 , 3))

If Request.Form <> "" Then
	Response.Redirect("Person_List.asp?PersonName="& Qsite.chgStr(Trim(Request.Form("PersonName"))))
	Response.End()
End If

Dim CurrentPage,FileName
Dim PersonName,ViewType
Dim PerId
Dim Act,IsHidden,IsLock,IsGj,IsTj,IsYear,IsSh
Dim TodayDate

TodayDate = Qsite.FormatDate(Date())

PersonName = Qsite.chgStr(Trim(Request.QueryString("PersonName")))
ViewType = Qsite.chgStr(Trim(Request.QueryString("ViewType")))

Set Rs = server.CreateObject("ADODB.recordset")

If PersonName <> "" Then
	Sql = "select * from PersonTbl where UserName like '%"& PersonName &"%' or RealName like '%"& PersonName &"%' or Email like '%"& PersonName &"%' order by EditDate desc"
Else
	If ViewType = "NoLock" Then
		Sql = "select * from PersonTbl where IsLock = '0' order by EditDate desc"
	ElseIf ViewType = "IsLock" Then
		Sql = "select * from PersonTbl where IsLock = '1' order by EditDate desc"
	ElseIf ViewType = "IsHidden" Then
		Sql = "select * from PersonTbl where IsHidden = '1' order by EditDate desc"
	ElseIf ViewType = "IsTj" Then
		Sql = "select * from PersonTbl where IsTj = '1' order by EditDate desc"
	ElseIf ViewType = "IsGj" Then
		Sql = "select * from PersonTbl where IsGJ = '1' order by EditDate desc"
	ElseIf ViewType = "IsSh" Then
		Sql = "select * from PersonTbl where IsSh = '1' order by EditDate desc"
	Else
		Sql = "select * from PersonTbl order by EditDate desc"
	End If
End If

FileName = "Person_List.asp?ViewType="& ViewType &"&PersonName="& PersonName

Act = Qsite.chgStr(Trim(Request.QueryString("action")))

If Act = "IsHidden" Then
	IsHidden = Qsite.chgStr(Trim(Request.QueryString("IsHidden")))
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	If IsHidden = "" Or Not IsNumeric(IsHidden) Then IsHidden = 0
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	Conn.Execute("update PersonTbl set IsHidden = '"& IsHidden &"' where PerId = "& PerId)
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
ElseIf Act = "IsLock" Then
	IsLock = Qsite.chgStr(Trim(Request.QueryString("IsLock")))
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	If IsLock = "" Or Not IsNumeric(IsLock) Then IsLock = 0
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	Conn.Execute("update PersonTbl set IsLock = '"& IsLock &"' where PerId = "& PerId)
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
ElseIf Act = "IsTj" Then
	IsTj = Qsite.chgStr(Trim(Request.QueryString("IsTj")))
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	If IsTj = "" Or Not IsNumeric(IsTj) Then IsTj = 0
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	Conn.Execute("update PersonTbl set IsTj = '"& IsTj &"' where PerId = "& PerId)
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
ElseIf Act = "IsGj" Then
	IsGj = Qsite.chgStr(Trim(Request.QueryString("IsGj")))
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	If IsGj = "" Or Not IsNumeric(IsGj) Then IsGj = 0
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	Conn.Execute("update PersonTbl set IsGj = '"& IsGj &"' where PerId = "& PerId)
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
ElseIf Act = "IsSh" Then
	IsSh = Qsite.chgStr(Trim(Request.QueryString("IsSh")))
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	If IsSh = "" Or Not IsNumeric(IsSh) Then IsSh = 0
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	Conn.Execute("update PersonTbl set IsSh = '"& IsSh &"' where PerId = "& PerId)
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
ElseIf Act = "del" Then
	PerId = Qsite.chgStr(Trim(Request.QueryString("PerId")))
	CurrentPage = Qsite.chgStr(Trim(Request.QueryString("Page")))
	If PerId = "" Or Not IsNumeric(PerId) Then PerId = 0
	If CurrentPage = "" Or Not IsNumeric(CurrentPage) Then CurrentPage = 1
	
	Conn.Execute("delete from CompanyBoxTbl where PerId = "& PerId)
	Conn.Execute("delete from CompanyPerPoolTbl where PerId = "& PerId)
	Conn.Execute("delete from CompanySendBoxTbl where PerId = "& PerId)
	Conn.Execute("delete from PersonBoxTbl where PerId = "& PerId)
	Conn.Execute("delete from PersonComPoolTbl where PerId = "& PerId)
	Conn.Execute("delete from PersonSendBoxTbl where PerId = "& PerId)
	Conn.Execute("delete from PersonTbl where PerId = "& PerId)
	
	Response.Redirect(FileName & "&page="& CurrentPage)
	Response.End()
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>简历管理</title>
<link href="../skins/css/main.css" rel="stylesheet" type="text/css">
<script language="javascript">
function DelPerson(PerId , PersonName , ViewType , Page)
{
	var question = confirm("你确定要删除此条记录吗？");
	if (question !="0")
	{
		location.href = "Person_List.asp?action=del&PersonName=" + PersonName + "&ViewType=" + ViewType + "&Page=" + Page + "&PerId=" + PerId;
	}
}
</script>
</head>

<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
	<tr>
		<td height="25" class="td_title">简历信息搜索</td>
	</tr>
	<tr>
		<td height="23" class="td_content"><form name="SearchForm" method="post" action="Person_List.asp" style="margin:0">
			用户名/姓名/邮箱：
					<input name="PersonName" type="text" class="input_1" id="PersonName" size="50" value="<%=PersonName%>">
			<input name="Submit" type="submit" class="input_1" value="搜索">
		</form>
		
		</td>
	</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
	<tr>
		<td height="25" colspan="11" class="td_title">简历列表 -- [<a href="Person_List.asp">所有简历</a> | <a href="Person_List.asp?ViewType=NoLock">正常简历</a> | <a href="Person_List.asp?ViewType=IsLock">锁定简历</a> | <a href="Person_List.asp?ViewType=IsHidden">隐藏简历</a> |  <a href="Person_List.asp?ViewType=IsGj">高级人才简历</a> | 
			<%
		If Qsite.NewPerSh = "1" Then
		%>
		 | <a href="Person_List.asp?ViewType=IsSh">待审核简历</a>
	    <%
		 End If
		 %>] </td>
	</tr>
	<tr>
		<td width="8%" class="td_content"><strong>用户名</strong></td>
		<td width="8%" class="td_content"><strong>真实姓名</strong></td>
		<td width="6%" class="td_content"><strong>性别</strong></td>
		<td width="6%" class="td_content"><strong>年龄</strong></td>
		<td width="8%" class="td_content"><strong>学历</strong></td>
		<td width="12%" class="td_content"><strong>求职意向</strong></td>
		<td width="10%" class="td_content"><strong>是否隐藏</strong></td>
		<td width="10%" class="td_content"><strong>状态(操作)</strong></td>
		<td width="10%" class="td_content"><strong>是否高级人才</strong></td>
		<td width="10%" class="td_content"><strong>操作</strong></td>
	</tr>
<%
Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
%>
	<tr>
		<td height="45" colspan="11" class="td_content">暂无简历信息</td>
	</tr>
<%
Else
	Rs.PageSize = 20
	CurrentPage = Clng(Request("page"))
	If CurrentPage < 1 Then CurrentPage = 1
	If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
	Rs.AbsolutePage = CurrentPage
	i = 0
	Do While Not Rs.Eof
%>
	<tr>
		<td class="td_content"><%=Rs("UserName")%></td>
		<td class="td_content"><%=Rs("RealName")%></a></td>
		<td class="td_content"><%=Rs("Sex")%></td>
		<td class="td_content"><%=Rs("Age")%></td>
		<td class="td_content"><%=Rs("Qualification")%></td>
		<td class="td_content"><%=Rs("JobPost")%></td>
		<td class="td_content"><%
		If Rs("IsHidden") = "0" Then
			Response.Write("公开 (<a href="""& FileName &"&page="& CurrentPage &"&action=IsHidden&IsHidden=1&PerId="& Rs("PerId") &""">隐藏</a>)")
		Else
			Response.Write("<font color=""#FF0000"">隐藏</font> (<a href="""& FileName &"&page="& CurrentPage &"&action=IsHidden&IsHidden=0&PerId="& Rs("PerId") &""">公开</a>)")
		End If
		%></td>
		<td class="td_content"><%
		If Rs("IsLock") = "0" Then
			Response.Write("正常 (<a href="""& FileName &"&page="& CurrentPage &"&action=IsLock&IsLock=1&PerId="& Rs("PerId") &""">锁定</a>)")
		Else
			Response.Write("<font color=""#FF0000"">锁定</font> (<a href="""& FileName &"&page="& CurrentPage &"&action=IsLock&IsLock=0&PerId="& Rs("PerId") &""">开启</a>)")
		End If
		%></td>
		<td class="td_content"><%
		If Rs("IsGj") = "0" Then
			Response.Write("正常 (<a href="""& FileName &"&page="& CurrentPage &"&action=IsGj&IsGj=1&PerId="& Rs("PerId") &""">高级</a>)")
		Else
			Response.Write("<font color=""#FF0000"">高级</font> (<a href="""& FileName &"&page="& CurrentPage &"&action=IsGj&IsGj=0&PerId="& Rs("PerId") &""">取消</a>)")
		End If
		%></td>
		<td class="td_content"><%
		If Qsite.NewPerSh = "1" Then
			If Rs("IsSh") = "0" Then
				Response.Write("<a href="""& FileName &"&page="& CurrentPage &"&action=IsSh&IsSh=1&PerId="& Rs("PerId") &""">已审核</a> | ")
			Else
				Response.Write("<a href="""& FileName &"&page="& CurrentPage &"&action=IsSh&IsSh=0&PerId="& Rs("PerId") &"""><font color=""#FF0000"">未审核</font></a> | ")
			End If
		End If
		%>
		<a href="Person_Edit.asp?strPersonName=<%=PersonName%>&ViewType=<%=ViewType%>&Page=<%=CurrentPage%>&PerId=<%=Rs("PerId")%>">修改</a> | <a href="#" onClick="DelPerson('<%=Rs("PerId")%>' , '<%=PersonName%>' , '<%=ViewType%>' , '<%=CurrentPage%>');return false;">删除</a></td>
	</tr>
<%
	i = i + 1
	Rs.MoveNext
	If i >= Rs.PageSize Then Exit Do
	Loop
%>
	<tr>
		<td colspan="11" class="td_content">
<%
	Qsite.Page_Cn CurrentPage , Rs.PageCount , Rs.RecordCount , FileName
%>		</td>
	</tr>
<%
End If
Rs.Close
%>
</table>
</body>
</html>
