<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%
If Not FRAdminLevel(103) Then
	Call ErrorMsg()
End If
%>
<%
id=request("id")
if request("step")="add" then
trade_name=request("trade_name")
trade_enname=request("trade_enname")
trade_order=request("trade_order")
if trade_name="" then
	response.write "<script>alert('对不起，中文行业名称不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if trade_enname="" then
	response.write "<script>alert('对不起，英文行业名称不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if Not Isnumeric(trade_order) then
	response.write "<script>alert('排序只能为数字！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
sql="select * from JOB_trade"
set rs=Server.CreateObject("ADODB.Recordset")                                                    
rs.open sql,conn,1,3
rs.addnew
rs("trade_name")=trade_name
rs("trade_enname")=trade_enname
rs("order")=trade_order
rs.Update
rs.Close
set rs=nothing
Response.Redirect "Admin_Systrade.asp"
end if

if request("step")="del" then
conn.execute("delete from JOB_trade where trade_id="&id)
Response.Redirect "Admin_Systrade.asp"
end if

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

if request("step")="modi" then
trade_order=request("trade_order")
trade_name=request("trade_name")
trade_enname=request("trade_enname")
if trade_name="" then
	response.write "<script>alert('对不起，中文行业名称不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if trade_enname="" then
	response.write "<script>alert('对不起，英文行业名称不能为空！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
if Not Isnumeric(trade_order) then
	response.write "<script>alert('排序只能为数字！');location.href='javascript:history.back()';</script>"
	Response.End 
end if
conn.execute("update JOB_trade set trade_name='"&trade_name&"',trade_enname='"&trade_enname&"',[order]="&trade_order&" where trade_id="&request("id"))
Response.Redirect "Admin_Systrade.asp"
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>
      ①<span class="tableHeaderText">企业所属行业分类</span>直接与会员及会员发布的信息相关联。<BR>
    </td>
  </tr>

  <tr>
    <td width="10%" height=25><B>操作选项</B></td>
    <td><a href="Admin_Systrade.asp">返回分类 </a>| <a href="Admin_CreateJs.asp?Action=CreateTradeJs">生成行业分类JS</a> | [<a href="javascript:location.reload()">刷新页面</a>] </td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
   <tr>
    <th class="tableHeaderText" colspan=5 height=25>行业分类列表</th>
  </tr><%
	sql="select * from JOB_trade 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("trade_id")%></td>
    <td width="65%" height="25" align="left"><%=rs("trade_name")%> (<%=left(rs("trade_enname"),7)%>) </td><td width="25%" align="center"><!--<input name="Submit" type="button" class="inputs" onClick="window.location='Admin_Systrade.asp?id=<%=rs("trade_id")%>&step=order'" value="排序"> -->
      <input name="Submit2" type="button" class="inputs" id="Submit2" onClick="window.location='Admin_Systrade.asp?id=<%=rs("trade_id")%>&step=mod#modi'" value="修改">
        <input name="Submit3" type="button" class="inputs" id="Submit3" onClick="window.location='Admin_Systrade.asp?id=<%=rs("trade_id")%>&step=del'" 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_Systrade.asp?step=add" method="post">
    <tr>
      <td width="13%" align="right">中文名称：</td>
      <td width="17%"><input type="text" name="trade_name"></td>
      <td width="13%" align="right">英文名称：</td>
      <td width="18%"><input name="trade_enname" type="text"></td>
      <td width="7%" align="right">排序：</td>
      <td width="18%"><input name="trade_order" type="text" value="0" size="6"></td>
      <td width="14%"><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_Systrade.asp?step=modi&id=<%=id%>" method="post">
    <% set rsw=conn.execute("select * from JOB_trade where trade_id="&id)%>
	<tr>
      <td width="13%" align="right">中文名称：</td>
      <td width="17%"><input type="text" name="trade_name"  value="<%=rsw("trade_name")%>"></td>
      <td width="13%" align="right">英文名称：</td>
      <td width="18%"><input name="trade_enname" type="text" value="<%=rsw("trade_enname")%>"></td>
      <td width="7%" align="right">排序：</td>
      <td width="18%"><input name="trade_order" type="text" value="<%=rsw("order")%>" size="6"></td>
      <td width="14%"><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>