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

📄 disp.asp

📁 Lirong网络办公系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%response.expires=0%>
<!-- #include file="../conn_lr.asp"-->
<%
oabusyname=session("oabusyname")
oabusyusername=session("oabusyusername")
oabusyuserdept=session("oabusyuserdept")
oabusyuserlevel=session("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='../../default.asp';")
	response.write("</script>")
	response.end
end if
%>
<%  
	href="disp.asp"  
	 
	Dim mTable,mBack
	Dim Item
	Dim mRecordCount, mFieldCount
	Dim mCond, mSortBy, mQueryString
	Dim mExcludeFieldTypes
	Dim mFieldType, mFieldContent
	Dim mPageSize, mPageCount, mPageNo
	Dim i, j , FieldsInfo()
	Dim LinkFlag,LinkItem(),LinkItemLink()
	Dim ReCount                                '是否重新计算查询语句
	
	

	
	IF Request("LinkFlag").count<>0 and Request("mTable").count<>0 THEN 


		LinkFlag=Request("LinkFlag")                ' 权限标志     "000000":"","","","详情","修改","删除"
		mTable =Request("mTable")                   ' 数据表名称
		addnew=Request("EnabledAddNew")             ' 是否允许增加记录
		mFiledsCount=CINT(Request("mFiledsCount"))	' 要显示的字段数目
		mFileds=Request("mFileds")          		' 要显示的字段列表
		mFiledsCaptions=Request("mFiledsCaptions")	' 要显示的标题列表
		mFiledsWidths=Request("mFiledsWidths")   	' 要显示的字段宽度列表
		DispFile=Request("DispFile")                ' 详细信息显示文件
		EditFile=Request("EditFile")                ' 编辑信息的文件
		DelFile=Request("DelFile")                ' 编辑信息的文件
		mCond2 = Request("mCond2")                  ' 基本查询条件
		mSortBy2=Request("mSortBy2")                ' 排序的字段
		mTitle = Request("mTitle")                  ' 页面标题
		mImage=Request("mImage")                    ' 标题图标
		EnableDelAll=Request("EnabledDelAll")        ' 清空标志"yes"允许   "no" 不允许
		mBack=Request("mBack")
		mBackImage=Request("mBackImage")

		ReCount=1
		Session("LinkFlag")=LinkFlag
		Session("mTable")=mTable
		Session("addnew")=addnew
		Session("mFiledsCount")=mFiledsCount
		Session("mFileds")=mFileds
		Session("mFiledsCaptions")=mFiledsCaptions
		Session("mFiledsWidths")=mFiledsWidths
		Session("DispFile")=DispFile
		Session("EditFile")=EditFile
		Session("DelFile")=DelFile
		Session("mCond")=""
		Session("mSortBy")=""
		Session("mCond2")=mCond2
		Session("mSortBy2")=mSortBy2
		Session("EnableDelAll")=EnableDelAll
		Session("mTitle")=mTitle
		Session("mImage")=mImage
		Session("mBack")=mBack
		Session("mBackImage")=mBackImage
	ELSE
		ReCount=0
		mImage=Session("mImage")
		mBackImage=Session("mBackImage")
		mTitle=Session("mTitle")
		LinkFlag=Session("LinkFlag")
		mTable=Session("mTable")
		addnew=Session("addnew")
		mFiledsCount=Session("mFiledsCount")
		mFileds=Session("mFileds")
		mFiledsCaptions=Session("mFiledsCaptions")
		mFiledsWidths=Session("mFiledsWidths")
		EditFile=Session("EditFile")
		DispFile=Session("DispFile")
		DelFile=Session("DelFile")
		EnableDelAll=Session("EnableDelAll")
		mCond2=Session("mCond2")
		mSortBy2=Session("mSortBy2")
		mBack=Session("mBack")
	END IF
	
	title=mTitle
	image=mImage
	
	Redim LinkItem(len(LinkFlag)),LinkItemLink(len(LinkFlag))
	
	Redim FieldsInfo(3,mFiledsCount)
		 	
		t2=1
		t4=1
		t6=1
		For i=1 to mFiledsCount
			t1=instr(t2,mFiledsWidths,",")
			t3=instr(t4,mFileds,",")
			t5=instr(t6,mFiledsCaptions,",")
			temp1=mid(mFiledsWidths,t2,t1-t2)
			temp2=mid(mFileds,t4,t3-t4)
			temp3=mid(mFiledsCaptions,t6,t5-t6)
			t2=t1+1
			t4=t3+1
			t6=t5+1	
			FieldsInfo(1,i)=temp1
			FieldsInfo(2,i)=replace(temp2,"^",",")
			FieldsInfo(3,i)=temp3
		Next
	

	
	mCond = replace(Request("key"),"'","’") & " LIKE '%" & replace(trim(Request("keyword")),"'","’") & "%'"
	if Request("key") <>"" then 
		Session("mCond")=mCond
	ELSE
		mCond=Session("mCond")
	END IF	
	
	
	mSortBy =Request("mSortBy")

	if Request("mSortBy") <>"" then 
		if Session("Forward")="ASC" then Session("Forward")="DESC" else Session("Forward")="ASC"
		Session("mSortBy")=mSortBy
	ELSE
		mSortBy=Session("mSortBy")
	END IF	
	
   
	'/////////////////////处理连接标志////////////////////////////////////////
	dim LinkImage(7)
	LinkImage(4)="file"
	LinkImage(5)="edit"
	LinkImage(6)="dele"
	LinkImage(7)="back"
	
	LinkItem(4)="详细"
	LinkItemLink(4)= DispFile & "?opFlag=cmdSee"
	LinkItem(5)="修改"
	LinkItemLink(5)= EditFile & "?opFlag=cmdEdit"
	LinkItem(6)="删除"
	if DelFile="" then DelFile=href
	LinkItemLink(6)= DelFile & "?opFlag=cmdDel"
	if len(linkflag)>6 then 
		LinkItem(7)="归还"
		LinkItemLink(7)= DispFile & "?opFlag=cmdBack"		
 	end if
	IF ReCount THEN  
   
	'/////////////////////开始计算SQL查询字符串////////////////////////////////////////
			dim t
			t=split(mTable,",")
			temp=replace(mFileds & t(0) & ".ID as tempID","^",",")
			temp=replace(temp,"~","""")
			mQueryString = "SELECT  " & temp & " from " & mTable
		   
		Session("mQueryString")=mQueryString
	ELSE
		mQueryString=Session("mQueryString")
	END IF
	'/////////////////////计算SQL查询字符串结束/////////////////////////////////////////

	'/////////////////////处理查询条件/////////////////////////////
	if mCond<>"" and mCond2<>"" then 
		Cond=" where "+mCond+ " and " +mCond2 
	elseif  mCond+mCond2="" then
		Cond=""
	else
		Cond=" where "+mCond+mCond2 
	end if	

	'///////////////////////处理排序条件///////////////////////////////
	if mSortBy<>"" and mSortBy2<>"" then 
		SortBy=" ORDER BY "+mSortBy+","+mSortBy2 
	elseif  mSortBy+mSortBy2="" then
		SortBy=""
	else 
		SortBy=" ORDER BY "+mSortBy+mSortBy2 
	end if
	
	if mSortBy<>""  then SortBy=" ORDER BY " + mSortBy + "  " + Session("Forward")
	
	
	
 	mQueryString= mQueryString  & Cond & SortBy
	Session("SQLFULL")=mQueryString
	Session("SQL")="select * from " & mTable  & Cond & SortBy 
	mPageSize = Session("iPageSize")
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.PageSize=mPageSize

	Rs.Open mQueryString,Session("conn"),1,3

   	mPageCount=Rs.PageCount
	mFieldCount=Rs.Fields.count-1

	Select case Request("opFlag")
	'//////////////////////执行删除操作////////////////////////////////////////
	   	case "cmdDel"
			Rs.close
			Rs.open Session("SQL"),Session("conn"),1,3
		   	Rs.move CINT(Request("Number"))
		   	Rs.delete
		   	Rs.update
			Rs.Close
			
			Rs.Open mQueryString,Session("conn"),1,3
		
			mPageCount=Rs.PageCount
			'mFieldCount=Rs.Fields.count-1
			
	'//////////////////////执行清空操作////////////////////////////////////////
	   	case "cmdDelAll"
			Session("conn").execute "delete from "  & mTable  & Cond
			Rs.Close
			
			Rs.Open mQueryString,Session("conn"),1,3
		
			mPageCount=Rs.PageCount
			
		case "cmdExportExcel"
			
			Response.AddHeader "content-disposition","inline; filename=" & mtitle &  ".csv"
			
			Response.ContentType = "*/*.csv" 
							
			For i=1 to  mFiledsCount
				 if FieldsInfo(1,i)<>"0" then  
					Response.write(FieldsInfo(3,i))
					Response.write(",") 
				end if
			Next
			
			Response.write(chr(13)+chr(10))
			
			Do While Not Rs.EOF
				For i = 0 to mFieldCount-1 
				if FieldsInfo(1,i+1)<>"0" then  
					Response.write(Rs.Fields(i))
					Response.write(",") 
				end if
				Next
				Response.write(chr(13)+chr(10))
				Rs.MoveNext
			Loop
			Rs.Close
			Set Rs = Nothing
			Response.end
		'//////////////////////执行打印操作////////////////////////////////////////
	   	case "cmdPrint"
 
			rs.PageSize=25
			For pn=1 to rs.PageCount
				Response.Write("<TITLE>" & mTitle & "</TITLE><style>table{border:solid windowtext .5pt;border-right:none;border-bottom:none;}td{border:solid windowtext .5pt;border-left:none;border-top:none;mso-border-left-alt:solid windowtext .5pt;padding:0mm 5.4pt 0mm 5.4pt }</style><body  style='font-size:10pt'><p align=center style='font-size:14pt;font-family:黑体;background:none'>" & mTitle & "</p><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=100% bgcolor='#000000' align=center style='font-size:10pt' >")
				Response.Write("<TR bgcolor='#ffffff' height=30 align=center >")
				
				'输出列标题
				For i=1 to  mFiledsCount
					if FieldsInfo(1,i)<>"0" then  
						Response.write("<TD ")
						if FieldsInfo(1,i)<>"" then Response.write("width=" & FieldsInfo(1,i))
						Response.Write("><b>" & FieldsInfo(3,i) & "</b></TD>")
					END IF
				Next
				
				Response.write("</TR>")
				'Response.end
				
				'///////////////////遍历数据记录集,输出数据表///////////////////////// 
				j= rs.PageSize
				Do While Not Rs.EOF and j>0
					 '///////////////////////行开输出始///////////////////////////
					Response.write("<TR  bgcolor=#ffffff  height=30 >")

⌨️ 快捷键说明

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