<!--#include file="../../conn/conn.asp"-->
<!--#include file="../checkvalid.asp"-->
<!--#include file="../../Inc/Commoncode.asp" -->
<%
If Not FRAdminLevel(105) Then
	Call ErrorMsg()
End If
%>
<%
fid=request("fid")
if request("step")="add" then
position_name=request("position_name")
position_enname=request("position_enname")
position_order=request("position_order")
if position_name="" then
	response.write "<script>alert('对不起，中文岗位不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if position_enname="" then
	response.write "<script>alert('对不起，英文岗位不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if not Isnumeric(position_order) then
	response.write "<script>alert('对不起，排序只能为数字！');location.href='javascript:history.back()';</script>"
	Response.End
end if
sql="select * from job_position"
set rs=Server.CreateObject("ADODB.Recordset")                                                    
rs.open sql,conn,1,3
rs.addnew
rs("position_name")=position_name
rs("position_enname")=position_enname
rs("position_fid")=fid
rs("order")=position_order
rs.Update
rs.Close
set rs=nothing
Response.Redirect "Admin_Sysposition.asp?fid="&fid&"&ceng="&request("ceng")
end if

if request("step")="del" then
conn.execute("delete from job_position where position_fid="&request("id"))
conn.execute("delete from job_position where position_id="&request("id"))
Response.Redirect "Admin_Sysposition.asp?fid="&fid&"&ceng="&request("ceng")
end if

if request("step")="order" then
set rs=server.CreateObject("adodb.recordset")
sql="select date from job_position where position_id="&request("id")
rs.open sql,conn,1,3
rs("date")=now()
rs.update
rs.close
set rs=nothing
Response.Redirect "Admin_Sysposition.asp?fid="&fid&"&ceng="&request("ceng")
end if

if request("step")="modi" then
position_order=request("position_order")
position_name=request("position_name")
position_enname=request("position_enname")
if position_name="" then
	response.write "<script>alert('对不起，中文岗位不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if position_enname="" then
	response.write "<script>alert('对不起，英文岗位不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if not Isnumeric(position_order) then
	response.write "<script>alert('对不起，排序只能为数字！');location.href='javascript:history.back()';</script>"
	Response.End
end if
conn.execute("update job_position set position_name='"&position_name&"',position_enname='"&position_enname&"',[order]="&position_order&" where position_id="&request("id"))
Response.Redirect "Admin_Sysposition.asp?fid="&fid&"&ceng="&request("ceng")
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统工作岗位信息设置</title>
<link href="../css/style<%=sk%>.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../inc/input.js"></script>
</head>

<body>
<table width="98%" border="0" cellspacing="1" cellpadding="2" align=center class="tableBorder">
  <tr>
    <th height=25 colspan="2" class="tableHeaderText">系统工作岗位信息管理 </th>
  </tr>
  <tr>
    <td colspan="2"><p><B>注意</B>：<BR>
      ①工作岗位分类直接与会员及会员发布的信息相关联，删除上级分类同时将删除该类别下的所有小分类以及所有相关的信息。<BR>
    </td>
  </tr>
   <%
  	ceng=request("ceng")
	if request("fid")="" then 
	fid=0 
	else
	fid=request("fid")
	end if
	if fid=0 then
    ceng=1	
	end if%>
  <tr>
    <td width="10%" height=25><B>操作选项</B></td>
    <td><a href="Admin_Sysposition.asp?fid=0">返回一级分类 </a>| <a href="Admin_CreateJs.asp?Action=CreatePositionJs">生成岗位分类JS</a> | [<a href="javascript:location.reload()">刷新页面</a>] </td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
	<%if fid<>0 then%>  
 	<tr>
    <th class="tableHeaderText" colspan=4 height=25><%
	select case ceng
	case 2
	response.Write "二级分类"
	end select
	%>列表</th>
  </tr>
  <%else%>
   <tr>
    <th class="tableHeaderText" colspan=4 height=25>一级分类列表</th>
  </tr>
  <%end if%>
  <%
	sql="select * from JOB_position where position_fid="&fid&" order by [order] asc,date desc"
