📄 index.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
include_once("inc/editor.php");
$query = "SELECT PARA_VALUE from SYS_PARA where PARA_NAME='LOCK_TIME'";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
$PARA_VALUE=$ROW["PARA_VALUE"];
$PARA_VALUE=explode(",",$PARA_VALUE);
$W_START=$PARA_VALUE[0];
$W_END=$PARA_VALUE[1];
$DAYS=intval($PARA_VALUE[2]);
}
?>
<html>
<head>
<title>今日日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script src="/inc/js/module.js"></script>
<script src="/inc/js/attach.js"></script>
<script Language="JavaScript">
var upload_limit=<?=$UPLOAD_LIMIT?>,limit_type="<?=strtolower($UPLOAD_LIMIT_TYPE)?>";
function CheckForm(W_START,W_END,LAST_DATE)
{
FORM_TIME=document.form1.DIA_DATE.value;
if(FORM_TIME <= LAST_DATE)
{
alert("所填的日志日期在锁定范围内!");
return (false);
}
else if(W_START=="" && W_END!="" && FORM_TIME <= W_END)
{
alert("所填的日志日期在锁定范围内!");
return (false);
}
else if(W_START!="" && W_END=="" && FORM_TIME >= W_START)
{
alert("所填的日志日期在锁定范围内!");
return (false);
}
else if(W_START!="" && W_END!="" && FORM_TIME <= W_END && FORM_TIME >=W_START)
{
alert("所填的日志日期在锁定范围内!");
return (false);
}
if(TDeditorAPI.GetInstance('CONTENT').EditorDocument.body.innerText.length==0)
{
alert("日志内容不能为空!");
return (false);
}
document.form1.OP.value="1";
return (true);
}
function InsertImage(src)
{
TDeditorAPI.GetInstance('CONTENT').InsertHtml('<img src="'+src+'">');
}
function upload_attach()
{
if(CheckForm('<?=$W_START?>','<?=$W_END?>','<?=$DAYS>0?date("Y-m-d",strtotime("-".$DAYS."day",time())):""?>'))
{
document.form1.OP.value="0";
document.form1.submit();
}
}
</script>
</head>
<?
if($CAL_DATE=="" || $CAL_DATE=="undefined")
$CAL_DATE=date("Y-m-d",time());
else
{
if(strlen($CAL_DATE)==8)
$CAL_DATE=strtotime($CAL_DATE);
$CAL_DATE=date("Y-m-d",$CAL_DATE);
$SUBJECT=$CAL_DATE." 的日程安排";
$query = "SELECT * from CALENDAR where CAL_TYPE!='2' and USER_ID='$LOGIN_USER_ID' and TO_DAYS(CAL_TIME)=TO_DAYS('$CAL_DATE') order by CAL_TIME";
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$CAL_TIME=$ROW["CAL_TIME"];
$END_TIME=$ROW["END_TIME"];
$CAL_TYPE=$ROW["CAL_TYPE"];
$CONTENT=$ROW["CONTENT"];
$MANAGER_ID=$ROW["MANAGER_ID"];
$MANANAMER_NAME="";
if($MANAGER_ID!="")
{
$query = "SELECT USER_NAME from USER where USER_ID='$MANAGER_ID'";
$cursor1= exequery($connection,$query);
if($ROW1=mysql_fetch_array($cursor1))
$MANANAMER_NAME=" (安排人:".$ROW1["USER_NAME"].")";
}
$CAL_TIME=substr($CAL_TIME,0,16);
$END_TIME=substr($END_TIME,0,16);
if(substr($CAL_TIME,0,10) == substr($END_TIME,0,10))
{
$CAL_TIME=substr($CAL_TIME,11,5);
$END_TIME=substr($END_TIME,11,5);
}
$DIA_CONTENT.=$CAL_TIME." - ".$END_TIME.$MANANAMER_NAME."<br>".$CONTENT."<br><br>";
}
}
?>
<body class="bodycolor" topmargin="5" onload="document.form1.SUBJECT.focus();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/diary.gif" WIDTH="18" HEIGHT="18" align="absmiddle"><span class="big3"> 新建日志(<?=$CAL_DATE?>)</span>
</td>
</tr>
</table>
<?
if($SUBJECT=="")
$SUBJECT = $CAL_DATE." 日志";
?>
<form enctype="multipart/form-data" action="submit.php" method="post" name="form1" onsubmit="return CheckForm('<?=$W_START?>','<?=$W_END?>','<?=$DAYS>0?date("Y-m-d",strtotime("-".$DAYS."day",time())):""?>');">
<table class="TableBlock" width="100%" align="center">
<tr>
<td nowrap class="TableData" width="80">日志标题:</td>
<td class="TableData">
<input type="text" name="SUBJECT" size=50 class="BigInput" value="<?=$SUBJECT?>">
<a href="javascript:;" class="orgClear" onClick="document.form1.SUBJECT.value=''">清空</a>
</td>
</tr>
<tr>
<td nowrap class="TableData" width="80">日志类型:</td>
<td class="TableData">
<select name="DIA_TYPE" class="BigSelect">
<?=code_list("DIARY_TYPE","")?>
</select>
</td>
</tr>
<tr>
<td nowrap class="TableData">日期:</td>
<td class="TableData">
<input type="text" name="DIA_DATE" size="10" maxlength="10" class="BigInput" value="<?=$CAL_DATE?>">
<img src="/images/menu/calendar.gif" align="absMiddle" border="0" style="cursor:hand" onclick="td_calendar('form1.DIA_DATE');">
</td>
</tr>
<tr height="25">
<td nowrap class="TableData">附件选择:</td>
<td class="TableData">
<script>ShowAddFile();ShowAddImage();</script>
</td>
</tr>
<tr class="TableControl">
<td class="TableData" colspan="2">
<?
$editor = new Editor('CONTENT') ;
$editor->Height = '320';
$editor->Value = $DIA_CONTENT ;
$editor->Create() ;
?>
</td>
</tr>
<?
if($FROM!="calender")
{
?>
<script>
function share(){
var obj = document.getElementById("share");
if(obj.style.display=='none')
obj.style.display='';
else
obj.style.display='none';
}
</script>
<tr>
<td class="TableHeader" colspan="2"><div onclick="share();" title="点击展开/收缩选项" style="cursor:pointer;width:120px;"><img src="/images/green_arrow.gif" align="absMiddle"> 指定共享范围</div></td>
</tr>
<tr id="share" style="display:none">
<td nowrap class="TableData">共享范围:</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="">
<textarea cols="40" name="TO_NAME" rows="2" style="overflow-y:auto;" class="SmallStatic" wrap="yes" readonly></textarea>
<a href="javascript:;" class="orgAdd" onClick="SelectUser('','TO_ID', 'TO_NAME')">添加</a>
<a href="javascript:;" class="orgClear" onClick="ClearUser('TO_ID', 'TO_NAME')">清空</a>
</td>
</tr>
<?
}
?>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type="hidden" name="OP" value="1">
<input type="hidden" name="FROM" value="<?=$FROM?>">
<input type="submit" value="保存" class="BigButton">
<?
if($FROM_URL=="diary")
{
?>
<input type="button" value="返回" class="BigButton" onClick="location='../diary_body.php'">
<?
}
else
{
?>
<input type="button" value="关闭" class="BigButton" onClick="window.close();">
<?
}
?>
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -