index.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 447 行
PHP
447 行
<?
include_once 'inc/auth.php';
include_once 'inc/utility_all.php';
echo '
<html>
<head>
<title>新建工作计划</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<s';
echo 'cript Language="JavaScript">
function CheckForm()
{
if(document.form1.TO_ID.value==""&& document.form1.TO_ID3.value==""&& document.form1.COPY_TO_ID.value=="")
{ alert("发布范围(部门或人员)与参与人不能同时为空!");
return (false);
}
if(document.form1.NAME.value=="")
{ alert("工作计划的标题不能为空!");
return (false);
}
if (document.form1.ATTACHMENT.val';
echo 'ue!="")
{
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="0";
return true;
}
function sendForm()
{
document.form1.CONTENT.value=EDIT_HTML.get_docHtml();
if(Chec';
echo 'kForm())
document.form1.submit();
}
function Load_Do()
{
EDIT_HTML.insertHtml(document.form1.CONTENT.value);
}
function upload_attach()
{
document.form1.CONTENT.value=EDIT_HTML.get_docHtml();
if(CheckForm())
{
document.form1.OP.value="1";
document.form1.submit();
}
}
function clear_dept()
{
document.form1.TO_NAME.value="";
document.form1.TO_ID.';
echo '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_user1';
echo '()
{
document.form1.SECRET_TO_NAME.value="";
document.form1.SECRET_TO_ID.value="";
}
function LoadWindow1()
{
URL="/module/user_select?ID=1";
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:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHei';
echo 'ght:350px;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.showModalDialog(URL,se';
echo 'lf,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user3()
{
document.form1.TO_ID3.value="";
document.form1.TO_NAME3.value="";
}
function LoadWindow3()
{
URL="/module/user_select?ID=3";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scr';
echo 'ollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
window.show';
echo 'ModalDialog("/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 delete_attach(ATTACHMENT_ID,ATTACHMENT_NAME)
{
msg="确定要删除文件 \'"+ ATTACHMENT_NAME +"\' 吗?";
if(window.confirm(msg))
{
URL="delete_attach.php?PLAN_ID=';
echo $PLAN_ID;
echo '&ATTACHMENT_ID="+ATTACHMENT_ID+"&ATTACHMENT_NAME="+ATTACHMENT_NAME;
window.location=URL;
}
}
function sel_attach(div_id,dir_field,name_field,disk_id)
{
var URL="/module/sel_file?EXT_FILTER=&MULTI_SELECT=1&DIV_ID=" + div_id + "&DIR_FIELD=" + dir_field + "&NAME_FIELD=" + name_field + "&TYPE_FIELD=" + disk_id;
window.open(URL,null,"height=300,width=500,status=0,toolbar=no,menubar=n';
echo 'o,location=no,scrollbars=yes,top=200,left=300,resizable=yes");
}
</script>
</head>
';
if (($PLAN_ID != ''))
{
$CUR_DATE = date ('Y-m-d', time ());
$query = ((''.'SELECT * from WORK_PLAN where PLAN_ID=').$PLAN_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$PLAN_ID = $ROW['PLAN_ID'];
$NAME = $ROW['NAME'];
$CONTENT = $ROW['CONTENT'];
$CONTENT = htmlspecialchars ($CONTENT);
$BEGIN_DATE = $ROW['BEGIN_DATE'];
$END_DATE = $ROW['END_DATE'];
$TYPE = $ROW['TYPE'];
$TO_ID = $ROW['TO_ID'];
$MANAGER = $ROW['MANAGER'];
$PARTICIPATOR = $ROW['PARTICIPATOR'];
$ATTACHMENT_ID = $ROW['ATTACHMENT_ID'];
$ATTACHMENT_NAME = $ROW['ATTACHMENT_NAME'];
$ATTACHMENT_COMMENT = $ROW['ATTACHMENT_COMMENT'];
$REMARK = $ROW['REMARK'];
$TO_PERSON_ID = $ROW['TO_PERSON_ID'];
}
if (($BEGIN_DATE == '0000-00-00'))
{
$BEGIN_DATE = '';
}
if (($END_DATE == '0000-00-00'))
{
$END_DATE = '';
}
$TO_NAME = '';
$TOK = strtok ($TO_ID, ',');
while (($TOK != ''))
{
$query1 = (((''.'select * from DEPARTMENT where DEPT_ID=\'').$TOK).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
($TO_NAME .= ($ROW1['DEPT_NAME'].','));
}
$TOK = strtok (',');
}
if (($TO_ID == 'ALL_DEPT'))
{
$TO_NAME = '全体部门';
}
$COPY_TO_NAME = '';
$TOK = strtok ($PARTICIPATOR, ',');
while (($TOK != ''))
{
$query1 = (((''.'select * from USER where USER_ID=\'').$TOK).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
($COPY_TO_NAME .= ($ROW1['USER_NAME'].','));
}
$TOK = strtok (',');
}
$TO_PERSON_NAME = '';
$TOK = strtok ($TO_PERSON_ID, ',');
while (($TOK != ''))
{
$query1 = (((''.'select * from USER where USER_ID=\'').$TOK).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
($TO_PERSON_NAME .= ($ROW1['USER_NAME'].','));
}
$TOK = strtok (',');
}
$SECRET_TO_NAME = '';
$TOK = strtok ($MANAGER, ',');
while (($TOK != ''))
{
$query1 = (((''.'select * from USER where USER_ID=\'').$TOK).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW1 = mysql_fetch_array ($cursor1))
{
($SECRET_TO_NAME .= ($ROW1['USER_NAME'].','));
}
$TOK = strtok (',');
}
}
echo '<body class="bodycolor" topmargin="5" onload="Load_Do();">
';
if (($PLAN_ID == ''))
{
$TITLE = '新建工作计划';
}
else
{
$TITLE = '编辑工作计划';
}
echo '<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle" width="22" height="20">';
echo '<s';
echo 'pan class="big3"> ';
echo $TITLE;
echo '</span>
</td>
</tr>
</table>
<br>
<table border="0" width="600" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form enctype="multipart/form-data" action="submit.php" method="post" name="form1">
<tr>
<td nowrap class="TableContent"> 计划名称:</td>
<td class="TableData">
<input type="text" name="NAME" size="36" maxlength="200" cla';
echo 'ss="BigInput" value="';
echo $NAME;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableContent">发布范围(部门):</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="';
echo $TO_ID;
echo '">
<textarea cols=45 name="TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
echo $TO_NAME;
echo '</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="TableContent">发布范围(人员):</td>
<td class="TableData">
<input type=';
echo '"hidden" name="TO_ID3" value="';
echo $TO_PERSON_ID;
echo '">
<textarea cols=45 name="TO_NAME3" rows="2" class="BigStatic" wrap="yes" readonly>';
echo $TO_PERSON_NAME;
echo '</textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow3()" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user3()" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableContent">参与人:</td>
<td class="TableData">
<input type="hidden" name="COPY_TO_ID" value="';
echo $PARTICIPATOR;
echo '">
<textarea cols=45 name="COPY_TO_NAME" rows="2" class="BigStatic" wrap="yes" readonly>';
echo $COPY_TO_NAME;
echo '</textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow2()" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user2()" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableContent">负责人:</td>
<td class="TableData">
<input type="hidden" name="SECRET_TO_ID" value="';
echo $MANAGER;
echo '">
<textarea cols=45 name="SECRET_TO_NAME" rows="2" class="BigStatic" wrap="yes" readonly>';
echo $SECRET_TO_NAME;
echo '</textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow1()" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user1()" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableContent">附件:</td>
<td class="TableData">
';
if (($ATTACHMENT_NAME == ''))
{
echo '无';
}
else
{
echo attach_link ($ATTACHMENT_ID, $ATTACHMENT_NAME, 1, 1, 1, 1, 1, 1, 0, 0);
}
echo ' </td>
</tr>
<tr height="25">
<td nowrap class="TableContent">附件选择:</td>
<td class="TableData">
<div id="SelFileDiv" class="TextColor2"></div>
<a href="javascript:sel_attach(\'SelFileDiv\',\'ATTACH_DIR\',\'ATTACH_NAME\',\'DISK_ID\');">从文件柜和网络硬盘选择附件</a>
<input type="hidden" value="" name="ATTACH_NAME">
<input type="hidden" value="" ';
echo 'name="ATTACH_DIR">
<input type="hidden" value="" name="DISK_ID">
</td>
</tr>
<tr>
<td nowrap class="TableContent">附件上传:</td>
<td class="TableData">
<input type="file" name="ATTACHMENT" size="30" class="BigInput" title="选择附件文件">
<input type="button" value="上传附件" class="BigButton" onclick="upload_attach();" title="上传附件">
<i';
echo 'nput type="hidden" name="ATTACHMENT_ID_OLD" value="';
echo $ATTACHMENT_ID;
echo '">
<input type="hidden" name="ATTACHMENT_NAME_OLD" value="';
echo $ATTACHMENT_NAME;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableContent"> 附件说明:</td>
<td class="TableData">
<textarea cols=45 name="ATTACHMENT_COMMENT" rows=3 class="BigINPUT" wrap="yes">';
echo $ATTACHMENT_COMMENT;
echo '</textarea>
</td>
</tr>
<tr>
<td nowrap class="TableContent"> 备注:</td>
<td class="TableData">
<textarea cols=45 name="REMARK" rows=3 class="BigINPUT" wrap="yes">';
echo $REMARK;
echo '</textarea>
</td>
</tr>
<tr>
<td nowrap class="TableContent"> 有效期:</td>
<td class="TableData">
开始日期:<input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigInput" value="';
echo $BEGIN_DATE;
echo '">
<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="';
echo $END_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.END_DATE\');">
为空为手动终止
</td>
</tr>
<tr>
<td nowrap class="TableContent"> 计划类型:</td>
<td class="TableData">
';
echo '<s';
echo 'elect name="TYPE" class="BigSelect">
';
$query = 'SELECT * from PLAN_TYPE order by TYPE_NO';
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$TYPE_ID = $ROW['TYPE_ID'];
$TYPE_NAME = $ROW['TYPE_NAME'];
echo ' <option value="';
echo $TYPE_ID;
echo '" ';
if (($TYPE == $TYPE_ID))
{
echo 'selected';
}
echo '>';
echo $TYPE_NAME;
echo '</option>
';
}
echo ' </select>
</td>
</tr>
<tr>
<td nowrap class="TableContent">提醒:</td>
<td class="TableData">
';
echo sms_remind (12);
echo ' </td>
</tr>
<tr>
<td class="TableContent" colspan="2">计划内容:</td>
</tr>
<tr id="EDITOR">
<td class="TableData" colspan="4">
<input type="hidden" name="CONTENT" value="';
echo $CONTENT;
echo '">
<iframe name="EDIT_HTML" style="BACKGROUND-COLOR: buttonface" src="/module/rte" width="100%" height="250" type="text/x-scriptlet" VIEWASTEXT></iframe>
</td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type="hidden" name="ATTACHMENT_NAME">
<input type="hidden" name="OP" value="">
<input type="hidden" name="PLAN_';
echo 'ID" value="';
echo $PLAN_ID;
echo '">
<input type="hidden" name="CREATOR" value="';
echo $LOGIN_USER_ID;
echo '">
<input type="hidden" name="CREATE_DATE" value="';
echo date ('Y-m-d');
echo '">
<input type="button" value="提交" class="BigButton" onclick="sendForm();">
';
if (($PLAN_ID != ''))
{
echo ' <input type="button" value="返回" class="BigButton" onclick="history.back();">
';
}
echo ' </td>
</tr>
</table>
</form>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?