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

📄 add.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'==============================================================
'版本: 1.2.0 -- 2004-10-13
'程序版权:(c) 2004 by 展亮
'说明:本代码为自由代码,用户可以自由使用,但请保留作者文件头部说明
'   在使用过程中如出现什么问题请及时与作者联系。
'   电子邮件:zlbox@yeah.net QQ:2343397
'=============================================================
%>
<!--#include file="../inc/NoCatch.asp"-->
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!--#include file="./inc/flt.asp"-->
<!--#include file="./inc/Upload.asp"-->

<%
 Server.ScriptTimeout = 9999
'------------------------------------------------接收参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
FLH=request("flh") '类别ID
'------------------------------------------------

'------------------------------------------------添加文档
path = "./files/"'上传路径
set Upload = new DoteyUpload
Upload.ProgressID = Request.QueryString("ProgressID")
Upload.Upload() '上传文件
if upload.Form("subed")="add" then
'表单提交后

	'接受录入参数
  mFile_Man=upload.form("File_Man")	'归档人ID
  mFile_Date=upload.form("File_Date")  '归档日期
  mFile_Save=upload.form("File_Save")  '保存时间(天)
  mFile_Save=FormatDateTime(dateadd("d",mFile_Save,mFile_Date),2) '保存日期
  mFLH=upload.form("FLH")		'报表分类号
  mCXQXBZ=upload.form("input_CXQXBZ")	'报表查询权限标志
  mCXQX=upload.form("input_CXQX")	'报表查询权限
  Subject=upload.form("Subject")	'标题

	Randomize '初始化随机数生成器。
	For each File in Upload.Files.Items
		'保存文件
		filename=path & Int((99999999 * Rnd) + 1) & File.FileExt
		File.SaveAs filename

		'添加时使用的字段
		field1=array("FilePath","FLH","File_Man","File_Save","Filetype","Subject","CXQX","CXQXBZ")
		value1=array(filename,mFLH,LoginID,mFile_Save,File.FileExt,Subject,mCXQX,mCXQXBZ)

		for i=0 to ubound(field1)
			value1(i)=replace(value1(i),"'","''")
		next
		sql = "INSERT INTO tbioaDocument_File1 (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')"
		'response.write sql
		oConn.Execute sql
	Next

	response.write "<script>alert('文档添加成功!');history.go(-2)</script>"
	response.end
end if
%>

<html>
<head>
<title>公文办理</title>
<link rel='stylesheet' type='text/css' href='../css/main.css'>
<script src="../js/iweboffice_func.js" type="text/javascript"></script>
<script src="../js/front_chec.js"></script>
<script language="javascript">
//检查是否必填
function require(form){
	if (checnull(form.Subject,"请填写当案标题!")&&
		checnull(form.FLH,"请填选择档案目录!")&&
		checnull(form.FLH,"请填选择档案目录!")&&
		checnull(form.viewer,"请设置档案查询权限!") &&
		checnull(form.File_Save,"请填写档案保存期限!")&&
		checnumber(form.File_Save,"档案保存期限必须为数字!")&&
		confirm('确定要归档该条公文吗?')) return ShowProgress(form); else return false;
}

function ShowProgress(form) {
	var ProgressID = (new Date()).getTime() % 1000000000;
	form.action = "?ProgressID=" + ProgressID;
	if (form.input_File.value != "") {
		var Ver = navigator.appVersion;
		if (Ver.indexOf("MSIE") > -1 && Ver.substr(Ver.indexOf("MSIE") + 5, 1) > 4) {
			window.showModelessDialog("./inc/Progress.asp?Count=0&ProgressID=" + ProgressID, null, "dialogWidth=340px; dialogHeight:150px; help:no; status:no");
		}
		else
		{
			window.open("./inc/Progress.asp?Count=0&ProgressID=" + ProgressID, "_blank", "left=240,top=240,width=340,height=140");
		}
		return true;
	}
}

function doSel_Cx(sCxqx,sCxqxsz){
	url = "../inc/SelectQx.asp?cxqx="+sCxqx+"&cxqxsz="+sCxqxsz
	k=showModalDialog(url,"","dialogWidth:510px;status:no;dialogHeight:60px")
	if (k!="") {
		k=k.split("_")
		if (k[0]!="0"){
			webform.viewer.value=k[2].replace(/ /g,"\n")
			webform.input_CXQX.value=k[1]
			webform.input_CXQXBZ.value=k[0]
		}else{
			webform.viewer.value='全部人员'
			webform.input_CXQX.value=k[1]
			webform.input_CXQXBZ.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;">文档管理->上传文档</div>
<table width="98%" class="tabletoolbar" border="0" cellspacing="1" cellpadding="0" align="center">
	<tr>
		<td align="left"><%call flt(FLH,"dir_list.asp")%></td>
	</tr>
</table>
<br>
<form name="webform" method="post" action="" onSubmit="return require(this);" enctype="multipart/form-data">
<input type="hidden" name="subed" value="add">
<table border=0 cellspacing='1' cellpadding='2' width=700 align=center class="tab">
  <tr>
    <td  align="right" class="tdBottom">文档标题:</td>
    <td  class="tdBottom"><input type="text" name="Subject" size="80" maxlength="150" class="input"></td>
  </tr>
  <tr>
    <td  align="right" class="tdBottom">下载文件:</td>
    <td  class="tdBottom"><input class="text" type="file" name="input_File" size="69" maxlength="150" class="input"></td>
  </tr>
  <tr>
    <td align=right class="tdBottom">类别目录:</td>
    <td class="tdBottom">
	<select id=FLH name=FLH>
		<%=pOptions2("tbioaDocument_Sort","LMMC",0,FLH,"","SJFLH")%>
	</select>
    </td>
  </tr>
  <tr>
    <td width="100" class="td1" align="right" valign="_top">查询权限:
      <img src="../images/selectman.gif" border="0" onclick="doSel_Cx(webform.input_CXQX.value,webform.input_CXQXBZ.value)" style="cursor:hand">
    </td>
    <td class="td1"><textarea rows="7" name="viewer" cols="80" class="textarea" readonly><%=viewer%></textarea>
      <input type=hidden name="input_CXQXBZ" value="1">
      <input type=hidden name="input_CXQX" value="<%=viewerid%>">
    </td>
  </tr>
  <tr>
    <td align=right class="tdBottom">归档人:</td>
    <td class="tdBottom">
    	<input type=text name="File_Man_Name" value="<%=session("realname")%>" class="inputreadonly" readonly>
    	<input type=hidden name="File_Man" value="<%=LoginID%>" class="inputreadonly" readonly>
    	归档时间:<input type=text name="File_Date" value="<%=now()%>" class="inputreadonly" readonly size="20" >
    	保存期限:<input type=text name="File_Save" value="365" class="input" size="5">天
    </td>
  </tr>
  <tr>
    <td  class="tdBottom" colspan=2 align=center>
	<input type="submit" value="归档" class="button0" onmouseout=className="button0" onmouseover=className="button1">
	<input type="button" value="返回" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="history.back()">
    </td>
  </tr>
</table>
</form>

</body>
</html>

<%'释放对象变量
<!--#include file="../inc/conn_close.asp"-->
%>

<%
Function pOptions2(TableName,Field,ParentID,Selected,Heads,ParentField)
'递归下拉菜单(表名,字段名,选中字段ID,起始字段ID,分割头,存放上级栏目ID的字段名)-----
	set rs_sort=Server.CreateObject("ADODB.RecordSet")
	sql="select * from "& TableName &" where "&ParentField&" = '"& ParentID &"' order by FLH"
	rs_sort.open sql,oConn,1,1
	while not rs_sort.EOF '循环
		if Selected="" then Selected="0"
		if Return_Sort_Manage(rs_sort("GDQXBZ"),rs_sort("FLH"),"GDQX",TableName) then
			if rs_sort("FLH")= Selected then
				response.write "<option value='"&rs_sort("FLH")&"' selected>"& Heads & rs_sort(Field)&"</option>" & vbcrlf
			else
				response.write "<option value='"&rs_sort("FLH")&"'>"& Heads & rs_sort(Field)&"</option>" & vbcrlf
			end if
		end if

		Call pOptions2(TableName,Field,rs_sort("FLH"),Selected,Heads&rs_sort(Field)&"/",ParentField)
	rs_sort.MoveNext: wend
	rs_sort.close
End Function

''''''''''''''''''''''返回当前用户是否有操作权限'''''''''''''''''''''
Function Return_Sort_Manage(managemod,ArchivesID,SField,STable)
''''''''''''''''''''''列表类型,id号,查找字段,查找表名
'返回用户是否有管理/查看权限
dim i
if ArchivesID<>"" and IsNumeric(ArchivesID) then
	select case managemod		'管理/查看列表类型  0:所有用户 1:部门2:职务
		case "0"
			Return_Sort_Manage=true
		case "1"
			TmpSQL="select "&SField&" from " & STable & " where FLH='"&ArchivesID&"'"	'取得管理/查看权限
			set TmpRS=Server.CreateObject("ADODB.RecordSet")
			TmpRS.open TmpSQL,oconn,1,1
			if TmpRS.eof then
				TmpRS=close
				set TmpRS=nothing
				Return_Sort_Manage=false
			else
				ManageStr=TmpRS(SField)
				TmpRS.close
				set TmpRS = nothing
				if len(ManageStr)>0 then
					if Instr(1,","&ManageStr&",",","&session("DepID")&",", 1)>0 then '判断管理/查看权限中是否包含有当前用户部门ID
						Return_Sort_Manage=true
					else
						Return_Sort_Manage=false
					end if
				else
					Return_Sort_Manage=false
				end if
			end if
		case "2"
			TmpSQL="select "&SField&" from " & STable & " where FLH='"&ArchivesID&"'"	'取得管理/查看权限
			set TmpRS=Server.CreateObject("ADODB.RecordSet")
			TmpRS.open TmpSQL,oconn,1,1
			if TmpRS.eof then
				Return_Sort_Manage=false
			else
				ManageStr=TmpRS(SField)
				TmpRS=close
				TmpSQL="select roleID from tbioaUser where id="&session("LoginID")	'取得当前用户职务
				set TmpRS=Server.CreateObject("ADODB.RecordSet")
				TmpRS.open TmpSQL,oconn,1,1
				if TmpRS.eof then
					TmpRS.close
					set TmpRS=nothing
					Return_Sort_Manage=false
				else
					RoleArr=split(TmpRS("RoleID"),",")
					TmpRS.close
					set TmpRS=nothing
					Return_Sort_ManageR=false
					for i=0 to UBound(RoleArr)
						if instr(1,","&ManageStr&",",","&RoleArr(i)&",")>0 then	'判断管理/查看权限中是否包含有当前用户职务
							Return_Sort_ManageR=true
						end if
					next
					Return_Sort_Manage=Return_Sort_ManageR
				end if
			end if
		case else
			Return_Sort_Manage=false
	end select
else
	Return_Sort_Manage=false
end if
end Function
'-----------------------------------------------------------
%> 

⌨️ 快捷键说明

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