writetz.asp
来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 239 行
ASP
239 行
<%
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<!--#include file="../../Connections/leq.asp" -->
<%
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<%
Dim o
Dim o_numRows
Set o = Server.CreateObject("ADODB.Recordset")
o.ActiveConnection = MM_oavbsconn_STRING
o.Source = "SELECT 存为草稿否,附件重名设置 FROM submitadnfilwefoadmin WHERE 操作名称='通知'"
o.CursorType = 0
o.CursorLocation = 2
o.LockType = 1
o.Open()
o_numRows = 0
%>
<html>
<head>
<script language="JavaScript">
<!--
function dis()
{
document.globe.submit1.value=' 发布..'
document.globe.submit1.disabled=true;
return true;
}
function check() {
if (document.globe.标题.value=="") {
window.alert ("请您输入标题 !")
document.globe.标题.focus()
return false
}
if (document.globe.标题.value.length<2) {
window.alert ("标题需要2位或2位以上字符 !")
document.globe.标题.focus()
return false
}
if (document.globe.标题.value.length>30) {
window.alert ("标题需要30位以内字符 !")
document.globe.标题.focus()
return false
}
return true
}
//-->
</SCRIPT>
<script language="JavaScript" src="js/swfj.js"></script>
<script language="JavaScript" src="js/fawen.js"></script>
<script language=javascript>
var upfj;
upfj=0; //上传附件没有错误
//--------------------------------send fujian file------------------------------
function sendfj(fileid){
var NameUrl="<%=NameUrl%>" //保存公文文件url路径
var FjUrl="<%=FjUrl%>" //保存附件文件url路径
var FjDelUrl="<%=FjDelUrl%>" //上传失败删除临时文件
var MaxSize="<%=session("MaxSize")%>" //限制上传附件文件的大小
var fileform = document.submitinput;
PsoPath=fileform.elements[fileid].value
//PsoPath=document.submitinput.filefj0.value
PsoFile=PsoPath //定义附件的文件名
PsoType=""
while(PsoFile.indexOf("\\")>0) //获得附件的文件名
{
i = PsoFile.indexOf("\\")
PsoFile = PsoFile.substring(i + 1, PsoFile.length);
} //获得附件的文件名
PsoPath=PsoPath.substring(0,PsoPath.lastIndexOf("\\")) //获得附件的路径
PsoType=PsoFile
if (PsoType.lastIndexOf(".")>0) //获得附件的扩展名
{
i = PsoType.lastIndexOf(".")
PsoType = PsoType.substring(i + 1, PsoType.length);
}
result=form.web.upload(FjUrl,PsoFile,PsoPath,MaxSize) //向服务器上传附件
//document.submitinput.fujian.value=PsoFile
if (!result)
{
result=form.web.sendurl(FjDelUrl,"",""); //删除前面上传的临时文件
alert("上传附件失败或附件不存在!");
fileform.elements[fileid].focus();
upfj=1;
return false; //上传附件失败,返回起草公文页面
}
else{
result=form.web.sendurl(NameUrl,PsoFile,PsoType)
}
}
//------------------end function-------------------------------------------------------
function checkform() {
upfj=0;
//-------发送附件
var fileform = document.submitinput; //调用上传附件函数
for ( var i= 0 ; i <fileform.elements.length ; i ++ ) {
if ( fileform.elements[i].type == "file" && fileform.elements[i].name !="file" ) {
if (fileform.elements[i].value!="") {
sendfj(i);
if(upfj==1) return false;
}
}
}//for
//--------发送附件
document.submitinput.submit()
return false;
}
</script>
<title>撰写通知</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<link href="../../css/link.css" rel="stylesheet" type="text/css">
<link href=../../css/input.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
color: #CC6633;
font-weight: bold;
}
.style13 {color: #75828e}
-->
</style>
</head>
<body>
<div align="center">
<form action="writepost.asp" method="POST" enctype="multipart/form-data" name="globe" onSubmit="return dis()">
<div align="center">
<center>
<table width="760" height="21" border="0" cellpadding="0" cellspacing="0" background="../../img/bw/line.gif">
<tr>
<td><div align="center" class="style1"><span class="style1 style2"><span class="style1">发 布 通 知</span></span></div></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="1" bgcolor="#5AAE18">
<tr>
<td bgcolor="#FFFFFF"><table width="99%" border="0" cellpadding="2" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td colspan="2"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="11" colspan="2"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="90" height="25"> 标 题:</td>
<td width="660" bgcolor="#FFFFFF"><input name="标题" type="text" id="标题" size="50" maxlength="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left"><br>
<table width="11" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> 内 容:</td>
</tr>
<tr>
<td><img src="img/gif/77.gif" width="70" height="54"></td>
</tr>
</table>
</div></td>
<td bgcolor="#FFFFFF"><input name="content" type="hidden" id="content">
<iframe ID="content" src="../htmledit/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="580" HEIGHT="380"></iframe>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="8" colspan="2"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td bgcolor="#FFFFFF"><span id="idfilespan"></span><a href="javascript:;" name="attach" id="attach" onclick="add();this.childNodes[0].nodeValue='添加附件';" title="如果您要发送多个附件">添加附件</a></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td bgcolor="#FFFFFF"><span class="style13">存为草稿,暂不发送:</span>
<input <%If (CStr((o.Fields.Item("存为草稿否").Value)) = CStr("否")) Then Response.Write("checked") : Response.Write("")%> name="开关" type="checkbox" id="开关" value="否">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input name="信息属性" type="hidden" id="信息属性" value="通知">
<input name="发送人帐号" type="hidden" id="发送人帐号" value="<%= Session("userssdfgfhtrh") %>">
<input name="发送人姓名" type="hidden" id="发送人姓名" value="<%= Session("names") %>">
<input name="datas" type="hidden" id="datas" value="<%=date%>"></td>
<td bgcolor="#FFFFFF">
<input name="submit1" type=submit id="submit1" style="FONT-SIZE: 12px; HEIGHT: 27px" value= " 发 布 " onclick="return check()">
<input name="重置" type=reset style="FONT-SIZE: 12px; HEIGHT: 27px" value= " 重 填 " >
<input name="按钮" type=button style="FONT-SIZE: 12px; HEIGHT: 27px" onClick="javascript:history.go(-1)" value= " 取 消 " >
</tr>
<tr bgcolor="#FFFFFF">
<td height="12" colspan="2"></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
</center>
</div>
</form>
</div>
</body>
</html>
<%
o.Close()
Set o = Nothing
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?