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

📄 edit.asp

📁 具有计划、任务、通告、公文、员工档案、等网络办公功能
💻 ASP
字号:

<%@Language=vbscript.encode%>

<%	'////////////////////////////////////////////////////////////////
	'/////文 件 名:/offiche/disp.asp
	'/////程序名称:立人信息系统-显示公告信息
	'/////所属模块:公告信息
	'/////逻辑结构:略
	'/////创建日期:2002-6-7
	'/////创 建 人:罗向东

        Option Explicit
%>
<html>
<head>

<meta http-equiv=Content-Type content="text/html; charset=gb2312">
 <!-- #include file="../inc/css.asp" -->

<%
	'定义变量
	dim Number,opFlag,title,image,i,addtemp,mFiledsCount
	on error resume next
	addtemp=0
	'获取输入参数:记录号和操作标志
	Number=request("Number")
	if Number="" then Number="0"
	Number=Cint(Number)
	opFlag=request("opFlag")
	
	'创建记录访问对象
	Set rs = Server.CreateObject("ADODB.Recordset")
	
	'初始化参数

	'打开记录源,并定位到输入参数决定的记录号
	rs.Open Session("SQLFULL"),Session("conn"),1,3
	if rs.eof then 
		rs.addnew
		addtemp=1
	end if
	
	rs.move Number
	if Number=rs.recordcount then rs.movelast

	image=Session("mImage")
	title=Session("mTitle")
	dim FieldsInfo,t2,t4,t6,t1,t3,t5,temp1,temp2,temp3
	Redim FieldsInfo(3,Session("mFiledsCount"))
		 	
		t2=1
		t4=1
		t6=1
		For i=1 to Session("mFiledsCount")
			t1=instr(t2,Session("mFiledsWidths"),",")
			t3=instr(t4,Session("mFileds"),",")
			t5=instr(t6,Session("mFiledsCaptions"),",")
			temp1=mid(Session("mFiledsWidths"),t2,t1-t2)
			temp2=mid(Session("mFileds"),t4,t3-t4)
			temp3=mid(Session("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
		dim list1,list2
		
		list1="'" & replace(Session("mFileds"),",","','")
		list1=left(list1,len(list1)-2)
		
		list2=""
		
		mFiledsCount=rs.Fields.count-1
		
		For i=1 to mFiledsCount
		if instr(FieldsInfo(2,i)," ")<=0 then
			if rs(i-1).Type>200 then
				list2=list2 & "'" & FieldsInfo(2,i) & "','','R',"
			else
				list2=list2 & "'" & FieldsInfo(2,i) & "','','RisNum',"
			end if
		end if
		next
		list2=left(list2,len(list2)-1)
		
			

		
		
%>
</head>
<script language=javascript>
function OnInput(n)
{
	//'rphtml(<%=list1%>);
	if(n==2)
	{
	submitinput.action="save.asp?opFlag=cmdAddNew&Number=<%=Number%>&id=<%=rs("tempid")%>"
	}
	//if(MM_validateForm(<%=list2%>))
	document.all.submitinput.submit();
}
	

</script>
<body scroll=yes   id=all>
<form name="submitinput" method="post" action="save.asp?opFlag=<%=opFlag%>&Number=<%=Number%>&id=<%=rs("tempid")%>">
<!-- #include file="../inc/title.asp" -->

<table align="center" width="95%" cellpadding="0" border="0" cellspacing="1"  bgcolor="<%=session("vtablebordercolor")%>">
   <%
   for i=0 to mFiledsCount-1%>
		<tr  valign="top" class=vtext> 
		  <td   width="20%" valign="middle"  bgcolor=<%=Session("vtabletitlebackcolor")%>  height="25" align="right" >
		  <b><%=FieldsInfo(3,i+1)%></b>:</td>
			<td bgcolor="<%=Session("vcolcolor")%>"  width="80%">
			<%
			
			dim txxstr1,txxstr2
			select case opFlag
			case "cmdAddNew"  
				txxstr1=""
				if instr(FieldsInfo(2,i+1)," ")>0 then txxstr1=txxstr1+ " readonly "

				txxstr2=" >"
			case "cmdEdit"
			
				txxstr1=" value='" & rs(i).value  & "' "
				
				if instr(FieldsInfo(2,i+1)," ")>0 then txxstr1=txxstr1+ " readonly "
				
				txxstr2=" >" & rs(i).value 
			
			case else
				txxstr1=" value='" & rs(i).value & "' readonly "
				txxstr2=" readonly>" & rs(i).value 
			end select
			
			
			if rs(i).DefinedSize<=255 then
				response.write "<input name='"& rs(i).name &"'  id='"& FieldsInfo(3,i+1) &"' type=text maxlength='" & rs(i).DefinedSize  & "'  style='width=100%;border:none' " & txxstr1 & "   >"
			else
				response.write "<textarea name='"& rs(i).name &"'  id='"& FieldsInfo(3,i+1) &"' rows='8' style='width:100%;border:none'  " & txxstr2 & "</textarea>"
			end if
			
				'	response.write replace(rs(i).value,chr(13),"<br>") & "&nbsp;"
			%>
			</td>
		</tr>
	<%next%>
  </table>
  
	<p align=center>
	<%if opFlag="cmdEdit" or opFlag="cmdAddNew" then%>

	<button class=vinputbutton  style="height=24"  onClick="javascript:OnInput(2);"><img src="images/save1.gif" align="absmiddle">&nbsp;另存为</button> 
	&nbsp;	<button class=vinputbutton  style="height=24"  onClick="javascript:OnInput(1);"><img src="images/save1.gif" align="absmiddle">&nbsp;保存</button> 
	&nbsp;<%end if%>
     <button class=vinputbutton  style="height=24"  onClick="javascript:history.go(-1);"><img src="images/back.gif" align="absmiddle">&nbsp;返回</button> 
    </p>
	
	</form>
</body>
</html>
<%
	if 	addtemp=1 then rs.delete
	rs.update
	rs.close
set rs=nothing
%>

⌨️ 快捷键说明

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