progress_map.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 591 行 · 第 1/2 页
PHP
591 行
<?
function gettime ($d)
{
if (is_numeric ($d))
{
return $d;
}
else
{
if (!is_string ($d))
{
return 0;
}
if (ereg (':', $d))
{
$buf = split (' +', $d);
$year = split ('[-/]', $buf[0]);
$hour = split (':', $buf[1]);
if (eregi ('pm', $buf[2]))
{
($hour[0] += 12);
}
return mktime ($hour[0], $hour[1], $hour[2], $year[1], $year[2], $year[0]);
}
else
{
$year = split ('[-/]', $d);
return mktime (0, 0, 0, $year[1], $year[2], $year[0]);
}
}
}
function dateadd ($interval, $number, $date)
{
$date = gettime ($date);
$date_time_array = getdate ($date);
$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];
switch ($interval)
{
case 'yyyy':
{
($year += $number);
break;
}
case 'q':
{
($month += ($number * 3));
break;
}
case 'm':
{
($month += $number);
break;
}
case 'y':
{
}
case 'd':
{
}
case 'w':
{
($day += $number);
break;
}
case 'ww':
{
($day += ($number * 7));
break;
}
case 'h':
{
($hours += $number);
break;
}
case 'n':
{
($minutes += $number);
break;
}
case 's':
{
($seconds += $number);
break;
}
}
$timestamp = mktime ($hours, $minutes, $seconds, $month, $day, $year);
return $timestamp;
}
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>
function my_note(DETAIL_ID)
{
myleft=(screen.availWidth-250)/2;
mytop=(screen.availHeight-200)/2;
window.open("note.php?DETAIL_ID="+DETAIL_ID,"note_win"+DETAIL_ID,"height=300,width=350,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,resizable=yes,top="+mytop+",left="+myleft);
}
function plan_detail(PLAN_ID)
{
URL="plan_detail.php?PLAN_ID="+PLAN_ID;
myleft=(s';
echo 'creen.availWidth-500)/2;
window.open(URL,"plan_detail","height=500,width=600,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=120,left="+myleft+",resizable=yes");
}
</script>
</head>
';
$query = (((''.'SELECT * from WORK_PLAN where PLAN_ID=\'').$PLAN_ID).'\'');
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$NAME = $ROW['NAME'];
$BEGIN_DATE1 = $ROW['BEGIN_DATE'];
$END_DATE1 = $ROW['END_DATE'];
$BEGIN_DATE = ($ROW['BEGIN_DATE'].' 00:00:01');
$END_DATE = ($ROW['END_DATE'].' 23:59:59');
$COUNT_DATE = round (((strtotime ($END_DATE) - strtotime ($BEGIN_DATE)) / 86400));
$STR = strtok ($BEGIN_DATE1, '-');
$YEAR = $STR;
$STR = strtok ('-');
$MONTH = $STR;
$STR = strtok (' ');
$DAY = $STR;
$TIME1 = mktime (0, 0, 0, $MONTH, $DAY, $YEAR);
if (($END_DATE1 == '0000-00-00'))
{
$COUNT_DATE = 30;
$END_DATE1 = date ('Y-m-d', dateadd ('d', 30, $BEGIN_DATE1));
}
$COUNT_DATE1 = $COUNT_DATE;
$STR1 = strtok ($END_DATE1, '-');
$YEAR1 = $STR1;
$STR1 = strtok ('-');
$MONTH1 = $STR1;
$STR1 = strtok (' ');
$DAY1 = $STR1;
$TIME2 = mktime (0, 0, 0, $MONTH1, $DAY1, $YEAR1);
$COUNT_DATE = ($COUNT_DATE + date ('w', $TIME1));
$COUNT_WEEK = ceil (($COUNT_DATE / 7));
$COUNT_DATE = ($COUNT_WEEK * 7);
}
echo '<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/work_plan.gif" width="22" height="18" align="absMiddle">';
echo '<s';
echo 'pan class="big3"> 进度图 (';
echo $NAME;
echo ' ';
echo format_date ($BEGIN_DATE1);
echo ' - ';
if (($END_DATE1 != '0000-00-00'))
{
echo format_date ($END_DATE1);
}
echo ')</span><br>
</td>
</tr>
</table><br>
<table align="center" style=\'border-collapse:collapse\' border=1 cellspacing=0 cellpadding=3 bordercolor=\'#000000\' width="100%" class="small">
<tr class="TableData" valign="top">
<td rowspan="2" nowrap valign="center" align="center"> 姓名 </td>
';
for ($I = 0; ($I < $COUNT_WEEK); ++$I)
{
if (($I == 0))
{
$Y_M_D1 = $Y_M_D = date ('Y-m-d', dateadd ('d', (0 - date ('w', $TIME1)), $BEGIN_DATE1));
}
else
{
$Y_M_D = date ('Y-m-d', dateadd ('d', 7, $Y_M_D));
}
echo ' <td colspan="';
echo 7;
echo '" nowrap>';
echo format_date ($Y_M_D);
echo '</td>
';
}
echo ' </tr>
<tr class="TableData" valign="top">
';
for ($I = 0; ($I < $COUNT_DATE); ++$I)
{
if ((($I % 7) == 0))
{
$WEEK_STR = '日';
}
if ((($I % 7) == 1))
{
$WEEK_STR = '一';
}
if ((($I % 7) == 2))
{
$WEEK_STR = '二';
}
if ((($I % 7) == 3))
{
$WEEK_STR = '三';
}
if ((($I % 7) == 4))
{
$WEEK_STR = '四';
}
if ((($I % 7) == 5))
{
$WEEK_STR = '五';
}
if ((($I % 7) == 6))
{
$WEEK_STR = '六';
}
$M_D_STR = date ('m-d', (strtotime ($Y_M_D1) + ($I * 86400)));
$TIME_STR = date ('m-d', time ());
echo ' <td align="center" style="cursor:hand" title="';
echo $M_D_STR;
echo '" bgcolor="';
if (($M_D_STR == $TIME_STR))
{
echo '#cccccc';
}
echo '">';
echo $WEEK_STR;
echo '</td>
';
}
echo ' </tr>
';
$query = (((''.'SELECT * from WORK_PLAN where PLAN_ID=\'').$PLAN_ID).'\'');
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$PARTICIPATOR = $ROW['PARTICIPATOR'];
}
$TOK = strtok ($PARTICIPATOR, ',');
while (($TOK != ''))
{
$query1 = (((''.'select * from USER where USER_ID=\'').$TOK).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW = mysql_fetch_array ($cursor1))
{
$DEPT_ID = $ROW['DEPT_ID'];
$USER_NAME = $ROW['USER_NAME'];
$DEPT_NAME = dept_long_name ($DEPT_ID);
echo ' <tr class="TableData" valign="top">
<td align="center" nowrap title="';
echo $DEPT_NAME;
echo '" style="cursor:hand">';
echo $USER_NAME;
echo '</td>
';
if ((date ('w', $TIME1) == 0))
{
echo ' <td align="left" colspan="';
echo (($COUNT_DATE - (7 - date ('w', $TIME2))) + 1);
echo '">
';
$query = (((((''.'SELECT * from WORK_DETAIL where TYPE_FLAG=\'0\'and PLAN_ID=\'').$PLAN_ID).'\' and WRITER=\'').$TOK).'\' order by WRITE_TIME asc');
$cursor = exequery ($connection, $query);
$NUM_ROWS = mysql_num_rows ($cursor);
if ((0 < $NUM_ROWS))
{
echo ' <table align="center" style=\'border-collapse:collapse\' border=1 cellspacing=0 bordercolor=\'#000000\' width="100%" class="small">
<tr height="10">
';
}
$DETAIL_COUNT = 0;
$PERCENT1 = 0;
$DAYS1 = 0;
$DAYS2 = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$DETAIL_COUNT;
$DETAIL_ID = $ROW['DETAIL_ID'];
$WRITE_TIME = $ROW['WRITE_TIME'];
$PROGRESS = $ROW['PROGRESS'];
$PERCENT = $ROW['PERCENT'];
$WRITER = $ROW['WRITER'];
$STR2 = substr ($WRITE_TIME, 0, 4);
$YEAR2 = $STR2;
$STR2 = substr ($WRITE_TIME, 5, 2);
$MONTH2 = $STR2;
$STR2 = substr ($WRITE_TIME, 8, 2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?