📄 new.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>发布公告通知</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function CheckForm()
{
if(document.form1.TO_ID.value==""&&document.form1.PRIV_ID.value==""&&document.form1.COPY_TO_ID.value=="")
{ alert("请指定发布范围!");
return (false);
}
if(document.form1.SUBJECT.value=="")
{ alert("公告通知的标题不能为空!");
return (false);
}
if(document.form1.ATTACHMENT.value=="" && document.form1.FORMAT.value=="1")
{ alert("请选择MHT文件 !");
return (false);
}
if(document.form1.CONTENT.value=="" && document.form1.FORMAT.value=="0")
{ alert("公告通知的内容不能为空!");
return (false);
}
if (document.form1.ATTACHMENT.value!="")
{
var file_temp=document.form1.ATTACHMENT.value,file_name;
var Pos;
Pos=file_temp.lastIndexOf("\\");
file_name=file_temp.substring(Pos+1,file_temp.length);
document.form1.ATTACHMENT_NAME.value=file_name;
}
document.form1.OP.value="1";
return (true);
}
function sendForm(publish)
{
document.form1.CONTENT.value=EDIT_HTML.get_docHtml();
document.form1.PUBLISH.value=publish;
if(CheckForm())
document.form1.submit();
}
function clear_dept()
{
document.form1.TO_NAME.value="";
document.form1.TO_ID.value="";
}
function LoadWindow()
{
URL="/module/dept_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_priv()
{
document.form1.PRIV_ID.value="";
document.form1.PRIV_NAME.value="";
}
function LoadPrivWindow()
{
URL="/module/priv_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;
window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:250px;dialogHeight:300px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user2()
{
document.form1.COPY_TO_NAME.value="";
document.form1.COPY_TO_ID.value="";
}
function LoadWindow2()
{
URL="/module/user_select?ID=2";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
//window.open(URL,"read_notify","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes");
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function Load_Do()
{
EDIT_HTML.insertHtml(document.form1.CONTENT.value);
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
function upload_attach()
{
document.form1.CONTENT.value=EDIT_HTML.get_docHtml();
document.form1.PUBLISH.value="0";
if(CheckForm())
{
document.form1.OP.value="0";
document.form1.submit();
}
}
function delete_attach(ATTACHMENT_ID,ATTACHMENT_NAME)
{
msg="确定要删除文件 '"+ ATTACHMENT_NAME +"' 吗?";
if(window.confirm(msg))
{
URL="../delete_attach.php?NOTIFY_ID=<?=$NOTIFY_ID?>&ATTACHMENT_ID="+ATTACHMENT_ID+"&ATTACHMENT_NAME="+ATTACHMENT_NAME;
window.location=URL;
}
}
function changeFormat()
{
var obj=document.all("FORMAT");
if(!obj)
return;
if(obj.value=="1")
{
document.all("EDITOR").style.display="none";
document.all("ATTACH_LABEL").innerHTML="MHT文件(或附件):";
}
else
{
document.all("EDITOR").style.display="";
document.all("ATTACH_LABEL").innerHTML="附件:";
}
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span class="big3"> 新建公告通知</span>
</td>
</tr>
</table>
<table border="0" width="95%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form enctype="multipart/form-data" action="add.php" method="post" name="form1">
<tr>
<td nowrap class="TableData"> 格式:</td>
<td class="TableData">
<select name="FORMAT" class="BigSelect" onchange="changeFormat();">
<option value="0">普通格式</option>
<option value="1">MHT格式</option>
</select>
mht格式支持图文混排,Word文档可以直接另存为mht文件。
</td>
</tr>
<tr>
<td nowrap class="TableData"> 类型:</td>
<td class="TableData">
<select name="TYPE_ID" class="BigSelect">
<option value=""></option>
<?=code_list("NOTIFY","")?>
</select>
公告通知类型可在“系统管理”->“系统代码设置”模块设置。
</td>
</tr>
<tr>
<td nowrap class="TableData">发布范围(部门):</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="<?=$TO_ID?>">
<textarea cols=40 name=TO_NAME rows=2 class="BigStatic" wrap="yes" readonly><?=$TO_NAME?></textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow()" title="添加部门" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept()" title="清空部门" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">发布范围(角色):</td>
<td class="TableData">
<input type="hidden" name="PRIV_ID" value="">
<textarea cols=40 name="PRIV_NAME" rows=2 class="BigStatic" wrap="yes" readonly></textarea>
<input type="button" value="选 择" class="SmallButton" onClick="LoadPrivWindow()" title="选择角色" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_priv()" title="清空角色" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">发布范围(人员)</td>
<td class="TableData">
<input type="hidden" name="COPY_TO_ID" value="">
<textarea cols=40 name="COPY_TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly></textarea>
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择人员" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user2()" title="清空人员" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData"> 标题:</td>
<td class="TableData">
<input type="text" name="SUBJECT" size="40" maxlength="200" class="BigInput" value="<?=$SUBJECT?>">
</td>
</tr>
<tr>
<td nowrap class="TableData"> 有效期:</td>
<td class="TableData">
生效日期:<input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigInput" value="<?=$BEGIN_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.BEGIN_DATE');">
为空为立即生效<br>
终止日期:<input type="text" name="END_DATE" size="10" maxlength="10" class="BigInput" value="<?=$END_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.END_DATE');">
为空为手动终止
</td>
</tr>
<tr>
<td nowrap class="TableData"><span id="ATTACH_LABEL">附件:</span></td>
<td class="TableData">
<input type="file" name="ATTACHMENT" size="30" class="BigInput" title="选择附件文件">
<input type="button" class="BigButton" value="上传文件" onclick="upload_attach();">
<input type="hidden" name="ATTACHMENT_ID_OLD" value="<?=$ATTACHMENT_ID?>">
<input type="hidden" name="ATTACHMENT_NAME_OLD" value="<?=$ATTACHMENT_NAME?>">
</td>
</tr>
<tr>
<td nowrap class="TableData"> 附件权限:</td>
<td class="TableData">
<input type="checkbox" name="PRINT" id="PRINT" checked><label for="PRINT">允许下载、打印附件</label>
</td>
</tr>
<tr>
<td nowrap class="TableData"> 提醒:</td>
<td class="TableData">
<input type="checkbox" name="SMS_REMIND" id="SMS_REMIND" checked><label for="SMS_REMIND">使用内部短信提醒用户</label>
<?
$query = "select * from SMS2_PRIV";
$cursor=exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
$TYPE_PRIV=$ROW["TYPE_PRIV"];
if(find_id($TYPE_PRIV,1)) //检查该模块是否允许手机提醒
{
?>
<input type="checkbox" name="SMS2_REMIND" id="SMS2_REMIND"><label for="SMS2_REMIND">使用手机短信提醒用户</label>
<?
}
?>
</td>
</tr>
<tr>
<td nowrap class="TableData"> 置顶:</td>
<td class="TableData">
<input type="checkbox" name=" TOP" id="TOP"><label for="TOP">使公告通知置顶,显示为重要</label>
</td>
</tr>
<tr id="EDITOR">
<td class="TableData" colspan="2">
<iframe name="EDIT_HTML" style="BACKGROUND-COLOR: buttonface" src="/module/rte" width="100%" height="450" type="text/x-scriptlet" VIEWASTEXT></iframe>
<input type="hidden" name="CONTENT" value="<?=$CONTENT?>">
</td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type="hidden" name="ATTACHMENT_NAME" value="">
<input type="hidden" name="PUBLISH" value="">
<input type="hidden" name="OP" value="">
<input type="button" value="发布" class="BigButton" onclick="sendForm('1');">
<input type="button" value="保存" class="BigButton" onclick="sendForm('0');">
<input type="button" value="重填" class="BigButton" onclick="location='new.php'">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -