📄 edit.asp
字号:
<%option explicit%>
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
%>
<!-- #include virtual="Include/DataEnvi.asp"-->
<!-- #include virtual="Include/String.asp"-->
<!-- #include virtual="include/GetAttachsString.asp" -->
<%
Dim ObjDB,ObjRS,StrSQL
Dim C
Dim IntID
if session("AccountID")="" then
%>
<script language=javascript>
alert("因登录时间过长,会话失效,请退出重新登陆!")
</script>
<%
Response.End
end if
IntID = Request.QueryString("ID")
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
StrSQL = "Select * From t_OA_Work_Document where ID=" & IntID
Set C = Server.CreateObject ("CMS2003.DBHandle")
C.Init (ObjDB)
Set ObjRS = C.View (StrSQL)
If Request.Form.Count > 0 Then
Call C.Edit(IntID,"_","t_OA_Work_Document")
%>
<script language=javascript>
parent.doList()
</script>
<%
End If
' ObjDB.Close
' Set ObjDB = Nothing
%>
<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>
<%If ObjRS.Count > 0 then %>
<script language=javascript>
var isSetOK = false
function setIsHTML(t){
TBody1.style.display = "none"
TBody2.style.display = "none"
if(t==0)TBody1.style.display = ""
if(t==1)TBody2.style.display = ""
}
function doSubmit(fm){
ChangeBody()
//alert(12)
}
function EditAttach(){
var r =window.showModalDialog("../../Attach/Index.asp?IDs=" + document.forms[0]._Attachs.value + "&BasePath=ComMessage&R=" + Math.random(),"AttachWin","dialogHeight=240px,dialogWidth=420px,resizable=No,status=1,scrollbars=1");
if(r!=null){
ReturnAttachs(r)
}
}
function ReturnAttachs(v){
document.forms[0].AttachsShow.value = v[0]
document.forms[0]._Attachs.value = v[1]
}
</script>
<table class=Ltable cellspacing=1 cellpadding=3 height=94%>
<tr class=LHtr>
<td width=15%>修改文档</td>
<td width=85%></td>
</tr>
<form action="" onsubmit="doSubmit(this)" method="post" id=form1 name=form1>
<input value="" type=hidden name="_Body">
<tr class=Ltr>
<td>文档标题</td>
<td><input type="text" class=Input Check=1 Show="文档标题" name="_Title" value="<%=ObjRS("Title")%>"></td>
</tr>
<tr class=Ltr>
<td>附件</td>
<td><input name=_Attachs type=hidden value="<%=ObjRS("Attachs")%>" class=Input><input name=AttachsShow disabled class=Input value="<%=GetAttachsString(ObjDB,ObjRS("Attachs"))%>"><input type=button value="编辑附件" class=button onclick="EditAttach()" id=button3 name=button3>
</td>
</tr>
<tr class=Ltr>
<td>更新时间</td>
<td><input type="text" class=Input onclick="InputDate(this)" readonly name="_UpdateTime" value=<%=Date()%>></td>
</tr>
<tr class=Ltr>
<td>模板格式:</td>
<td><input type=radio name=isHtml value="0" <%If Not ObjRS("IsHTML") Then Response.Write " checked "%> onclick=setIsHTML(0)>普通文本<input type=radio <%If ObjRS("IsHTML") Then Response.Write " checked "%> name=isHtml value="1" onclick=setIsHTML(1)>多格式</td>
</tr>
<tr class=Ltr id=TBody1 height=100%>
<td>内容:</td>
<td><textarea name="Body1" style="width=100%;height=100%" class=textbody><%=ObjRS("Body")%></textarea></td>
</tr>
<tr class=Ltr id=TBody2 height=100%>
<td>内容:</td>
<td><iframe src="../../../Include/HTMLEditor.asp" class=textbody1 style="width=100%;height=100%" frameborder=0 id=frameEdit></iframe></td>
</tr>
<tr>
<td><input type="hidden" class=Input name="_UpdateAccountID" value=<%=session("AccountID")%>></td>
</tr>
</table>
<table cellspacing=1 cellpadding=3>
<tr>
<td><input type="submit" class=Button value="提 交" id=submit1 name=submit1><input type="button" class=Button value="取 消"onclick="doBack()" id=button1 name=button1>
</tr>
</form>
</table>
<%
If ObjRS("IsHTML") Then
%>
<script language=javascript>
function CheckIsLoadOK(){
if(frameEdit.IsLoadOK&&(!isSetOK)){
frameEdit.setHTML("<%=Replace(ObjRS("Body"),Chr(34),"\"&Chr(34))%>")
isSetOK = true
}
setTimeout("CheckIsLoadOK()",500)
}
function ChangeBody(){
var tmpHTML = frameEdit.getHTML()
document.forms[0]._Body.value = tmpHTML;
}
CheckIsLoadOK()
TBody1.style.display = "none"
</script>
<%
Else
%>
<script language=javascript>
function ChangeBody(){
document.forms[0]._Body.value = document.forms[0].Body1.value;
}
TBody2.style.display = "none"
</script>
<%
End If
%>
<%end if%>
<%'------------------------------------------------------------------%>
<%End Sub%>
<%'==================================================================%>
<!-- #include file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -