task.php

来自「极限OA开源系统」· PHP 代码 · 共 140 行

PHP
140
字号
<?
/********************************************************************************/
/* 极限办公自动化系统 (极限OA)													*/
/* ========================      												*/
/* 欢迎使用 极限OA,在您开始使用之前,请务必完整阅读本软件附带的全部说明档				*/
/********************************************************************************/
/* Welcome to http://www.xsp.cn & http://oa.xsp.cn								*/
/* 技术支持论坛 http://www.1119.net												*/
/********************************************************************************/
/* 商业购买请联系 临海市极限网络有限公司											*/
/* 联系电话: (0576) 5131349	邮件: mkt@xsp.cn	QQ: 562873							*/
/********************************************************************************/
if(!defined('KIN_UNION')){die("Hacking attempt");}
$pre_s = true;

if($sysaction == 'del') {
	checkright(31,21,4);
	if(is_array($delete)) {
		$ids = "0";
		foreach($delete as $val) {
			$ids .= ",$val";
		}
		$db->query("DELETE FROM $table_diary WHERE id IN ($ids)");
	}elseif($id) {
		$db->query("DELETE FROM $table_diary WHERE id='$id'");
	}
	header("Location:memassist.php?action=task");
}

if($sysaction == 'add') {
	checkright(31,21,2);
	if($title && $des) {
		if($id) {
			checkright(31,21,3);
			$stime = "$stime_1:$stime_2";
			$etime = "$etime_1:$etime_2";
			$db->query("update $table_task set title='$title',des='$des',executant='$executant',tdate='$tdate',tdate2='$tdate2',stime='$stime',etime='$etime',awoke='$awoke',state='$state',plan='$plan',level='$level' where id='$id'");
		}else {
			$stime = "$stime_1:$stime_2";
			$etime = "$etime_1:$etime_2";
			$db->query("insert into $table_task (title,des,executant,tdate,tdate2,stime,etime,awoke,level,mid,admin,time) 
			values ('$title','$des','$executant','$tdate','$tdate2','$stime','$etime','$awoke','$level','$union_uid','$union_user','$timestamp')");
		}
		header("Location:dailyop.php?action=task");
	}else {
		$pre_s = false;
		if($id) {
			checkright(31,21,3);
			$tas_t = $db->query_fetch("select * from $table_task where id='$id'");
		}else {
			$tas_t[scope] = '-1';
		}
		$ttime = $ttime?$ttime:date('Y-m-d',$timestamp);
		$ttime = $id?$mem_t['time']:$ttime;
		$tas_t[st_t] = $tas_t[st_t]?$tas_t[st_t]:'12';
		$st_t = array($tas_t[st_t]=>' selected');
		$st_t2 = array($tas_t[st_t2]=>' selected');
		for($i=0;$i<=24;$i++) {
			if($i < 24) {
				$start_htm .= "<option value=$i$st_t[$i]>$i".'时</option>';
				$to_htm .= "<option value=$i$st_t[$i]>$i".'时</option>';
				$awoke_htm .= "<option value=$i>$i</option>";
			}else
				$awoke_htm .= "<option value=$i>$i</option>";
		}
		for($i=0;$i<60;$i=$i+5) {
			$start2_htm .= "<option value=$i$st_t2[$i]>$i".'分</option>';
			$to2_htm .= "<option value=$i$st_t2[$i]>$i".'分</option>';
		}

		$query = $db->query("select * from $table_department where fig='1' order by id ASC");
		$num = $db->num_rows($query);
		while($list = $db->fetch_array($query)) {
			if($list[id] == $tas_t[scope]) $list[sel] = ' selected';
			else $list[sel] = '';
			$depart_list[$list[id]] = $list;
		}
		$now = date('Y-m-d H:i:s',$timestamp);
	}
}elseif($sysaction == 'show') {

	$tas_t = $db->query_fetch("select * from $table_task where id='$id'");
	$tas_t[state] = $tas_t[state]?$tas_t[state]:'未开始';
	foreach($tas_t as $key=>$val) {
		if(empty($val) && $val != 0)
			$tas_t[$key] = '空';
	}
	if($tas_t[scope] == -1)
		$tas_t[scope] = '私人';
	elseif($tas_t[scope] == 0)
		$tas_t[scope] = '所有部门';
	else {
		$ps32 = $db->query_fetch("select name from $table_department where id='$tas_t[scope]'");
		$tas_t[scope] = $ps32[name];
	}
	$tas_t[time] = date('Y-m-d H:i:s',$tas_t[time]);
	//$dia_t[content] = nl2br($dia_t[content]);
	include getData('dailyop_task_show');
	exit;
}


if($pre_s) {
	$mem_list = array();
	$query = $db->query("select * from $table_members");
	while($list = $db->fetch_array($query)) {
		$mem_list[] = $list;
	}

	if($s_admin) {
		checkright(31,21,1);
		$condi = " where admin='$s_admin'";
		if($s_tdate && $s_tdate2) {
			$condi .= " && tdate>='$s_tdate' && tdate2<='$s_tdate2'";
		}
	}

	$perpage = 15;
	if(!$page) {
		$page = 1;
	}
	$offset = ($page - 1) * $perpage;
	$query = $db->query("SELECT COUNT(*) FROM $table_task$condi");
	$num = $total = $db->result($query, 0);
	$multipage = pages($num, $perpage, $page, "dailyop.php?action=task&s_admin=$s_admin&s_tdate=$s_tdate&s_tdate2=$s_tdate2");

	$query = $db->query("select * from $table_task$condi order by time DESC LIMIT $offset, $perpage");
	while($list = $db->fetch_array($query)) {
		$list[title] = wordscut($list[title],10,'');
		$list[state] = $list[state]?$list[state]:'未开始';
		$task_list[$list['id']] = $list;
	}


}



include getData('dailyop_task');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?