<?
include_once 'auth.php';
include_once 'inc/utility_all.php';
include_once 'inc/utility_org.php';
include_once 'inc/utility_msg.php';

/*****/
$CUR_YEAR = date('Y');
$CUR_MONTH = date('m');
$CUR_WEEK = date('w');
$CUR_DAY = date('j');
$CUR_DATE = date('Y-m-d H:i:s');
$CUR_TIME = date('H:i:s');
$query = "select * from OFFICE_TASK where USE_FLAG='1' and TASK_CODE='deletelog' limit 0,1";
$cursor = exequery(TD::conn(), $query);

if (!$cursor) {
	echo '-ERR ' . get_err_msg($query, $TASK_ID);
	exit();
}

$query="select PARA_VALUE from sys_para where PARA_NAME='WEBROOT'";
$cursor=exequery(TD::conn(),$query);
while($row=mysql_fetch_array($cursor)){
	$para_value=$row["PARA_VALUE"];
	}
	$lujing=str_replace("webroot","",$para_value);
	$tasklog=$lujing."logs\Office_Task.log";
	$phplog=$lujing."logs\php_errors.log";
	
//unlink("E:\MYOA\logs\Office_Task.log");
//unlink("E:\MYOA\logs\php_errors.log");
	if(file_exists($tasklog)){
		unlink($tasklog);
		}
	if(file_exists($phplog)){
		//unlink($phplog);
		}	

update_office_task($TASK_ID, '1', date('Y-m-d H:i:s', time()));
echo '+OK';


?>