<%@ codepage ="936" %>
  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="16"
	dir="../err.asp" 
  %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->

<LINK href="../css/style.css" rel=stylesheet type=text/css> 
 <script>
  function checkcon()
  {
    var strn=document.addform.addname.value;
 	if(strn.replace(/^\s+|\s+$/g,'')=="")
  {
   alert("请输入名称！");
   document.addform.addname.focus();
   return false;
  }	
  }
    function checkcon1()
  {
    var strn=document.modiform.modiname.value;
 	if(strn.replace(/^\s+|\s+$/g,'')=="")
  {
   alert("请输入名称！");
   document.modiform.modiname.focus();
   return false;
  }	
  }
  
 function isok()
 {
 var i=confirm("你确定要删除吗？");
 if(i)
 {
 return true;
 }
 else
 {
  return false;
 
 }
 }
 
</script>
<title>招聘信息---职业类别管理</title>
<%
  addgo=Replace_Text(request("addgo"))
  addname=Replace_Text(request("addname"))
  addname=replace(addname,"","")
  addname=replace(addname,"","")
  addname=replace(addname,"","")
   addname=replace(addname,"","")
   addname=replace(addname,"","")
   
 '-添加记录----------------------------------
  if addgo<>""  and addname<>""  then 
  set rsn=server.CreateObject("adodb.recordset")
  sqln="select  * from Websen_jobkind where kindname='"&addname&"' "
  rsn.open sqln,conn,1,3
  if not rsn.eof  then
  response.Write("<script>alert('对不起！该职业类别已经存在！');history.back(-1);</script>")
  response.End()
  else
  rsn.addnew
  rsn("kindname")=addname
  rsn.update
  rsn.close
   end if
  end if
  '-----------------------------------
'-删除记录----------------------------
  id=Replace_Text(request("id"))
 if  Replace_Text(request("action"))="del" and id<>"" then 
 conn.execute "delete from  Websen_jobkind where id="&id
 end if

'-----------------------

'--修改记录---------------------------
modiid=Replace_Text(request("modiid"))
modigo=Replace_Text(request("modigo"))
modiname=Replace_Text(request("modiname"))
if  Replace_Text(request("modigo"))<>"" and modiid<>"" and modiname<>""  then 
  set rsn=server.CreateObject("adodb.recordset")
  sqln="select  * from Websen_jobkind where kindname='"&modiname&"' and id<>"&modiid&" "
  rsn.open sqln,conn,1,3
  if not rsn.eof  then
  response.Write("<script>alert('对不起！该职业类别已经存在！');history.back(-1);</script>")
  response.End()
  else
  conn.execute "update Websen_jobkind set kindname='"&modiname&"' where id="&modiid
  rsn.close
   end if
end if
'-------------------------
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">职业类别管理 </th> 
  </tr> 
   <tr> 
     <td width="10%" height=25 class="forumRowHighlight"> <B>操作选项</B></td> 
         <FORM name=searchForm action="work.asp" method=post onSubmit="javascript:if(doSearch()==false) return false;"><td class="forumRowHighlight">
       招聘信息关键字：<input name="keywords" type="text" value="">

       <input type="submit" value="立刻查找" id=submit name=submit>
         </td></form>
  </tr> 
</table>
<%
if Replace_Text(request("action"))="add" then 
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center > 
   <form action="jobkind.asp" method="post" name="addform" onSubmit="return checkcon();"> <tr> 
     <td   bgcolor="#F1F2F3" height="30"> 
&nbsp;请输入职业类别名称：
<input type="text" name="addname" value="" maxlength="15" onblur="this.value=this.value.replace(/\s/igm,'')">
&nbsp;&nbsp;<input type="submit" name="addgo" value="添加">      </td>  
  </tr> 
  </form>
</table>
<%
end if
%><%
if Replace_Text(request("action"))="modi" then 
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center > 
   <form action="jobkind.asp" method="post" name="modiform" onSubmit="return checkcon1();"> <tr> 
     <td   bgcolor="#F1F2F3" height="30"> <input  type="hidden" name="modiid" value="<%=Replace_Text(request("mid"))%>" />
&nbsp;修改职业类别名称：<input type="text" name="modiname" value="<%=Replace_Text(request("kname"))%>" maxlength="15" onblur="this.value=this.value.replace(/\s/igm,'')">
<input  type="hidden" name="page" value="<%=request("page")%>" />
&nbsp;&nbsp;<input type="submit" name="modigo" value="修改">      </td>  
  </tr> 
  </form>
</table>
<%
end if
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder"> 
 
 <tr><td colspan="4" align="left" height="25">&nbsp;<a href="jobkind.asp?action=add"><font color="#0066CC"><b>添加职业类别</b></font></a>&nbsp;&nbsp;<a  href="work.asp"><font color="#0066CC"><b>招聘信息管理</b></font></a>&nbsp;&nbsp;<a href="getjobp.asp" ><font color="#0066CC"><b>求职者信息管理</b></font></a>&nbsp;&nbsp;<a href="getjobdes.asp" ><font color="#0066CC"><b>求职注册协议管理</b></font></a></td ></tr>
  <tr> 
     <th height=25 colspan="4" class="tableHeaderText">职业类别管理 </th> 	
  </tr> 
  <%
	set rs=server.CreateObject("adodb.recordset")
   sqlz="select  * from Websen_jobkind  order by id "
   rs.open sqlz,conn,1,1
   msg_per_page=20 '定义每页显示记录条数
 %><!--#include file="../../inc/headpage.asp"-->
  <tr> 
 <%
	 
 if rs.eof then
response.Write"<td><br><br><div align='center'>暂无数据信息</div><br><br></td>"
else
%>
  <%
	 i=1
do while not rs.eof and rowcount > 0
%>
   <td height="25"><font  color="#0099CC"><%=i%></font>.<%=rs("kindname")%>&nbsp;【<a href="jobkind.asp?action=modi&kname=<%=rs("kindname")%>&mid=<%=rs("id")%>&page=<%=request("page")%>"><font color="red">修改</font></a>】【<a href="jobkind.asp?action=del&id=<%=rs("id")%>&page=<%=request("page")%>" onclick="return isok();"><font color="red">删除</font></a>】</td>
  <%
 if i mod 3 =0 then 
 response.Write("</tr><tr>")
 end if
rowcount=rowcount-1
i=i+1
rs.movenext
loop
end if
%>
	 </tr>
	
<tr>	<td  colspan="4"> 
 
       <%=listPages("jobkind.asp")%>   </td> 
  </tr> 
</table>



  
<!--#include file="../copy.asp" -->
<%
rs.close
conn.close
%>