<?php
 /**
  * 会员升级
  * @copyright Copyright (c) 2007 - 2010 Yanwee.net (www.anleye.com)
  * @author 阿一 yandy@yanwee.com
  */ 

require('path.inc.php');
$member = new Member($query);
$page->name = 'changeVip';
$id = intval($_GET['id']);
$datainfo = $member->getInfo($id,'*',false);
$page->tpl->assign('datainfo', $datainfo);
$page->tpl->assign('id', $id);
$money = intval($_POST['money']);
$vip =  intval($_POST['vip']);
$page->tpl->assign('id', $id);

	if($_GET['realname']){
		$ids_realname = $member->searchMember('realname',trim($_GET['realname']));
	}

if($page->action == 'save'){
	$_POST['member_id'] = intval($_POST['id']);

	if($_GET['type']==1){
		$_POST['to_time'] = 2592000+$cfg['time'];    //30天
		}
	if($_GET['type']==2){   
			$_POST['to_time'] = 7776000+$cfg['time'];   //90天
			}
	try{
		
		//更改会员标识 并写入时间表
		$member->vipSave($_POST,$_GET['type']);
		
		$page->goto($return_to,'修改成功');
	}catch (Exception $e){
		$page->back($e->getMessage());
	}
	
	exit;
		
	

}else{
}
$page->show();
?>