month.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 524 行 · 第 1/2 页
PHP
524 行
<?
include_once 'inc/auth.php';
include_once 'inc/utility_all.php';
$CUR_YEAR = date ('Y');
$CUR_MON = date ('m');
$CUR_DAY = date ('d');
if (($BTN_OP != ''))
{
$DATE = strtotime ($BTN_OP, strtotime ((((($YEAR.'-').$MONTH).'-').$DAY)));
$YEAR = date ('Y', $DATE);
$MONTH = date ('m', $DATE);
$DAY = date ('d', $DATE);
}
if (!$YEAR)
{
$YEAR = $CUR_YEAR;
}
if (!$MONTH)
{
$MONTH = $CUR_MON;
}
if (!$DAY)
{
$DAY = $CUR_DAY;
}
if (!checkdate ($MONTH, $DAY, $YEAR))
{
message ('错误', '日期不正确');
exit ();
}
$DATE = strtotime ((((($YEAR.'-').$MONTH).'-').$DAY));
$MONTH_BEGIN = strtotime (((($YEAR.'-').$MONTH).'-01'));
$MONTH_END = strtotime ((((($YEAR.'-').$MONTH).'-').date ('t', $DATE)));
echo '<html>
<head>
<title>日程安排</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<s';
echo 'cript>
function my_affair(AFF_ID)
{
myleft=(screen.availWidth-250)/2;
mytop=(screen.availHeight-200)/2;
window.open("../affair/note.php?AFF_ID="+AFF_ID,"note_win"+AFF_ID,"height=200,width=250,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,resizable=no,top="+mytop+",left="+myleft);
}
function my_note(CAL_ID)
{
myleft=(screen.availWidth-250)/2;
mytop=(screen.availHe';
echo 'ight-200)/2;
window.open("note.php?CAL_ID="+CAL_ID,"note_win"+CAL_ID,"height=200,width=250,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,resizable=no,top="+mytop+",left="+myleft);
}
function My_Submit()
{
document.form1.submit();
}
function set_year(op)
{
document.form1.BTN_OP.value=op+" year";
My_Submit();
}
function set_mon(op)
{
document.form1.BTN_OP.v';
echo 'alue=op+" month";
My_Submit();
}
function set_day(op)
{
document.form1.BTN_OP.value=op+" day";
My_Submit();
}
function display_front()
{
var front=document.getElementById("front");
if(!front)
return;
if(front.style.display==\'\')
front.style.display=\'none\';
else
front.style.display=\'\';
}
function init()
{
var elementI=document.getEleme';
echo 'ntsByTagName("DIV");
for(i=0;i<elementI.length;i++)
{
if(elementI[i].id.substr(0,4)!="cal_")
continue;
elementI[i].onmouseover=function() {var op_i=document.getElementById(this.id+"_op");if(op_i) op_i.style.display="";}
elementI[i].onmouseout =function() {var op_i=document.getElementById(this.id+"_op");if(op_i) op_i.style.display="none";}
}
}
functio';
echo 'n set_view()
{
var view=document.form1.VIEW.value;
if(!view) return;
var exp = new Date();
exp.setTime(exp.getTime() + 24*60*60*1000);
document.cookie = "cal_view="+ escape (view) + ";expires=" + exp.toGMTString()+";path=/";
location=view+\'.php?YEAR=';
echo $YEAR;
echo '&MONTH=';
echo $MONTH;
echo '&DAY=';
echo $DAY;
echo '\';
}
function new_cal(CAL_TIME)
{
window.open(\'new?CAL_DATE=';
echo $YEAR;
echo '-';
echo $MONTH;
echo '-';
echo $DAY;
echo '&CAL_TIME=\'+CAL_TIME,\'oa_sub_window\',\'height=350,width=500,status=0,toolbar=no,menubar=no,location=no,left=300,top=200,scrollbars=yes,resizable=yes\');
}
function new_diary()
{
window.open(\'../../diary/new/?CUR_DATE=';
echo $YEAR;
echo '-';
echo $MONTH;
echo '-';
echo $DAY;
echo '\',\'diary_sub_window\',\'height=560,width=650,status=0,toolbar=no,menubar=no,location=no,left=180,top=50,scrollbars=yes,resizable=yes\');
}
</script>
</head>
<body class="bodycolor" topmargin="5" onload="init();">
<form name="form1" action="';
echo $_SERVER['SCRIPT_NAME'];
echo '">
<table width="100%" border="0" cellspacing="0" class="big1" cellpadding="3" align="center">
<tr>
<td>
<input type="button" value="今天" class="SmallButton" title="今天" onclick="location=\'';
echo $_SERVER['SCRIPT_NAME'];
echo '?YEAR=';
echo $CUR_YEAR;
echo '&MONTH=';
echo $CUR_MON;
echo '&DAY=';
echo $CUR_DAY;
echo '\'">
<input type="hidden" value="" name="BTN_OP">
<!-------------- 年 ------------>
<input type="button" value=" < " class="SmallButton" style="font-weight:bold" title="上一年" onclick="set_year(-1);">';
echo '<s';
echo 'elect name="YEAR" class="SmallSelect" style="font-weight:bold" onchange="My_Submit();">
';
for ($I = 2000; ($I <= 2015); ++$I)
{
echo ' <option value="';
echo $I;
echo '" ';
if (($I == $YEAR))
{
echo 'selected';
}
echo '>';
echo $I;
echo '年</option>
';
}
echo ' </select><input type="button" value=" > " class="SmallButton" style="font-weight:bold" title="下一年" onclick="set_year(1);">
<!-------------- 月 ------------>
<input type="button" value=" < " class="SmallButton" style="font-weight:bold" title="上一月" onclick="set_mon(-1);">';
echo '<s';
echo 'elect name="MONTH" class="SmallSelect" style="font-weight:bold" onchange="My_Submit();">
';
for ($I = 1; ($I <= 12); ++$I)
{
if (($I < 10))
{
$I = ('0'.$I);
}
echo ' <option value="';
echo $I;
echo '" ';
if (($I == $MONTH))
{
echo 'selected';
}
echo '>';
echo $I;
echo '月</option>
';
}
echo ' </select><input type="button" value=" > " class="SmallButton" style="font-weight:bold" title="下一月" onclick="set_mon(1);">
<!-------------- 日 ------------>
<input type="button" value=" < " class="SmallButton" style="font-weight:bold" title="上一天" onclick="set_day(-1);">';
echo '<s';
echo 'elect name="DAY" class="SmallSelect" style="font-weight:bold" onchange="My_Submit();">
';
for ($I = 1; ($I <= date ('t', strtotime ((((($YEAR.'-').$MONTH).'-').$DAY)))); ++$I)
{
if (($I < 10))
{
$I = ('0'.$I);
}
echo ' <option value="';
echo $I;
echo '" ';
if (($I == $DAY))
{
echo 'selected';
}
echo '>';
echo $I;
echo '日</option>
';
}
echo ' </select><input type="button" value=" > " class="SmallButton" style="font-weight:bold" title="下一天" onclick="set_day(1);">
</td>
<td align="right">
<input type="button" value="新建事务" class="SmallButton" onClick="new_cal(\'9\');" title="创建新的事务,以便提醒自己">
<input type="button" value="建立日志" class="SmallButton" title="建立日志" onclick="new_diary();"';
echo '>
';
echo '<s';
echo 'elect name="VIEW" class="BigSelect" onchange="set_view();">
<option value="day"> 日列表</option>
<option value="index"> 周列表</option>
<option value="month" selected> 月列表</option>
</select>
</td>
</tr>
</table>
';
$CUR_TIME = date ('Y-m-d H:i:s', time ());
$query = (((((((''.'SELECT * from CALENDAR where USER_ID=\'').$LOGIN_USER_ID).'\' and year(CAL_TIME)=').$YEAR).' and month(CAL_TIME)=').$MONTH).' order by CAL_TIME');
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$CAL_ID = $ROW['CAL_ID'];
$CAL_TIME = $ROW['CAL_TIME'];
$END_TIME = $ROW['END_TIME'];
$CAL_TYPE = $ROW['CAL_TYPE'];
$CONTENT = $ROW['CONTENT'];
$MANAGER_ID = $ROW['MANAGER_ID'];
$OVER_STATUS = $ROW['OVER_STATUS'];
$CAL_TITLE = (('类型:'.get_code_name ($CAL_TYPE, 'CAL_TYPE')).'
');
if (($OVER_STATUS == '0'))
{
if ((0 < compare_time ($CUR_TIME, $END_TIME)))
{
$STATUS_COLOR = '#FF0000';
($CAL_TITLE .= '状态:已过期');
}
else
{
if ((compare_time ($CUR_TIME, $CAL_TIME) < 0))
{
$STATUS_COLOR = '#0000FF';
($CAL_TITLE .= '状态:未至');
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?