<?php
require('path.inc.php');

$member_id = $member->getAuthInfo('id');

$aptitude = new Aptitude($query);
if($page->action == 'save'){
	try{
		$_POST['broker_id'] = $member_id;
		$aptitude->save($_POST);
		$page->goto('brokerAptitude.php','申请已提交，请等待审核通过');
	}catch (Exception $e){
		$page->back("申请保存失败，请重试");
	}
	exit;
}else{
	$page->name = 'brokerAptitude';
	$page->addJs('FormValid.js');
	$memberInfo = $member->getInfo($member_id,'*',true);
	$page->tpl->assign('memberInfo',$memberInfo);
}

$page->show();
?>