📄 hr_depart.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<%
if ChkAdmin("oa_depart")=False then
call message("您没有管理部门的权限","back")
call endexit()
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
color: #FFFFFF;
font-weight: bold;
}
.style2 {color: #CC0000}
-->
</style>
</head>
<%
Submit=request.form("Submit")
classname=trim(request.Form("classname"))
'----------------------------------
classname1=trim(request.Form("classname1"))
'-----------------------------------
tid=replace(request.Form("tid"),"'","")
select case Submit
case "修改"
sql="update oa_depart set departname='"&classname1&"' where id="&tid
conn.execute(sql)
response.Write("<script>alert('修改成功');window.location.href='hr_depart.asp';</script>")
response.End()
case "删除"
sql="delete from oa_depart where id="&tid
conn.execute(sql)
response.Write("<script>alert('删除成功');window.location.href='hr_depart.asp';</script>")
response.End()
case "添加"
sql="insert into oa_depart(departname,companyid) values('"&classname&"',"&session("companyid")&")"
conn.execute(sql)
response.Write("<script>alert('添加成功');window.location.href='hr_depart.asp';</script>")
response.End()
end select
%>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<tr align="center">
<td height="25" colspan="3" bgcolor="#CC0000"><span class="style1">部门设置</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td width="16%" height="25" align="center"> <strong><img src="../img/item_point.gif" width="4" height="7"> 部门设置</strong></td>
<td width="47%" height="25" align="left"> </td>
<td width="37%" align="left"> </td>
</tr>
<%
sql="select id, departname from oa_depart where companyid="&session("companyid")
set rs=conn.execute(sql)
do while not rs.eof
%>
<form name="myform" method="post" action="hr_depart.asp" >
<tr bgcolor="#F9F9F9">
<td height="25" align="center">分类名称</td>
<td height="25" colspan="2" align="left">
<input name="classname1" type="text" class="tabel1" id="classname1" value="<%=trim(rs("departname"))%>">
<input name="Submit" type="submit" class="tabel1" value="修改">
<input name="tid" type="hidden" id="tid" value="<%=rs("id")%>">
<input name="Submit" type="submit" class="tabel1" id="Submit" value="删除"></td>
</form>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"><strong><img src="../img/item_point.gif" width="4" height="7"> 增加部门</strong></td>
<td height="25" align="left"> </td>
<td align="left"> </td>
</tr>
<form name="myform1" method="post" action="hr_depart.asp" onSubmit="return CheckForm();">
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 分类名称</td>
<td height="25" align="left"><input name="classname" type="text" class="tabel1" id="classname">
<input name="Submit" type="submit" class="tabel1" id="Submit" value="添加"></td>
<td align="left"> </td>
</tr>
</form>
</table>
</body>
</html>
<script language="javascript">
function CheckForm()
{
var objFrm=document.myform1;
if(objFrm.classname.value=="")
{
alert("请输入部门名称!");
objFrm.classname.focus();
return false;
}
return true;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -