<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{-:@CREDIT_EXCHANGE-} - {-:$_SITE['name']-}</title>
{-import: file="c,m" type="css" baseurl="(__THEME__)/home/css/" basepath="(THEME_PATH)/home/css/"-}
<meta name="keywords" content="{-:$_SITE['keywords']-}" />
<meta name="description" content="{-:$_SITE['description']-}" />
</head>

<body>
{-include:header-}
<div class="m w_960">
	<div class="w_240 f_l">
		<dl class="adl">
			<dt><strong>{-:@CREDIT_EXCHANGE-}</strong></dt>
			<dd><ul class="aul_5">
				<li><i class="ai ai_16 ai_16_points"></i> <a href="{-url:home@member/credit_exchange?type=ctp-}">{-:@CREDIT_TO_POINTS-}</a></li>
				<li><i class="ai ai_16 ai_16_credit"></i> <a href="{-url:home@member/credit_exchange?type=ptc-}">{-:@POINTS_TO_CREDIT-}</a></li>
			</ul></dd>
		</dl>
	</div><!--/.w_240-->
	<div class="w_10 h_10 o_h f_l">&nbsp;</div>
	<div class="w_710 f_l">
		<div class="w_500 f_l">
			<table class="listTable">
				<tr>
					<th scope="col">{-:@CREDIT_TYPE-}</th>
					<th scope="col">{-:@CURRENT-}</th>
					<th scope="col">{-:@RATIO-}</th>
				</tr>
				{-foreach:$_MCTL,$ct-}
				<tr>
					<td><i class="ai ai_16 ai_16_credit"></i> {-:$ct['mct_name']-}</td>
					<td><span class="fw_b fc_g">{-:$_MI[$ct['mct_alias']]-}</span> {-:$ct['mct_unit']-}</td>
					<td>
						{-if:$ct['mct_exchange']-}
						<span>{-:@POINTS-} : {-:$ct['mct_name']-} = {-:$ct['mct_ratio']-} : 1</span>
						{-else:-}
						<span class="fc_r">{-:@EXCHANGE_IS_OFF-}</span>
						{-:/if-}
					</td>
				</tr>
				{-:/foreach-}
			</table>
		</div><!--/.w_500-->
		<div class="w_10 h_10 o_h f_l">&nbsp;</div>
		<div class="w_200 f_l">
			<div class="member_info">
				{-:@POINTS-}: <span class="fw_b fc_g">{-:$_MI['m_points']-}</span>
			</div><!--/.member_info-->
		</div><!--/.w_200-->
		<div class="h_10 o_h c"></div>
		<dl class="atab_1 adiv">
			<dt><strong {-if:'ptc'!=arequest::get('type')-} class="on"{-:/if-}><a href="{-url:home@member/credit_exchange?type=ctp-}">{-:@CREDIT_TO_POINTS-}</a></strong><strong {-if:'ptc'==arequest::get('type')-} class="on"{-:/if-}><a href="{-url:home@member/credit_exchange?type=ptc-}">{-:@POINTS_TO_CREDIT-}</a></strong></dt>
			<dd class="p_20">
				<form id="credit_exchange" action="" method="post"><table class="formTable">
				{-if:'ptc'==ARequest::get('type')-}
					<tr>
						<td colspan="2" class="inputArea">
							<input id="amount" class="required i" type="text" size="10" name="amount" />
							{-:@POINTS-} {-:@EXCHANGE-}
							<label><select id="mct_alias" name="mct_alias">
								<option value="">{-:@CREDIT_TYPE-}</option>
							{-foreach:$_MCTL,$ct-}
								{-if:$ct['mct_exchange']-}<option value="{-:$ct['mct_alias']-}">{-:$ct['mct_name']-}</option>{-:/if-}
							{-:/foreach-}
							</select></label>
						</td>
					</tr>
				{-else-}
					<tr>
						<td colspan="2" class="inputArea">
							<input id="amount" class="required i" type="text" size="10" name="amount" />
							<label><select id="mct_alias" name="mct_alias">
								<option value="">{-:@CREDIT_TYPE-}</option>
							{-foreach:$_MCTL,$ct-}
								{-if:$ct['mct_exchange']-}<option value="{-:$ct['mct_alias']-}">{-:$ct['mct_name']-}</option>{-:/if-}
							{-:/foreach-}
							</select></label>
							{-:@EXCHANGE-} {-:@POINTS-}
						</td>
					</tr>
				{-:/if-}
					{-if:$_G['interaction']['captcha']-}
					<tr>
						<td class="inputTitle">{-:@CAPTCHA-}</td>
						<td></td>
					</tr>
					<tr>
						<td colspan="2" class="inputArea">
						<label>
							<input type="text" name="vcode" autocomplete="off" value="" class="required i v_code_input" size="5" maxlength="5" />
							<img src="{-url:home@common/captcha_img?name=vcode-}" onclick="this.src += '&' + Math.random();" style="cursor:pointer;" />
							<span class="fc_gry">{-:@CAPTCHA_TIP-}</span>
						</label>
						</td>
					</tr>{-:/if-}
					<tr>
						<td colspan="2" class="operation">
						<label>
							<input name="timeKey" type="hidden" value="{-php:echo time();-}" />
							<input name="type" type="hidden" value="{-if:'ptc'!=ARequest::get('type')-}ctp{-else:-}ptc{-:/if-}" />
							<span class="btn_b submit" to="#credit_exchange" action="{-url:home@member/credit_exchange_do-}">{-:@SUBMIT-}</span>
							<input class="btn_l" type="reset" value="{-:@RESET-}" />
						</label>
						</td>
					</tr>
				</table></form>
			</dd>
		</dl>
	</div><!--/.w_710-->
	<div class="c"></div>
</div>
{-include:footer-}
<script type="text/javascript" src="{-:*__PUBLIC__-}/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	/*s: form check */
	$('#credit_exchange').submit(function(){
		if('' == $('#mct_alias').val()){
			$('#member_credit_type_id').focus();
			alert("{-:@CREDIT_TYPE_NOT_SELECTED-}");
			return false;
		}
	})
	/*e: form check */
});

document.write('<script type="text/javascript" src="{-url:home@common/get_member_info-}&refresh='+Math.random()+'.js"></sc'+'ript>');
document.write('<script type="text/javascript" src="{-url:home@common/task?task={$TASK}-}&refresh='+Math.random()+'.js"></sc'+'ript>');
</script>
{-import:file="c,m" type="js" baseurl="(__THEME__)/home/js/" basepath="(THEME_PATH)/home/js/"-}
{-:$_SITE['stat_code']-}
</body>
</html>