set rs=Server.CreateObject("ADODB.Recordset")                                                    
rs.open sql,conn,1,1 
	if (rs.eof and rs.bof) then
	response.write "<tr align=""center""><td height=20>暂无内容</td></tr>"
else                                                 
n=0                                                   
do while not rs.eof
n=n+1%>
<tr align="center">
    <td width="10%"><%=rs("position_id")%></td>
	<td width="65%" height="25" align="left"><%=rs("position_name")%> (<%=left(rs("position_enname"),7)%>) </td>
	<td width="25%"><!--<input name="Submit" type="button" class="inputs" onClick="window.location='Admin_Sysposition.asp?fid=<%=fid%>&id=<%=rs("position_id")%>&step=order&ceng=<%=ceng%>'" value="排序">--> 	 
	<%if ceng<2 then%><input name="Submit1" type="button" class="inputs" id="Submit1" onClick="window.location='Admin_Sysposition.asp?fid=<%=rs("position_id")%>&ceng=<%=ceng+1%>'" value="子类"> 
	<%end if%>
      <input name="Submit2" type="button" class="inputs" id="Submit2" onClick="window.location='Admin_Sysposition.asp?fid=<%=fid%>&id=<%=rs("position_id")%>&step=mod&ceng=<%=ceng%>#modi'" value="修改">
        <input name="Submit3" type="button" class="inputs" id="Submit3" onClick="window.location='Admin_Sysposition.asp?fid=<%=fid%>&id=<%=rs("position_id")%>&step=del&ceng=<%=ceng%>'" value="删除">
    </td>
  </tr><%rs.movenext                                             
loop   
end if                                   
rs.close                                             
set rs=nothing%>
</table>
<%if request("step")<>"mod" then%>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr>
    <th class="tableHeaderText" colspan=7 height=25>新增分类</th>
  </tr>
  <form name="addpc" action="Admin_Sysposition.asp?step=add&fid=<%=fid%>&ceng=<%=ceng%>" method="post">
    <tr>
      <td width="10%" align="right">中文名称：</td>
      <td width="18%"><input type="text" name="position_name"></td>
      <td width="10%" align="right">英文名称：</td>
      <td width="18%"><input name="position_enname" type="text"></td>
	  <td width="6%" align="right">排序：</td>
      <td width="8%"><input name="position_order" size="6" value="0" type="text"></td>
      <td width="15%"><input name="Submit4" type="submit" class="inputs" value="提交"></td>
    </tr>
  </form>
</table>
<%else%>
<a name="modi"></a><table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr>
    <th class="tableHeaderText" colspan=7 height=25>修改分类</th>
  </tr>
  <%id=request("id")%>
  <form name="addpc" action="Admin_Sysposition.asp?step=modi&fid=<%=fid%>&id=<%=id%>&ceng=<%=ceng%>" method="post">
    <% set rsw=conn.execute("select * from JOB_position where position_id="&id)%>
	<tr>
      <td width="10%"><div align="right">中文名称：</div></td>
      <td width="18%"><input type="text" name="position_name"  value="<%=rsw("position_name")%>"></td>
      <td width="10%"><div align="right">英文名称：</div></td>
      <td width="18%"><input name="position_enname" type="text" value="<%=rsw("position_enname")%>"></td>
	  <td width="6%" align="right">排序：</td>
      <td width="8%"><input name="position_order" size="6" value="<%=rsw("order")%>" type="text"></td>
      <td width="15%"><input name="Submit4" type="submit" class="inputs" value="提交"></td>
    </tr>
		<%rsw.close
	set rsw=nothing
	%>
  </form>
</table>
<%end if%>
<!--#include file="../inc/copy.asp" -->
</body>
</html>