<?php
/**
* 
* @author moufer<moufer@163.com>
* @copyright www.modoer.com
* @version $Id  $
*/
!defined('IN_MUDDER') && exit('Access Denied');

if(!$user->isLogin) {
    $forward = $php_reuri ? $host_url.$php_reuri : $_config['siteurl'];
    location($_config['siteurl'].'member/login.php?forward='.rawurlencode($forward));
}

if($user->coin < $_membercard['needcoin']) {
    redirect('金币不足'.$_membercard['needcoin'].'，无法兑取'.$_membercard['name'].'，您可以通过添加商铺，添加点评来增加金币。');
}

if($user->membercard) {
    redirect('您已经拥有了会员卡，无法再次申请。');
}

$tpl_name = 'card_apply';
$subtitle = $_membercard['name'].' - 最优惠的消费折扣卡';
require_once MUDDER_ROOT.'header.php';
require_once template($tpl_name);
footer();
?>