📄 edit0.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim ObjDB,StrSQL
Dim C
Dim IntID
Dim ObjRS,rs
IntID = Request.QueryString("ID")
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB
Set ObjRS = Server.CreateObject("Adodb.Recordset")
ObjRS.open "select * from t_Hrms_JobApplications_DepRequirement Where ID='"&IntID&"' and State<>1 and State<>2 and State<>6",ObjDB,1,1
if not (ObjRS.eof and ObjRS.bof) then
%>
<script language=javascript>
alert("对不起!您没有权限修改此条信息!\n您可以去查看此条信息!!");
location.href='list.asp';
</script>
<%
response.End()
ObjRS.close
end if
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
Set ObjRS = C.View("Select * From v_Hrms_DepRequirement Where ID = " & IntID)
dim DepID,ComID,JobID,DutyID,ReasonID,changes,States1,Com1,Dep1,Sta1,Job1,Rea1,Num1,InTime1
if ObjRS("State")=1 then
States1="已提供需求"
end if
if ObjRS("State")=2 then
States1="重新提供需求"
end if
if ObjRS("State")=6 then
States1="有意见"
end if
Com1=ObjRS("ComName")
Dep1=ObjRS("DepName")
Sta1=ObjRS("JobName")
Rea1=ObjRS("Reason")
Num1=ObjRS("Number")
InTime1=ObjRS("InTime")
ComID=ObjRS("Company")
DepID=ObjRS("Department")
JobID=ObjRS("Station")
ReasonID=ObjRS("ReasonID")
If Request.Form.Count > 0 Then
'申请人数
if Request("Number")="" then
%>
<script language=javascript>
alert("招聘人数不能为空!");
history.go(-1);
</script>
<%
response.End()
else if not IsNumeric(request("Number")) then
%>
<script language=javascript>
alert("招聘人数必须为整数!");
history.go(-1);
</script>
<%
response.End()
else if request("Number")>1999999999 or request("Number")<=0 then
%>
<script language=javascript>
alert("招聘人数必须为大于0小于1999999999的整数!");
history.go(-1);
</script>
<%
response.End()
end if
end if
end if
'备注信息限制
if len(Request("Des"))>500 then
%>
<script language=javascript>
alert("备注信息的输入最多不能超过500个字!!");
history.go(-1);
</script>
<%
response.End()
end if
IntID = Request.Form("ID")
Set ObjRS = Server.CreateObject("ADODB.Recordset")
StrSQL = "Select * From t_Hrms_JobApplications_DepRequirement Where Id='"&IntID&"'"
ObjRS.Open StrSQL,ObjDB,1,3
ObjRS("Company")= Request("Company")
ObjRS("Department")=Request("Department")
ObjRS("Station")= Request("Station")
ObjRS("Number")=Request("Number")
ObjRS("Reason")=Request("Reason")
ObjRS.Fields("InTime")=Request("InTime")
ObjRS("Responsibility")=Request("Responsibility")
ObjRS("Condition")=Request("Condition")
ObjRS("Des")=Request("Des")
ObjRS.Fields("ReFinalTime")=Now()
if Request("State")<>"" then
ObjRS("State")=Request("State")
end if
ObjRS("AppPerson")=Session("AccountName")
ObjRS.Update
IntID = ObjRS("ID")
'添加日志
ObjRS.close
ObjRS.open "Select * From v_Hrms_DepRequirement Where ID = " & IntID,ObjDB,1,1
dim States2,Com2,Dep2,Sta2,Job2,Rea2,Num2,InTime2
if ObjRS("State")=7 then
States2="撤消请求"
end if
if ObjRS("State")=1 then
States2="重新提供需求"
end if
if ObjRS("State")=2 then
States2="已提供需求"
end if
if ObjRS("State")=6 then
States2="有意见"
end if
Com2=ObjRS("ComName")
Dep2=ObjRS("DepName")
Sta2=ObjRS("JobName")
Rea2=ObjRS("Reason")
Num2=ObjRS("Number")
InTime2=ObjRS("InTime")
if Com1<>Com2 then
Changes=Changes&"公司由"&Com1&"改变为"&Com2&"。"
end if
if Dep1<>Dep2 then
Changes=Changes&"部门由"&Dep1&"改变为"&Dep2&"。"
end if
if Sta1<>Sta2 then
Changes=Changes&"岗位由"&Sta1&"改变为"&Sta2&"。"
end if
if Rea1<>Rea2 then
Changes=Changes&"申请理由由"&Rea1&"改变为"&Rea2&"。"
end if
if Num1<>Num2 then
Changes=Changes&"人数由"&Num1&"改变为"&Num2&"。"
end if
if InTime1<>InTime2 then
Changes=Changes&"希望到岗日期由"&InTime1&"改变为"&InTime2&"。"
end if
if States1<>States2 then
Changes=Changes&"申请状态由"&States1&"改变为"&States2&"。"
end if
ObjRS.close
dim FirstMenu,SecondMenu,Opertion,OTime,OName,OIP,ODesc
OIP=Request.ServerVariables("REMOTE_ADDR")
OName= Session("AccountName")
if OName="administrator" then
OName="系统管理员"
end if
call AddLog("招聘管理","部门需求","修改",now(),OName ,OIP,"",Changes,ObjDB)
ObjDB.Close
Set ObjDB = Nothing
Response.Redirect "list.asp"
End If
Sub Main
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
<!--读取分类字段赋给JS数组-->
dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from v_Hrms_Com_Dep_Sta ",ObjDB,1,1
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("DepName"))%>","<%= rs("ComID")%>","<%= rs("DepID")%>","<%= rs("StaName")%>","<%= rs("StaID")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Department.length = 0;
var locationid=locationid;
var i,j,k;
var Subid;
var DepID;
var StaID;
DepID = "";
StaID = "";
document.myform.Station.length = 0
k=0;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
if (DepID.indexOf(subcat[i][2]) == -1)
{
document.myform.Department.options[document.myform.Department.length] = new Option(subcat[i][0], subcat[i][2]);
k=k+1;
if (k == 1)
{
Subid=subcat[i][2];
}
}
DepID = DepID + "," + subcat[i][2];
}
}
for (j=0;j < onecount; j++)
{
if ((subcat[j][1] == locationid) && (Subid == subcat[j][2]))
{
if (StaID.indexOf(subcat[j][4]) == -1)
{
document.myform.Station.options[document.myform.Station.length] = new Option(subcat[j][3], subcat[j][4]);
}
StaID = StaID + "," + subcat[j][4];
}
}
}
</script>
<script language = "JavaScript">
var onecountDep;
onecountDep=0;
subcatDep = new Array();
<%
<!--读取分类字段赋给JS数组-->
dim countDep
<!-- set rs=server.createobject("adodb.recordset") -->
rs.open "select distinct* from v_Hrms_Dep_Job ",ObjDB,1,1
countDep = 0
do while not rs.eof
%>
subcatDep[<%=countDep%>] = new Array("<%= trim(rs("JobName"))%>","<%= rs("ID")%>","<%= rs("Pos")%>");
<%
countDep = countDep + 1
rs.movenext
loop
rs.close
%>
onecountDep=<%=countDep%>;
function changelocationDep(locationid)
{
document.myform.Station.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecountDep; i++)
{
if (subcatDep[i][1] == locationid)
{
document.myform.Station.options[document.myform.Station.length] = new Option(subcatDep[i][0], subcatDep[i][2]);
}
}
}
</script>
<form action="" method="post" name=myform>
<input type=hidden name=ID value="<%=Request.QueryString("ID")%>">
<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%">
<%
dim rs1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from t_Hrms_Dep where ParentID=0",ObjDB,1,1
if rs1.eof and rs1.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 value="<%=rs1("ID")%>" selected><%=trim(rs1("DepName"))%></option>
<%
rs1.movenext
do while not rs1.eof
%>
<option value="<%=rs1("ID")%>" <%if rs1("ID")=ComID then response.Write("Selected")%>><%=trim(rs1("DepName"))%></option>
<%
rs1.movenext
loop
end if
rs1.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")%>" <%if rs("ID")=ReasonID then response.Write("Selected")%>><%=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%">
<%
rs1.open "select * from t_Hrms_Dep where ParentID="&ComID ,ObjDB,1,1
%>
<select class="SelectWidth" name="Department" onChange="changelocationDep(document.myform.Department.options[document.myform.Department.selectedIndex].value)">
<%
if not(rs1.eof and rs1.bof) then
%>
<option value="<%=rs1("ID")%>" selected><%=rs1("DepName")%></option>
<%
dim selDep
if DepID="" then
selDep=rs1("ID")
else
selDep=DepID
end if
rs1.movenext
do while not rs1.eof
%>
<option value="<%=rs1("ID")%>" <%if rs1("ID")=DepID then response.Write("selected")%>><%=rs1("DepName")%></option>
<%
rs1.movenext
loop
end if
rs1.close
set rs1 = nothing
%>
</select>
</td>
<td width="15%">人数</td>
<td width="35%"><input name="Number" type="text" class=Input value="<%=ObjRS("Number")%>" 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='"&ComID&"' 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")%>"<%if rs("StaID")=JobID then response.Write("Selected")%>><%=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" readonly class=Input onClick="InputDate(this)" value="<%=ObjRS("InTime")%>"></td>
</tr>
<tr class=Ltr>
<td width="15%" height="32">申请人</td>
<td width="35%"> <input name="AppPerson" type="text" class=Input readonly value="<%=ObjRS("AppPerson")%>" check=1>
</td>
<td width="15%">招聘状态</td>
<td width="35%">
<%
dim States
if ObjRS("State")=1 then
States="已提供需求"
%>
<input type="text" readonly name="Display" value="<%=States%>">
<%
end if
%>
<%
if ObjRS("State")=6 then
%>
<font color="#0000CC">有意见</font>
<input type="radio" name="State" value="2">
重新提供需求
<input type="radio" name="State" value="7">
撤消需求
<%
end if
%>
</td>
</tr>
<tr class=Ltr>
<td width="15%">岗位职责</td>
<td colspan="3"><textArea name="Responsibility" cols=80 rows=5 class=Textarea><%=ObjRS("Responsibility")%></textarea></td>
</tr>
<tr class=Ltr>
<td width="15%">任职条件</td>
<td colspan="3"><textArea name="Condition" cols=80 rows=5 class=Textarea id="Condition"><%=ObjRS("Condition")%></textarea></td>
</tr>
<tr class=Ltr>
<td width="15%">备注</td>
<td colspan="3"><textArea cols=80 rows=5 class=Textarea name="Des"><%=ObjRS("Des")%></textarea></td>
</tr>
<tr class=Ltr>
<td width="15%">反馈的意见</td>
<td colspan="3"><textArea cols=80 rows=5 class=Textarea readonly name="FeedBack"><%=ObjRS("feedback")%></textarea></td>
</tr>
<tr class=Ltr height=100%>
<td colspan=4 align="left" valign="top">
<input type="submit" name="Submit" class=Button value="提 交">
<input type="button" class=Button value="取 消"onClick="history.go(-1)" id=button13 name=button1></td>
</tr>
</table>
</form>
<%
End Sub
%>
<!-- #include file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -