<?
include_once("inc/auth.inc.php");
include_once("inc/utility_org.php");
//exit;
//主从服务器查询判断
if($connstatus == 1){
$connstatus = true;
}else{
$connstatus = "";
}
$HTML_PAGE_TITLE = _("编辑任务");
include_once("inc/header.inc.php");
?>
<script>
function delete_sort(TASK_ID,M_ID)
{
msg='<?=_("确认要删除该任务吗?")?>';
if(window.confirm(msg))
{
URL="task/delete.php?TASK_ID="+TASK_ID+"&M_ID="+M_ID;
window.location=URL;
}
}
</script>
<body class="bodycolor">
<?
$m_id=$_REQUEST["m_id"];
$query="select m_mingcheng from proj_muban where m_id='$m_id' limit 1";
$cursor=exequery(TD::conn(),$query);
$row=mysql_fetch_row($cursor);
$m_mingcheng=$row[0];
//echo $m_mingcheng;
?>
<br/>
<table align="center" width="80%" class="TableList" border="1">
<tr>
<td height="32px" nowrap="nowrap" bgcolor="#CC99FF" style="padding-left:10px">当前位置:设置模板中的任务,模板名称:<?=$m_mingcheng?> | <a href="index.php">返回</a> | <a href="task/new.php?m_id=<?=$m_id?>&m_mingcheng=<?=$m_mingcheng?>"><img src="<?=MYOA_STATIC_SERVER?>/static/images/notify_new.gif" align="absmiddle">新建任务</a> </td>
</tr></table>
<br />
<table border="0" align="center" width="80%" class="TableList" style="font-size:13px" border="1px" bordercolor="#999999">
<tr class="TableHeader">
<td nowrap align="center"><?=_("任务计数")?></td>
<td nowrap align="center" width="200px" height="30px"><?=_("任务序号")?></td>
<td nowrap align="center"><?=_("任务名称")?></td>
<td nowrap align="center" width="100"><?=_("操作")?></td>
</tr>
<?
//--------递归列出流程分类---------------
function list_sort($M_ID,$PARENT_ID,$SPACE="",$M_MINGCHENG)
{
global $TASK_COUNT;
$OUTPUT="";
$PARENT_ID = intval($PARENT_ID);
$query = "SELECT * from PROJ_MUBAN_TASK where PARENT_TASK='$PARENT_ID' AND M_ID='$M_ID' order by TASK_NO";
$cursor = exequery(TD::conn(),$query,$connstatus);
while($ROW=mysql_fetch_array($cursor))
{
$TASK_COUNT++;
$TASK_ID = $ROW["TASK_ID"];
$TASK_NO = $ROW["TASK_NO"];
$TASK_NAME = $ROW["TASK_NAME"];
$HAVE_CHILD = $ROW["HAVE_CHILD"];
$TASK_NAME=str_replace("<","<",$TASK_NAME);
$TASK_NAME=str_replace(">",">",$TASK_NAME);
$TASK_NAME=stripslashes($TASK_NAME);
$RENWU_COUNT=0;
$query1 = "SELECT COUNT(*) from PROJ_MUBAN_TASK where PARENT_TASK='$TASK_ID'";
$cursor1 = exequery(TD::conn(),$query1,$connstatus);
if($ROW1=mysql_fetch_array($cursor1))
$RENWU_COUNT=$ROW1[0];
if($TASK_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
$OUTPUT.=_("
<tr class=\"$TableLine\">
<td width=100 nowrap align=center>$TASK_COUNT</td>
<td nowrap height=\"28px\">$SPACE$TASK_NO</td>
<td nowrap>$SPACE$TASK_NAME</td>
<td align=\"center\" nowrap>
<a href=\"task/new.php?TASK_ID=$TASK_ID&m_id=$M_ID&m_mingcheng=$M_MINGCHENG\">编辑</a>
<a href=\"javascript:delete_sort($TASK_ID,$M_ID);\">删除</a>
</td>
</tr>");
if($RENWU_COUNT>0)
$OUTPUT.=list_sort($M_ID,$TASK_ID,$SPACE._("|-"),$M_MINGCHENG);
}
return $OUTPUT;
}
$TASK_COUNT=0;
echo list_sort($m_id,0,"",$m_mingcheng);
?>
</table>
<?
if($TASK_COUNT<=0)
Message("",_("该项目模板尚未建立任何任务!请新建任务!"));
?>
</body>
</html>
php递归程序实例,任务、子任务循环列表显示源码
最新推荐文章于 2021-04-11 15:31:32 发布