{template header}
{template memcp_navbar}



</td><td valign="top" style="padding-left:{TABLESPACE}px !important">

<!--{if $operation == 'transfer'}-->
	<form method="post" action="memcp.php?action=credits">
	<input type="hidden" name="formhash" value="{FORMHASH}">
	<input type="hidden" name="operation" value="transfer">
	<div class="spaceborder">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
	<tr>
	<td width="100%" colspan="2" class="header">{lang memcp_credits_transfer}</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang password}</span></td>
	<td class="altbg2" width="85%"><input type="password" size="15" name="password"></td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang to}</span></td>
	<td class="altbg2" width="85%"><input type="text" size="15" name="to"></td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{$extcredits[$creditstrans][title]}</span></td>
	<td class="altbg2" width="85%"><input type="text" size="15" name="amount" value="0"> {$extcredits[$creditstrans][unit]}</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang memcp_credits_min_balance}</span></td>
	<td class="altbg2" width="85%">$transfermincredits {$extcredits[$creditstrans][unit]}</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang credits_tax}</span></td>
	<td class="altbg2" width="85%">$taxpercent</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%" valign="top"><span class="bold">{lang memcp_credits_transfer_message}</span><br><span class="smalltxt">{lang memcp_credits_transfer_message_comment}</span></td>
	<td class="altbg2" width="85%"><textarea name="transfermessage" rows="8" style="width: 85%; word-break: break-all"></textarea></td>
	</tr>

	<tr class="altbg1 bottom">
	<td colspan="2" class="smalltxt">{lang memcp_credits_transfer_comment}</td>
	</tr>

	</table></div><br>
	<div class="option" style="width: 100%"><div class="submitbutton">
	<input class="button" type="button" name="" value="{lang memcp_credits_caculate}" onclick="this.form.amount.value=Math.floor(this.form.amount.value);alert('{lang memcp_credits_transfer_caculate} {$extcredits[$creditstrans][title]} '+Math.floor(this.form.amount.value*(1-$creditstax)))"> &nbsp;
	<input class="button" type="submit" name="creditssubmit" value="{lang submit}" onclick="return confirm('{lang memcp_credits_confirm}');">
	</div></div></form>
<!--{elseif $operation == 'exchange'}-->
	<form method="post" action="memcp.php?action=credits">
	<input type="hidden" name="formhash" value="{FORMHASH}">
	<input type="hidden" name="operation" value="exchange">

	<script type="text/javascript">
	ratioarray = new Array();
	<!--{loop $exchcredits $id $ecredits}-->
		ratioarray[$id] = $ecredits[ratio];
	<!--{/loop}-->
	</script>
	<div class="spaceborder">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
	<tr>
	<td width="100%" colspan="2" class="header">{lang memcp_credits_exchange}</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang password}</span></td>
	<td class="altbg2" width="85%"><input type="password" size="15" name="password"></td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang memcp_credits_exchange_amount}</span></td>
	<td class="altbg2" width="85%"><input type="text" size="15" name="amount" value="0"></td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang memcp_credits_exchange_source}</span></td>
	<td class="altbg2" width="85%">
	<select name="fromcredits">
	<!--{loop $exchcredits $id $credit}-->
		<option value="$id">$credit[title] ({lang memcp_credits_exchange_ratio} $credit[ratio])</option>
	<!--{/loop}-->
	</select>
	</td>
	</tr>

	<tr>
	<td class="altbg1"><span class="bold">{lang memcp_credits_exchange_target}</span></td>
	<td class="altbg2">
	<select name="tocredits">
	<!--{loop $exchcredits $id $ecredits}-->
		<option value="$id">$ecredits[title] ({lang memcp_credits_exchange_ratio} $ecredits[ratio])</option>
	<!--{/loop}-->
	</select>
	</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang memcp_credits_min_balance}</span></td>
	<td class="altbg2" width="85%">$exchangemincredits</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%"><span class="bold">{lang credits_tax}</span></td>
	<td class="altbg2" width="85%">$taxpercent</td>
	</tr>

	<tr class="altbg1 bottom">
	<td colspan="2" class="smalltxt">{lang memcp_credits_exchange_comment}</td>
	</tr>

	</table></div><br>
	<div class="option" style="width: 100%"><div class="submitbutton">
	<input class="button" type="button" name="" value="{lang memcp_credits_caculate}" onclick="this.form.amount.value=Math.floor(this.form.amount.value);alert('{lang memcp_credits_exchange_caculate} '+Math.floor(this.form.amount.value*ratioarray[this.form.fromcredits.options[this.form.fromcredits.selectedIndex].value]*(1-$creditstax)/ratioarray[this.form.tocredits.options[this.form.tocredits.selectedIndex].value]))"> &nbsp;
	<input class="button" type="submit" name="creditssubmit" value="{lang submit}" onclick="return confirm('{lang memcp_credits_confirm}');">
	</div></div></form>
<!--{elseif $operation == 'addfunds'}-->
	<form method="post" action="memcp.php?action=credits" target="_blank">
	<input type="hidden" name="formhash" value="{FORMHASH}">
	<input type="hidden" name="operation" value="addfunds">
	<div class="spaceborder">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
	<tr>
	<td width="100%" colspan="2" class="header">{lang memcp_credits_addfunds}</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%" valign="top"><span class="bold">{lang memcp_credits_addfunds_rules}</span></td>
	<td class="altbg2" width="85%">
	{lang memcp_credits_addfunds_rules_ratio} = {$extcredits[$creditstrans][title]} <b>$ec_ratio</b> {$extcredits[$creditstrans][unit]}
	<!--{if $ec_mincredits}--><br>{lang memcp_credits_addfunds_rules_min} {$extcredits[$creditstrans][title]} <b>$ec_mincredits</b> {$extcredits[$creditstrans][unit]}<!--{/if}-->
	<!--{if $ec_maxcredits}--><br>{lang memcp_credits_addfunds_rules_max} {$extcredits[$creditstrans][title]} <b>$ec_maxcredits</b> {$extcredits[$creditstrans][unit]}<!--{/if}-->
	<!--{if $ec_maxcreditspermonth}--><br>{lang memcp_credits_addfunds_rules_month} {$extcredits[$creditstrans][title]} <b>$ec_maxcreditspermonth</b> {$extcredits[$creditstrans][unit]}<!--{/if}-->
	</td>
	</tr>

	<tr>
	<td class="altbg1" width="15%">{$extcredits[$creditstrans][title]} {lang memcp_credits_addfunds_amount}:</td>
	<td class="altbg2" width="85%"><input type="text" size="15" name="amount" value="0"> {$extcredits[$creditstrans][unit]}</td>
	</tr>

	<tr>
	<td colspan="2" class="category"><ul><li>{lang memcp_credits_addfunds_comment}</td>
	</tr>

	</table></div><br>
	<div class="option" style="width: 100%"><div class="submitbutton">
	<input class="button" type="button" name="" value="{lang memcp_credits_caculate}" onclick="this.form.amount.value=Math.floor(this.form.amount.value);alert('{lang memcp_credits_addfunds_caculate} '+Math.ceil(this.form.amount.value/$ec_ratio*100)/100)"> &nbsp;
	<input class="button" type="submit" name="creditssubmit" value="{lang submit}">
	</div></div></form>
