⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addnew_01.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<%Option explicit
'response.Write(session("AccountID"))
'response.End()
%>
<!--#include virtual ="Include/DataEnvi.asp"-->
<!-- #include virtual="include/String.asp" -->
<!-- #include virtual="include/Roles.asp"-->
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"

'判断能否添加
  Dim ObjDB,vrs
  Dim C
  Dim IntID,ObjRS,sql
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDBH ObjDB
	set vrs=server.CreateObject("Adodb.recordset")
	vrs.open "select StaID from v_Hrms_Com_Dep_Sta",ObjDB,1,1
	if vrs.eof and vrs.bof then
	%>
	<script language="JavaScript">
	alert("请您与管理员联系!先添加公司、部门、岗位等预备信息!!");
	location.href="list.asp";
	</script>
	<%
	response.End()
	end if
	vrs.close
	set vrs=nothing
	ObjDB.close

'判断是否有添加的权限
	OpenDB ObjDB
	dim AddComID
	AddComID=AddNewComID(ObjDB)
	ObjDB.close


	Sub Main()
	Dim rs
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDBH ObjDB
 'action="Addnew_03.asp"
%> 

  <form name="thisForm" method="post" onsubmit="return checkpro()">
  <input type=hidden name="Body">
  <table width="100%" cellpadding=3 cellspacing=1 class=Ltable>
    <tr class=LHtr> 
      <td height="32" colspan="4" align="left">新增部门需求 </td>
    </tr>
    <tr class=Ltr> 
      <td width="15%" height="28">公司</td>
      <td width="35%"> 
        <%
		rs.open "select * from t_Hrms_Dep where ParentID=0",ObjDB,1,1
		if rs.eof and rs.bof then
			call MsgBox("请先添加公司!","Back","None")
			response.end
		else
		%>
        <select class="SelectWidth" name="Company" size="1" onChange="changelocation(document.myform.Company.options[document.myform.Company.selectedIndex].value)">
          <option selected value="<%=rs("ID")%>"><%=trim(rs("DepName"))%></option>
          <%      
		 dim selclass
		 selclass=rs("ID")
		 rs.movenext
		 do while not rs.eof
		%>
          <option value="<%=rs("ID")%>"><%=trim(rs("DepName"))%></option>
          <%
		 rs.movenext
		 loop
		end if
		rs.close
		%>
        </select> </td>
      <td width="15%">申请理由</td>
      <td width="35%"> <select class="SelectWidth" name="Reason">
          <%
		rs.open "select * from t_Hrms_Sys_AppReason",ObjDB,1,1
		if not(rs.eof and rs.bof) then
		%>
          <option value="<%=rs("ID")%>" selected><%=rs("Reason")%></option>
          <% rs.movenext
		do while not rs.eof
		%>
          <option value="<%=rs("ID")%>"><%=rs("Reason")%></option>
          <%
		rs.movenext
		loop
		end if
		rs.close
		%>
        </select> </td>
    </tr>
    <tr class=Ltr> 
      <td width="15%" height="31">部门</td>
      <td width="35%"> <select class="SelectWidth" name="Department"  onChange="changelocationDep(document.myform.Department.options[document.myform.Department.selectedIndex].value)">
          <%
		rs.open "select * from t_Hrms_Dep where ParentID="&selclass ,ObjDB,1,1
		if not(rs.eof and rs.bof) then
		%>
          <option value="<%=rs("ID")%>" selected><%=rs("DepName")%></option>
          <%
		dim selDep
		selDep=rs("ID")
		rs.movenext
		do while not rs.eof
		%>
          <option value="<%=rs("ID")%>"><%=rs("DepName")%></option>
          <%
		rs.movenext
		loop
		end if
		rs.close
		%>
        </select> </td>
      <td width="15%">人数</td>
      <td width="35%"><input name="Number" type="text" class=Input value="" size="5" check=1>
        人 </td>
    </tr>
    <tr class=Ltr> 
      <td width="15%" height="32">岗位</td>
      <td width="35%"> <select class="SelectWidth" name="Station">
          <%
		rs.open "select distinct StaName,StaID from v_Hrms_Com_Dep_Sta where ComID='"&selClass&"' and DepID='"&selDep&"'",ObjDB,1,1
		if not(rs.eof and rs.bof) then
		%>
          <option value="<%=rs("StaID")%>" selected><%=rs("StaName")%></option>
          <% 
		rs.movenext
		do while not rs.eof
		%>
          <option value="<%=rs("StaID")%>"><%=rs("StaName")%></option>
          <%
		rs.movenext
		loop
		end if
		rs.close
		set rs=nothing
		ObjDB.Close
		set ObjDB = nothing
		%>
        </select> </td>
      <td width="15%">希望到岗日期</td>
      <td width="35%"><input name="InTime" type="text" class=Input onClick="InputDate(this)" readonly></td>
    </tr>
    <tr class=Ltr> 
      <td width="15%">岗位职责</td>
      <td colspan="3"><textArea name="Responsibility"  cols=80 rows=5 class=Textarea></textarea></td>
    </tr>
    <tr class=Ltr> 
      <td width="15%">任职条件</td>
      <td colspan="3"><textArea name="Condition"  cols=80 rows=5 class=Textarea id="Condition"></textarea></td>
    </tr>
    <tr class=Ltr> 
      <td width="15%">备注</td>
      <td colspan="3"><textArea  cols=80 rows=5 class=Textarea name="Des"></textarea></td>
    </tr>
    <tr class=Ltr height=100%> 
      <td colspan=4 align="left" valign="top"> <input type="submit" onClick="return checkpro();" name="Submit" class=Button value="提 交"> 
        <input type="button" class=Button value="取 消" onclick="history.go(-1)" id=button1 name=button1>
        <table border=0 cellpadding=0 cellspacing=0 width='100%'>
          <tr> 
            <td align=left> <input name="submit" type=submit class=button onclick="myform.action='Addnew_03.asp?IsSend=1'" value="立刻发送"> 
              <input type=submit class=button value="保存到草稿箱" onclick="myform.action='Addnew_03.asp?IsSend=0'" id=submit22 name=submit22> 
            </td>
          </tr>
        </table></td>
    </tr>
    <script language="JavaScript">
	function checkpro()
	{
	<!-- '公司限制 -->
		if(document.myform.Company.value =="") 
		{
		document.myform.Company.focus();
		alert("公司不能为空!");
		 return false;
		}
		
		<!-- '部门限制 -->
		if(document.myform.Department.value =="") 
		{
		document.myform.Department.focus();
		alert("部门不能为空!");
		 return false;
		}
		
		<!-- 岗位限制 -->
		if(document.myform.Station.value =="") 
		{
		document.myform.Station.focus();
		alert("岗位不能为空!");
		 return false;
		}
		
		<!-- '申请原因限制 -->
		if(document.myform.Reason.value =="") 
		{
		document.myform.Reason.focus();
		alert("申请原因不能为空!");
		 return false;
		}
		
		<!-- '申请人数 -->
		if(document.myform.Number.value =="") 
		{
		document.myform.Number.focus();
		alert("招聘人数不能为空!");
		 return false;
		}
		if(isNaN(document.myform.Number.value.length))
		{
			document.myform.Number.focus();
			alert("工作年限必须为数字!");
			return false;
		}
		if((document.myform.Number.value > 1999999999)||(document.myform.Number.value < 0))
		{
			document.myform.Number.focus();
			alert("工作年限必须为1到1999999999的数!");
			return false;
		}
		
		<!-- '希望到岗日期限制 -->
		if(document.myform.InTime.value =="") 
		{
		document.myform.InTime.focus();
		alert("希望到岗日期不能为空!");
		 return false;
		}
		
		<!-- '岗位职责限制 -->
		if(document.myform.Responsibility.value =="") 
		{
		document.myform.Responsibility.focus();
		alert("岗位职责不能为空!");
		 return false;
		}
		
		<!-- '任职条件限制限制 -->
		if(document.myform.Condition.value =="") 
		{
		document.myform.Condition.focus();
		alert("'任职条件限制不能为空!");
		 return false;
		}
		
		<!-- '备注信息限制限制 -->
		if(document.myform.Des.value.length > 500) 
		{
		document.myform.Des.focus();
		alert("备注信息的输入最多不能超过500个字!!");
		 return false;
		}
		
	}
	</Script>
  </table>
  </form>

<%
End Sub
%>
<!--#include file ="Templet.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -