<?php
defined('PHP168_PATH') or die();

/**
* 添加内容
**/

if(REQUEST_METHOD == 'GET'){
	
	$data = array();
	
	isset($_GET['cid']) && $data['cid'] = $_GET['cid'];
	
	$attributes = array();
/**
* your code
**/
	include template($this_module, 'edit', 'admin');
	
}else if(REQUEST_METHOD == 'POST'){
	
	//如果魔法引号开启strip掉
	$_POST = p8_stripslashes2($_POST);
	
	$id = $this_controller->add($_POST) or message('fail');
/**
* your code
**/
	message(
		array(
			array('cms_to_edit', $core->admin_controller .'/'. $SYSTEM .'/item-update?id='.$id.'&model='.$_POST['model']),
			array('cms_to_list', $core->admin_controller .'/'. $SYSTEM .'/item-list?cid='.$_POST['cid'].'&model='.$_POST['model']),
			array('cms_to_view', $this_module->controller .'-view-id-'.$id .'?verify='. $_POST['verify'], '_blank'),
			array('cms_to_add', $core->admin_controller .'/'. $SYSTEM .'/item-add?cid='.$_POST['cid'].'&model='.$_POST['model'])
		),
		$core->admin_controller .'/'. $SYSTEM .'/item-add?cid='.$_POST['cid'].'&model='.$_POST['model'],
		10000
	);
}
