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

📄 editmodel.asp

📁 Lirong网络办公系统
💻 ASP
字号:
<%response.expires=0%>
<%Response.Buffer=true%>
<!-- #include file="../conn_lr.asp"-->
<!-- #include file="../css.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
%>
<html>
<head>
<title>文档模板编辑</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<!-- #include file="../inc/css.asp" -->
<link rel="stylesheet" href="../editor/editor.asp" type="text/css">
<%	'定义变量
	dim Number,opFlag,title,i,image
	
	'过滤错误
	on error resume next
	
	'获取输入参数:和操作标志
	opFlag=request("opFlag")
	Number=cint(request("Number"))
	
	'创建记录访问对象
	Set rs = Server.CreateObject("ADODB.Recordset")

	'打开记录源,并定位到输入参数决定的记录号	
	if opFlag="cmdEdit" then
		rs.Open Session("SQL"),Session("conn"),1,3
		rs.Move Number 
	end if
	if request("cmd")="save" then
		if opFlag="cmdAddNew" then 
		  rs.open "select * from model  where vname='" & request("vname") & "'",Session("conn"),1,3
			if rs.eof then
			  rs.addnew 
			else 
		  	response.write("<script language=javascript>window.alert('您所输入的模板名称已经存在,请输入其他名称!');window.history.back()</script>")
		  	response.end
			end if
		end if
	    for i=0 to rs.Fields.count-1 
		if Request.Form(rs.Fields(i).name)<>"" then
			rs(rs.Fields(i).name)=Request.Form(rs.Fields(i).name)
		end if
		next 
		rs.Update
		rs.close
		response.redirect "model.asp"

	end if
	title="档案模板编辑"
	image="../images/document.gif"
%>
<style>
.css0 {<%=Session("vinputtext")%>}
</style>
<script language="JavaScript">

//读取表内字符串信息
function ds(sstr)
{
 var dstr="";
 
 for (i=0;i<sstr.length;i++)
 {   if (sstr.charAt(i)!=' ') dstr+=sstr.charAt(i);
 }
 return dstr;
}
function oninput()
{
var aa;
 aa=Composition.document.body.innerHTML;
 document.submitinput.vtext.value=aa;
 if(!MM_validateForm('vname','','R','vtitle','','R','vtext','','R'))return false;
 rphtml('vname','vtitle');
//提交表单内容
 document.submitinput.submit();
}

function writeit()
{
 Composition.document.body.innerHTML=document.t.texta.value;

}
function load()
{
javascript:InitDocument();writeit();

//聚焦到模板名称
document.submitinput.vname.focus();
}

</script>
</head>
<body   leftmargin="0" topmargin="0" onLoad="load();" >
<form  name="submitinput" action="editmodel.asp?Number=<%=Number%>&opFlag=<%=opFlag%>&cmd=save" method="post" onSubmit="MM_validateForm();return document.MM_returnValue" >
    <!-- #include file="../inc/title.asp" -->
    <table border="0" class=vtext cellspacing="1" align="center" width="95%" bgcolor="<%=session("vtablebordercolor")%>" >
        <tr align="left"  bgcolor="<%=Session("vtabletitlebackcolor")%>"> 
            <td height="30" width="14%" align="right">模板名称:</td>
            <td height="30" width="86%"   bgcolor="<%=Session("vcolcolor")%>"> 
                <input type="text" name="vname" value="<%=rs("vname")%>" style="width:100%;border:no" onKeyDown=gonext("vtitle") maxlength="50">
                <input type="hidden" name="vtext">
            </td>
        </tr>
        <tr align="left"  bgcolor="<%=Session("vtabletitlebackcolor")%>"> 
            <td height="30" width="14%" align="right">模板描述:</td>
            <td height="30" width="86%"   bgcolor="<%=Session("vcolcolor")%>"> 
                <input type="text" name="vtitle" value="<%=rs("vtitle")%>" onKeyDown=gonext("Composition")  style="width:100%;border:no" maxlength="200">
            </td>
        </tr>
        <tr align="left"  bgcolor="<%=Session("vtabletitlebackcolor")%>"> 
            <td colspan="2"> 
                <!-- #include file="../editor/edit.html" -->
            </td>
        </tr>
    </table>
    <p align=center> <button class=vinputbutton  style="height=24"  onClick="oninput();"><img src="../images/save.gif" align="absmiddle">&nbsp;保存</button>&nbsp; 
        <button class=vinputbutton  style="height=24"  onClick=javascript:history.go(-2);><img src="../images/back.gif" align="absmiddle">&nbsp;返回</button> 
    </p>
    
</form>
<form name=t style="display:none">
    <textarea name=texta style="visibility: hidden" rows=1 cols=1><%=rs("vtext")%></textarea>
</form>
<% '关闭记录源
   rs.close
   set rs=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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