📄 edit.php
字号:
<?
include_once("inc/auth.php");
?>
<html>
<head>
<title>编辑日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function CheckForm()
{
<?
if(!(stristr($HTTP_USER_AGENT,"Firefox")||stristr($HTTP_USER_AGENT,"Opera")))
{
?>
document.form1.CONTENT.value=EDIT_HTML.GetHtml();
<?
}
?>
if(document.form1.CONTENT.value=="")
{ alert("日志内容不能为空!");
return (false);
}
return (true);
}
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 Load_Do()
{
<?
if(!(stristr($HTTP_USER_AGENT,"Firefox")||stristr($HTTP_USER_AGENT,"Opera")))
{
?>
EDIT_HTML.SetHtml(document.form1.CONTENT.value);
<?
}
?>
}
</script>
</head>
<?
$query = "SELECT * from DIARY where DIA_ID=$DIA_ID";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
$DIA_DATE=$ROW["DIA_DATE"];
$DIA_DATE=strtok($DIA_DATE," ");
$DIA_TYPE=$ROW["DIA_TYPE"];
$CONTENT=$ROW["CONTENT"];
$CONTENT=str_replace("\"","'",$CONTENT);
}
?>
<body class="bodycolor" topmargin="5" onload="Load_Do();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/diary.gif" WIDTH="22" HEIGHT="20" align="absmiddle"><span class="big3"> 编辑日志(<?=$DIA_DATE?>)</span>
</td>
</tr>
</table>
<table border="0" width="90%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form action="update.php" method="post" name="form1" onsubmit="return CheckForm();">
<tr>
<td nowrap class="TableData" width="80">日志类型:</td>
<td class="TableData">
<select name="DIA_TYPE" class="BigSelect">
<option value="1" <? if($DIA_TYPE==1)echo "selected";?>>工作日志</option>
<option value="2" <? if($DIA_TYPE==2)echo "selected";?>>个人日志</option>
</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="<?=$DIA_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.DIA_DATE');">
</td>
</tr>
<tr>
<td class="TableData" colspan="2">
<?
if(stristr($HTTP_USER_AGENT,"Firefox")||stristr($HTTP_USER_AGENT,"Opera"))
{
?>
<textarea style="width:100%;height:200px" name="CONTENT"><?=$CONTENT?></textarea>
<?
}
else
{
?>
<iframe name="EDIT_HTML" width="100%" height=320 src="/module/editor?EDIT_HEIGHT=260" viewastext type="text/x-scriptlet"></iframe>
<input type="hidden" name="CONTENT" value="<?=$CONTENT?>">
<?
}
?>
</td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type="hidden" name="DIA_ID" value="<?=$DIA_ID?>">
<input type="submit" value="保存修改" class="BigButton">
<input type="button" value="返回" class="BigButton" onClick="location='index.php'">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -