<?php
if (!defined('MOD')) die("access die");
$id = intval($_GET['id']);
$item = qdb::queryFirst("select * from ".TABLEPRE."collect_rule where id='{$id}'");
if(empty($item)) qbase::showmsg("bad param");
if($_POST['myFormAc'] == 'update'){
	$param = trim($_POST['param']);
	$allow = array('+','-','*','/','%','@');
	$param = trim(str_replace(array(' ','　'), array('',''), $param));
	$i = strlen($param);
	for($i=0;$i<$len;$i++){
		if(in_array($param[$i], $allow)) continue;
		$c = ord($param[$i]);
		if($c >= 48 && $c <= 57) continue
		qbase::showmsg("定时规则错误，请重新填写");
	}
	qdb::query("update  ".TABLEPRE."collect_rule set auto_update = '{$param}' where id='{$id}'");
	echo qbase::xmlprint(qbase::jsonencode(array('status'=>200)));
}else{
	include qbase::template( $path . '/' . 'cron');
}
?>