<!--{elseif $operation == 'paymentlog'}-->
	<div class="spaceborder spacebottom">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="7">{lang memcp_credits_log_payment}</td></tr>
	<tr align="center" class="category">
	<td width="33%" align="left">{lang subject}</td>
	<td width="10%">{lang author}</td>
	<td width="8%">{lang dateline}</td>
	<td width="18%">{lang forum}</td>
	<td width="8%">{lang memcp_credits_log_payment_dateline}</td>
	<td width="9%">{lang price}</td>
	<td width="9%">{lang pay_author_income}</td>
	</tr>
	<!--{if $loglist}-->
		<!--{loop $loglist $log}-->
			<tr class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
			<td><a href="viewthread.php?tid=$log[tid]">$log[subject]</a></td>
			<td align="center"><a href="viewpro.php?uid=$log[authorid]">$log[author]</a></td>
			<td align="center">$log[tdateline]</td>
			<td align="center"><a href="forumdisplay.php?fid=$log[fid]">$log[name]</a></td>
			<td align="center">$log[dateline]</td>
			<!--{if !$log['amount'] && !$log['netamount']}-->
				<td align="center" colspan="2">{lang memcp_credits_log_payment_refunded}</td>
			<!--{else}-->
				<td align="center">{$extcredits[$creditstrans][title]} $log[amount] {$extcredits[$creditstrans][unit]}</td>
				<td align="center">{$extcredits[$creditstrans][title]} $log[netamount] {$extcredits[$creditstrans][unit]}</td>
			<!--{/if}-->
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<td class="altbg1" colspan="7">{lang memcp_credits_log_none}</td></tr>
	<!--{/if}-->

	</table></div>
	<div class="subtable" style="width: {TABLEWIDTH}">$multipage</div>
<!--{elseif $operation == 'incomelog'}-->
	<div class="spaceborder spacebottom">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="7">{lang memcp_credits_log_income}</td></tr>
	<tr align="center" class="category">
	<td width="33%" align="left">{lang subject}</td>
	<td width="8%">{lang dateline}</td>
	<td width="18%">{lang forum}</td>
	<td width="10%">{lang memcp_credits_log_income_buyer}</td>
	<td width="8%">{lang memcp_credits_log_payment_dateline}</td>
	<td width="9%">{lang price}</td>
	<td width="9%">{lang pay_author_income}</td>
	</tr>
	<!--{if $loglist}-->
		<!--{loop $loglist $log}-->
			<tr class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
			<td><a href="viewthread.php?tid=$log[tid]">$log[subject]</a></td>
			<td align="center">$log[tdateline]</td>
			<td align="center"><a href="forumdisplay.php?fid=$log[fid]">$log[name]</a></td>
			<td align="center"><a href="viewpro.php?uid=$log[uid]">$log[username]</a></td>
			<td align="center">$log[dateline]</td>
			<!--{if !$log['amount'] && !$log['netamount']}-->
				<td align="center" colspan="2">{lang memcp_credits_log_payment_refunded}</td>
			<!--{else}-->
				<td align="center">{$extcredits[$creditstrans][title]} $log[amount] {$extcredits[$creditstrans][unit]}</td>
				<td align="center">{$extcredits[$creditstrans][title]} $log[netamount] {$extcredits[$creditstrans][unit]}</td>
			<!--{/if}-->
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<td class="altbg1" colspan="7">{lang memcp_credits_log_none}</td></tr>
	<!--{/if}-->

	</table></div>
	<div class="subtable" style="width: {TABLEWIDTH}">$multipage</div>
<!--{elseif $operation == 'rewardpaylog'}-->
	<div class="spaceborder spacebottom">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="7">{lang memcp_reward_log_payment}</td></tr>
	<tr align="center" class="category">
	<td width="30%" align="left">{lang subject}</td>
	<td width="20%">{lang dateline}</td>
	<td width="18%">{lang forum}</td>
	<td width="9%">{lang memcp_reward_log_payment_answerer}</td>
	<td width="10%">{lang memcp_reward_total}</td>
	<td width="10%">{lang memcp_reward_fact}</td>
	</tr>
	<!--{if $loglist}-->
		<!--{loop $loglist $log}-->
			<tr class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
			<td><a href="viewthread.php?tid=$log[tid]">$log[subject]</a></td>
			<td align="center">$log[dateline]</td>
			<td align="center"><a href="forumdisplay.php?fid=$log[fid]">$log[name]</a></td>
			<td align="center"><a href="viewpro.php?uid=$log['uid']">$log[username]</a></td>
			<td align="center">{$extcredits[$creditstrans][title]} $log['price']<!--{if $extcredits[$creditstrans][unit] != ''}--> $extcredits[$creditstrans][unit]<!--{/if}--></td>
			<td align="center">{$extcredits[$creditstrans][title]} $log['netamount']<!--{if $extcredits[$creditstrans][unit] != ''}--> $extcredits[$creditstrans][unit]<!--{/if}--></td>
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<td class="altbg1" colspan="7">{lang memcp_credits_log_none}</td></tr>
	<!--{/if}-->

	</table></div>
	<table cellspacing="0" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center"><tr><td>$multipage</td></tr></table>
<!--{elseif $operation == 'rewardincomelog'}-->
	<div class="spaceborder spacebottom">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="7">{lang memcp_reward_log_income}</td></tr>
	<tr align="center" class="category">
	<td width="30%" align="left">{lang subject}</td>
	<td width="20%">{lang dateline}</td>
	<td width="18%">{lang forum}</td>
	<td width="9%">{lang memcp_reward_log_income_author}</td>
	<td width="10%">{lang memcp_reward_total}</td>
	</tr>
	<!--{if $loglist}-->
		<!--{loop $loglist $log}-->
			<tr class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
			<td><a href="viewthread.php?tid=$log[tid]">$log[subject]</a></td>
			<td align="center">$log[dateline]</td>
			<td align="center"><a href="forumdisplay.php?fid=$log[fid]">$log[name]</a></td>
			<td align="center"><a href="viewpro.php?uid=$log['uid']">$log[username]</a></td>
			<td align="center">{$extcredits[$creditstrans][title]} $log['price']<!--{if $extcredits[$creditstrans]['unit'] != ''}--> $extcredits[$creditstrans][unit]<!--{/if}--></td>
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<td class="altbg1" colspan="7">{lang memcp_credits_log_none}</td></tr>
	<!--{/if}-->

	</table></div>
	<table cellspacing="0" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center"><tr><td>$multipage</td></tr></table>
<!--{elseif $operation == 'creditslog'}-->
	<div class="spaceborder spacebottom">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="5">{lang memcp_credits_log_transaction}</td></tr>
	<tr align="center" class="category"><td width="20%" align="left">{lang memcp_credits_log_transaction_fromto}</td><td width="25%">{lang time}</td><td width="15%">{lang memcp_credits_log_transaction_outgo}</td><td width="15%">{lang memcp_credits_log_transaction_income}</td><td width="25%">{lang action}</td></tr>
	<!--{if $loglist}-->
		<!--{loop $loglist $log}-->
			<tr align="center" class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'">
			<td><!--{if $log['fromto'] == 'BANK ACCOUNT'}-->{lang memcp_credits_transfer_bank}<!--{else}--><a href="viewpro.php?username=$log[fromtoenc]">$log[fromto]</a><!--{/if}--></td>
			<td>$log[dateline]</td>
			<td><!--{if $log['send']}-->{$extcredits[$log[sendcredits]][title]} $log[send] {$extcredits[$log[sendcredits]][unit]}<!--{/if}--></td>
			<td><!--{if $log['receive']}-->{$extcredits[$log[receivecredits]][title]} $log[receive] {$extcredits[$log[receivecredits]][unit]}<!--{/if}--></td>
			<td>
			<!--{if $log['operation'] == 'TFR'}-->
				{lang memcp_credits_transfer_send}
			<!--{elseif $log['operation'] == 'RCV'}-->
				{lang memcp_credits_transfer_receive}
			<!--{elseif $log['operation'] == 'EXC'}-->
				{lang memcp_credits_exchange}
			<!--{elseif $log['operation'] == 'UGP'}-->
				{lang memcp_usergroups_charged}
			<!--{elseif $log['operation'] == 'AFD'}-->
				{lang memcp_credits_transfer_bank}
			<!--{/if}-->
			</td>
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<tr><td class="altbg1" colspan="5">{lang memcp_credits_log_none}</td></tr>
	<!--{/if}-->

	</table></div>
	<div class="subtable" style="width: 100%">$multipage</div>
<!--{/if}-->

</td></tr></table>
{template footer}