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

📄 dir_add.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:增加档案库信息
'参数:request.form("addedit_subed")="true"#表单提交;
%>

<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!--#include file="./inc/flt1.asp"-->
<!--#include file="./inc/outcheck.asp"-->

<%
'response.buffer=false

'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
sjflh=request("sjflh") '上级分类号

if len(sjflh)>=20 then
  Response.write "<font color=red>分类级数不能超过10级</font>"
  oConn.close
  set oConn=nothing
  Response.end
end if
'------------------------------------------------
'------------------------------------------------增加记录
table="tbioaDocument_Sort" '表名
if request.form("addedit_subed")="true" then 
'表单提交后
	input_LMMC=Request.Form("input_LMMC")'标题
	input_GDQX=Request.Form("input_GDQX")'查看者
	input_GDQXBZ=Request.Form("input_GDQXBZ")'查看者属性
	input_SCQXBZ=Request.Form("input_SCQXBZ")'查看目录属性
	input_GLQX=Request.Form("input_GLQX")'管理者
	input_GLQXBZ=Request.Form("input_GLQXBZ")'管理者属性
	input_LMZS=Request.Form("input_LMZS")'备注
	
	sql="select * from "&table
	set rs=oConn.execute(sql)
	
	'无分类的情况
	if rs.eof and  rs.bof and sjflh<>"0" then
	   call MsgOut("您所在的分类已被删除,请返回","javascript:history.back()",1)
	                oConn.close
	                set oConn=nothing
	                Response.end
	end if 
	if rs.eof and  rs.bof and sjflh="0" then
	   flh="01"
	   lmlj="../atthfiles/wdfj/"
	end if
	
	'增加一级分类的情况
	if not rs.eof and not rs.bof and sjflh="0" then
	  sql_max="select max(cast(flh as int)) from "&table&" where len(flh)=2"
	  set rs1=oConn.execute(sql_max)
	  sql2="select * from "&table&" where sjflh='0' or sjflh='00' order by cast(flh as int)"
	  set rs2=oConn.execute(sql2)
          if rs1(0)=99 and rs2.RecordCount>=99 then
	     Response.Write "<p><font color=red>同级分类已是最大,不能超过99个分类</font>"
	     oConn.close
	     set oConn=nothing
	     Response.end
	  end if
	  if isnull(rs1(0))=true then
	     flh_temp="01"
	     flh=flh_temp
	  else
	     for i=1 to 99 
	         if i<10 then
	            j="0"&i
	         else
	            j=cstr(i)
	         end if 
	     if not rs2.eof then 
	        if rs2("flh")<>j then
	           flh_temp=j
	           flh=flh_temp
	           exit for
	        end if
	     else
	        flh_temp=j
	        flh=flh_temp
	        exit for
	     end if
	      'Response.Write flh
	       rs2.movenext
	     next                                                           
	  end if
	  lmlj="../atthfiles/wdfj/"
	end if

	'增加其它分类情况
	if not rs.eof and not rs.bof and sjflh<>"0" then
	    sql="select * from "&table&" where flh='"&sjflh&"'"
	    set rs1=oConn.execute(sql)
	    if rs1.eof and rs1.bof then
	       call MsgOut("您所在的分类已被删除,请返回","javascript:history.back()",1)
	       oConn.close
	       set oConn=nothing
	       Response.end
	    end if
	    rs1.close
	    set rs1=nothing
	    dim l
	    l=len(sjflh) 
	    if l>=20 then
	       Response.Write  "<p><font color=red>分类级数不能超过10级</font>"
	       oConn.close
	    set oConn=nothing
	      Response.End 
	    end if
	      l=l+1
	sql1="select max(cast(substring(flh,"&l&",2) as int)) from "&table&" where sjflh='"&sjflh&"' and flh<>'"&sjflh&"'" 
	set rs1=oConn.execute(sql1)

	'判断分类数
	sql2="select * from "&table&" where sjflh='"&sjflh&"'and flh<>'"&sjflh&"' order by cast(substring(flh,"&l&",2) as int)"
	set rs2=oConn.execute(sql2)
	
	
	if rs1(0)=99 and rs2.RecordCount>=99 then
	     Response.Write "<p><p><font color=red>同级分类已是最大,不能超过99个分类</font>"
	     oConn.close
	     set oConn=nothing
	     Response.end
	end if
	
	if isnull(rs1(0))=true then
	     flh_temp="01"
	     flh=sjflh&flh_temp
	
	else
	     for i=1 to 99 
	         if i<10 then
	            j="0"&i
	         else
	            j=cstr(i)
	         end if
	         if not rs2.eof then 
	             if right(rs2("flh"),2)<>j then
	                flh_temp=j
	                flh=sjflh&flh_temp
	                exit for
	             end if
	         else
	             flh_temp=j
	             flh=sjflh&flh_temp
	             exit for
	         end if
	         rs2.movenext
	         next                                                           
	 end if
	 set rs1=oConn.execute(sql1)
	 lmlj="../atthfiles/wdfj/"
	end if

	'添加时使用的字段
	field1=array("flh","lmmc","lmzs","sjflh","lmlj","GDQX","GDQXbz","SCQXBZ","glqx","glqxbz","zhxgr","zhxgsj")
	value1=array(flh,input_LMMC,input_LMZS,sjflh,lmlj,input_GDQX,input_GDQXBZ,input_SCQXBZ,input_GLQX,input_GLQXBZ,LoginID,now())
	for i=0 to ubound(field1)
		value1(i)=replace(value1(i),"'","''")
	next
	sql = "INSERT INTO " & table & " (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')"
	oConn.Execute sql
%>
	<script language="javascript">
	<%url="dir_list.asp?flh="&flh%>
	var temp;
	<%response.write "temp="& "''" & "+" & "''"  & replace(checktxt_w2(input_LMMC),"\","\\") & chr(13)%>
	if (parent.left) parent.left.addNode('<%=sjflh%>',parent.left.foldersTree,parent.left.folderNode(temp,'<%=flh%>','<%=url%>','../images/openfolder.gif','../images/closedfolder.gif'));
	history.go(-2);
	</script>
<%
	response.end
end if
'------------------------------------------------
%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
 function require(form){
	return 	checnull(form.input_LMMC,"请填写档案库名称!") &&
		checnull(form.viewer,"请设置档案库浏览权限!") &&
		checnull(form.manager,"请设置档案库管理权限!")&&
		confirm('确定要增加该类别吗?');
 }
 
 function doSel_Cx(sGDQX,sGDQXsz){
	url = "../inc/SelectQx.asp?GDQX="+sGDQX+"&GDQXsz="+sGDQXsz
	k=showModalDialog(url,"","dialogWidth:510px;status:no;dialogHeight:60px")
	if (k!="") {
		k=k.split("_")
		if (k[0]!="0"){
			eventfrm1.viewer.value=k[2].replace(/ /g,"\n")
			eventfrm1.input_GDQX.value=k[1]
			eventfrm1.input_GDQXBZ.value=k[0]
		}else{
			eventfrm1.viewer.value='全部人员'
			eventfrm1.input_GDQX.value=k[1]
			eventfrm1.input_GDQXBZ.value=k[0]
		}
	}
 }
 
 function doSel_Gl(sGDQX,sGDQXsz){
	url = "../inc/SelectQx.asp?GDQX="+sGDQX+"&GDQXsz="+sGDQXsz
	k=showModalDialog(url,"","dialogWidth:510px;status:no;dialogHeight:60px")
	if (k!="") {
		k=k.split("_")
		if (k[0]!="0"){
			eventfrm1.manager.value=k[2].replace(/ /g,"\n")
			eventfrm1.input_GLQX.value=k[1]
			eventfrm1.input_GLQXBZ.value=k[0]
		}else{
			eventfrm1.manager.value='全部人员'
			eventfrm1.input_GLQX.value=k[1]
			eventfrm1.input_GLQXBZ.value=k[0]
		}
	}
 }
-->
</script>
</head>

<body topmargin="0" leftmargin="0">
<div style="font: bold 14px/20px; color: #ffffff; background-color: #2951AD; width: 100%; padding-top: 2px; padding-Left: 10px; margin-bottom:5px;">新增文档分类&nbsp;&nbsp;<%call flt(sjflh,"")%></div>
<div align="center">
<table width="580" cellspacing="1" cellpadding="2" class="tab">
  <tr>
    <td width="100%" class="tdTop">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdTop">
            <p align="left"><img border="0" src="../images/icon_title.gif" align="left">添加档案库</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="25%" class="td1">
    
    <form name="eventfrm1" method="POST" action="?sjflh=<%=sjflh%>" onSubmit="return require(this)">
      <input type=hidden name="addedit_subed" value="true">
	<table width="100%" cellspacing="3" cellpadding="2">
	  <tr>
	    <td width="100" class="td1" align="right"><font COLOR="RED">*</font> 名称:</td>
	    <td class="td1"><input type="text" name="input_LMMC" size="50" maxlength="50" class="input"></td>
	  </tr>
	  <tr>
	    <td width="100" class="td1" align="right" valign="_top"><font COLOR="RED">*</font> 归档权限:
	      <img src="../images/selectman.gif" border="0" onclick="doSel_Cx(eventfrm1.input_GDQX.value,eventfrm1.input_GDQXBZ.value)" style="cursor:hand">
	    </td>
	    <td class="td1"><textarea rows="7" name="viewer" cols="60" class="textarea" readonly></textarea>
	      <input type=hidden name="input_GDQXBZ" value="">
	      <input type=hidden name="input_GDQX" value="0">
	    </td>
	  </tr>
	  <tr>
	    <td width="100" class="td1" align="right" valign="_top"><font COLOR="RED">*</font> 管理权限:
	      <img src="../images/selectman.gif" border="0" onclick="doSel_Gl(eventfrm1.input_GLQX.value,eventfrm1.input_GLQXBZ.value)" style="cursor:hand">
	    </td>
	    <td class="td1"><textarea rows="7" name="manager" cols="60" class="textarea" readonly></textarea>
	      <input type=hidden name="input_GLQXBZ" value="2">
	      <input type=hidden name="input_GLQX" value="0">
	    </td>
	  </tr>
	  <tr>
	    <td width="100" class="td1" align="right" valign="_top"><font COLOR="RED">*</font> 目录修改权限:</td>
	    <td class="td1"><input type="radio" name="input_SCQXBZ" value="1" <%if sjflh="0" then response.write "disabled"%>>允许管理者删除和修改该目录
	      <input type="radio" name="input_SCQXBZ" value="0" checked>不允许管理者删除和修改该目录
	    </td>
	  </tr>
	  <tr>
	    <td width="100" class="td1" align="right" valign="top">备注:</td>
	    <td class="td1"><textarea rows="3" name="input_LMZS" cols="60" class="textarea"></textarea></td>
	  </tr>
	  <tr>
	    <td class="tdBottom" colspan="2"></td>
	  </tr>
          <tr>
            <td class="td1" width="100%" colspan="2" align="center">
             <input type="submit" value="确定" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1">
             <input type="reset" value="全部重写" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1">
             <input type="reset" value="返回" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="javascript:history.go(-1);">
            </td>
          </tr>
	</table>
    </form>
    
    </td>
  </tr>
  <tr>
    <td width="25%" class="tdBottom">
    </td>
  </tr>
</table>
</div>
</body>

</html>

<%'释放对象变量
oConn.close
%> 

⌨️ 快捷键说明

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