<?php
if(!defined('MOD'))  die("access die");
if($_POST['myFormAc'] == 'update'){
	$channelid = intval($_GET['channelid']);
	$cid = intval($_POST['cid']);
	parse_str(base64_decode(trim($_POST['content'])), $param);
	if(empty($param['name']) || empty($param['charset'])) qbase::showmsg("采集器导入出错");
	$param['cid'] = $cid;
	$param['channelid'] = $channelid;
	$param['dateline'] = $_SERVER['REQUEST_TIME'];
	$param['last_update'] = 0;
	$param = qbase::saddslashes($param);
	$sql = qbase::createSql(TABLEPRE . "collect_rule", $param, 'insert');
	qdb::query($sql);
	echo qbase::xmlprint(qbase::jsonencode(array("status"=>200, "msg"=>"采集器导入成功")));
}else{
	include qbase::template("collect/import"); 
}
?>