<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
If Request.QueryString("action")="del" Then
Set rs=Conn.Execute("Delete * From [Job] Where ID="&Clng(Request("id")))
JaSys("管理员" & session("ManagerUser") & "<font color=red>删除招聘信息</font>成功")
Response.Redirect "Job_Need.asp"
End if
%>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<%
If Request.QueryString("action")="add" Then
JObject=server.htmlencode(Trim(Request("JObject")))
JRenshu=server.htmlencode(Trim(Request("JRenshu")))
JPlace=server.htmlencode(Trim(Request("JPlace")))
JMoney=server.htmlencode(Trim(Request("JMoney")))
JTime=server.htmlencode(Trim(Request("JTime")))
JShixian=server.htmlencode(Trim(Request("JShixian")))
JRequest=server.htmlencode(Trim(Request("JRequest")))
If Request.Form("ok")="确定" Then 
  If JObject="" or JRenshu="" or JPlace="" or JMoney="" or JTime="" or JShixian="" or JRequest="" Then
  Response.Write("<script language=""JavaScript"">alert(""招聘信息不能为空!"");history.go(-1);</script>")
  Response.end
  Else
Set rsa = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From [Job] Where (ID is Null)"
rsa.open Sql,conn,1,3
rsa.AddNew
rsa("JObject")=JObject
rsa("JRenshu")=JRenshu
rsa("JPlace")=JPlace
rsa("JMoney")=JMoney
rsa("JTime")=JTime
rsa("JShixian")=JShixian
rsa("JRequest")=JRequest
rsa.Update
rsa.Close
Set rsa=Nothing
JaSys("管理员" & session("ManagerUser") & "<font color=red>添加招聘信息</font>成功")
Response.Redirect "Job_Need.asp"
End if
End if
Call MainForm
End if

If Request.QueryString("action")="update" Then
JObject=server.htmlencode(Trim(Request("JObject")))
JRenshu=server.htmlencode(Trim(Request("JRenshu")))
JPlace=server.htmlencode(Trim(Request("JPlace")))
JMoney=server.htmlencode(Trim(Request("JMoney")))
JTime=server.htmlencode(Trim(Request("JTime")))
JShixian=server.htmlencode(Trim(Request("JShixian")))
JRequest=server.htmlencode(Trim(Request("JRequest")))
Set rsh = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From [Job] Where ID="&Clng(Request("id"))
rsh.open Sql,conn,1,1
Call MainForm
If Request.Form("ok")="确定" Then 
  If JObject="" or JRenshu="" or JPlace="" or JMoney="" or JTime="" or JShixian="" or JRequest="" Then
  Response.Write("<script language=""JavaScript"">alert(""招聘信息不能为空!"");history.go(-1);</script>")
  Response.end
  Else
rsh.Close
Set rsh=Nothing
    If JTime<>"" and IsDate(JTime)=true then
		JTime=CDate(JTime)
	Else
		JTime=date()
	End if
SqlStr = "Update [Job] Set "
SqlStr = SqlStr & " JObject='"&JObject&"',JRenshu='"&JRenshu&"',JPlace='"&JPlace&"',"
SqlStr = SqlStr & " JMoney='"&JMoney&"',JTime='"&JTime&"',JShixian='"&JShixian&"',JRequest='"&JRequest&"' "
SqlStr = SqlStr & " Where ID=" & Clng(Request("id"))
Conn.Execute (SqlStr)
JaSys("管理员" & session("ManagerUser") & "<font color=red>更新招聘信息</font>成功")
Response.Redirect "Job_Need.asp"
End if
End if
End if
Sub MainForm
%>
<table width="100%" height="35%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <p><br>
      </p>
      <p>&nbsp;</p>
      <form name="form1" method="post" action="">
        <table width="550" border="0" cellspacing="0" cellpadding="0" class=tableBorder>
          <tr> 
            <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25" background="admin/admin_bg_1.gif">
<div align="center"><strong><font color="#FFFFFF">招聘信息管理</font></strong></div></td>
                </tr>
              </table></td>
          </tr>
          <tr> 
            <td width="120" height="25"><div align="center">招聘对象</div></td>
            <td width="428"><input name="JObject" type="text" id="JObject3" size="25" maxlength="30" <%If Request.QueryString("action")="update" Then Response.Write "value=" &rsh("JObject")%>></td>
          </tr>
          <tr> 
            <td height="25"><div align="center">招牌人数</div></td>
            <td><input name="JRenshu" type="text" id="JRenshu" 
			<%If Request.QueryString("action")="update" Then 
			  Response.Write "value=" &rsh("JRenshu")
			  Else
			  Response.Write "value=0"
			  End if%> size="5" maxlength="5">
              人 </td>
          </tr>
          <tr> 
            <td height="25"> <div align="center">工作地点</div></td>
            <td><input name="JPlace" type="text" id="JPlace" maxlength="20" <%If Request.QueryString("action")="update" Then Response.Write "value=" &rsh("JPlace")%>></td>
          </tr>
          <tr> 
            <td height="25"><div align="center">工资待遇</div></td>
            <td><input name="JMoney" type="text" id="JMoney" maxlength="50" <%If Request.QueryString("action")="update" Then Response.Write "value=" &rsh("JMoney")%>></td>
          </tr>
          <tr> 
            <td height="25"><div align="center">发布日期</div></td>
            <td><input name="JTime" type="text" id="JTime" size="20" maxlength="20" 
			<%If Request.QueryString("action")="update" Then 
			  Response.Write "value=" &rsh("JTime")
			  Else
			  Response.Write "value=" & date()
			  End if
			  %>></td>
          </tr>
          <tr> 
            <td height="25"><div align="center">有效期限</div></td>
            <td><input name="JShixian" type="text" id="JShixian" size="5" maxlength="5" 
			<%If Request.QueryString("action")="update" Then 
			  Response.Write "value=" &rsh("JShixian")
			  Else
			  Response.Write "value=0"
			  End if
			  %>>
              天</td>
          </tr>
          <tr> 
            <td><div align="center">招聘要求</div></td>
            <td><textarea name="JRequest" cols="50" rows="6" id="JRequest"><%If Request.QueryString("action")="update" Then Response.Write rsh("JRequest")%></textarea></td>
          </tr>
          <tr> 
            <td height="30" colspan="2"> <div align="center"> 
                <input name="ok" type="submit" value="确定">
                &nbsp; 
                <input name="reset" type="reset" value="取消">
              </div></td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
</table>
<%End Sub
Call CloseConn()%>
</body>
</html>