<!--<?php
print <<<EOT
-->
<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname"><strong>$db_bbsname</strong></a><span class="crumbs-item current"><i> </i><strong><a href="$basename">邀請注冊</a></strong></span>
	</div>
</div>
<div class="t3" style="margin-top:8px">
<table width="100%" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td width="23%" valign="top">
			<div class="t">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h">管理選項</td>
				</tr>
				<tr class="tr3">
					<td><a href="$basename">邀請碼管理</a></td>
				</tr>
				<tr class="tr3">
					<td><a href="$basename&action=send">發送邀請碼</a></td>
				</tr>
				<tr class="tr3">
					<td><a href="$basename&action=buy">購買邀請碼</a></td>
				</tr>
			</table></div>
			<div class="t">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="2">基本設置</td>
				</tr>
				<tr class="tr3">
					<th width="60%">邀請碼有效期限</th>
					<th>$inv_days 天</th>
				</tr>
				<tr class="tr3">
					<th>購買時間間隔限制</th>
					<th>$inv_limitdays 天</th>
				</tr>
				<tr class="tr3">
					<th>所消耗的積分</th>
					<th>$inv_costs $usrecredit
					</th>
				</tr>
				<tr class="tr3">
					<th>是否有權限購買</th>
					<th>
<!--
EOT;
if($allowinvite){print <<<EOT
-->
有
<!--
EOT;
}else{print <<<EOT
-->
無
<!--
EOT;
}print <<<EOT
-->
					</th>
				</tr>
<!--
EOT;
if($inv_onlinesell){print <<<EOT
-->
				<tr class="tr3">
					<td>在線購買邀請碼</td>
					<td>已開啟</td>
				</tr>
				<tr class="tr3">
					<td>在線支付費用</td>
					<td>$inv_price</td>
				</tr>
<!--
EOT;
}print <<<EOT
-->
			</table></div>
			<div class="t">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<th class="h" colspan="2">基本資料</th>
				</tr>
				<tr class="tr3">
					<th width="60%">$db_rvrcname</th>
					<th>$userrvrc $db_rvrcunit</th>
				</tr>
				<tr class="tr3">
					<th width="30%">$db_moneyname</th>
					<th>$winddb[money] $db_moneyunit</th>
				</tr>
				<tr class="tr3">
					<th width="30%">$db_creditname</th>
					<th>$winddb[credit] $db_creditunit</th>
				</tr>
				<tr class="tr3">
					<th width="30%">$db_currencyname</th>
					<th>$winddb[currency]</th>
				</tr>
			</table></div>
		</td>
		<td width="*" valign="top">
			<div class="t" style="width:98%;margin-right:0">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="2">邀請注冊流程簡介</td></tr>
				<tr class="tr1">
					<th>1、<b>獲得注冊碼</b><br />
					&nbsp;&nbsp;&nbsp;&nbsp;會員通過支付一定的論壇積分，購買注冊碼<br>
<!--
EOT;
if($inv_onlinesell){print <<<EOT
-->
					&nbsp;&nbsp;&nbsp;&nbsp;游客可以通過在線支付工具支付一定費用，購買注冊碼<br />
<!--
EOT;
}print <<<EOT
-->
					2、<b>向邀請對象發送郵件</b><br>
					&nbsp;&nbsp;&nbsp;&nbsp;將所得的注冊碼發送給邀請對象<br>
					3、<b>完成注冊</b><br>
					&nbsp;&nbsp;&nbsp;&nbsp;邀請對象點擊郵件里的注冊地址，完成邀請注冊，或者當支付成功後系統跳轉至注冊頁面後直接注冊<br>
					<b>注︰</b>開啟邀請注冊功能之後，暫停普通注冊功能
					</th>
				</tr>
			</table></div>
<!--
EOT;
if(!$action){print <<<EOT
-->
			<form action="$basename" method="post">
			<input type="hidden" name="action" value="delete" />
			<div class="t" style="width:98%;margin-right:0">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="6">邀請碼管理</td>
				</tr>
				<tr class="tr2">
					<td width="*">邀請碼</td>
					<td width="20%">購買時間</td>
					<td width="10%">注冊用戶</td>
					<td width="20%">注冊日期</td>
					<td width="7%">狀態</td>
					<td width="6%"></td>
				</tr>
<!--
EOT;
foreach($invdb as $key=>$value){print <<<EOT
-->
				<tr class="tr3">
					<td>$value[invcode]</td>
					<td>$value[createtime]</td>
					<td>$value[receiver]<br /></td>
					<td>$value[usetime]<br /></td>
<!--
EOT;
if($value['uselate']==1){print <<<EOT
-->
<td>已過期</td>
<td><input type="checkbox" name="selid[]" value="$value[id]" /></td>
<!--
EOT;
}elseif($value['ifused']==2){print <<<EOT
-->
<td>已邀請</td>
<td><input type="checkbox" name="selid[]" value="$value[id]" /></td>
<!--
EOT;
}elseif($value['ifused']==1 && $value['uselate']==0){print <<<EOT
-->
<td>已使用</td>
<td>--</td>
<!--
EOT;
}else{print <<<EOT
-->
<td>未使用</td>
<td><a href="$basename&action=send&id=$value[id]"><font color="blue">邀請</font></td>
<!--
EOT;
}print <<<EOT
-->
				</tr>
<!--
EOT;
}print <<<EOT
-->
			</table></div>
			$pages
			<div style="text-align:center;margin-bottom:25px">
			<input class="btn" type="button" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
			<input class="btn" type="submit" value="刪除所選項" onclick="return check(this.form);" /></div></form>
<script language="JavaScript">
function CheckAll(form){
	for (var i=0;i<form.elements.length-2;i++){
		var e = form.elements[i];
		e.checked == true ? e.checked = false : e.checked = true;
	}
}
function check(form){
	if(confirm('確定要刪除所選項嗎？')){
		return true;
	}else{
		return false;
	}
}
</script>
<!--
EOT;
}elseif($action=='send'){print <<<EOT
-->
			<form action="$basename" method="post">
			<input type="hidden" name="action" value="send" />
			<input type="hidden" name="step" value="3" />
			<input type="hidden" name="id" value="$invcode[id]" />
			<div class="t" style="width:98%;margin-right:0">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="2">郵件發送</td>
				</tr>
				<tr class="tr3 tr">
					<th>發送者</th>
					<th>$windid</th>
				</tr>
				<tr class="tr3 tr">
					<th>接收者email</th>
					<th><input class="input" type="text" name="sendtoemail" size="40" /></th>
				</tr>
				<tr class="tr3 tr">
					<th>標題</th>
					<th><input class="input" type="text" name="subject" size="65" value="$subject" /></th></tr>
				<tr class="tr3 tr">
					<th>內容</th>
					<th><textarea rows="6" cols="65" name="atc_content">$atc_content</textarea></th>
				</tr>
			</table></div>
			<div style="text-align:center;margin-bottom:25px">
			<input class="btn" type="submit" value="發送邀請碼" /></div></form>
<!--
EOT;
}elseif($action=='buy'){print <<<EOT
-->
			<form action="$basename" method="post">
			<input type="hidden" name="action" value="buy" />
			<input type="hidden" name="step" value="3" />
			<div class="t" style="width:98%;margin-right:0">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="2">購買邀請碼</td>
				</tr>
				<tr class="tr3 tr">
					<th width="45%">請輸入要購買的個數</th>
					<th><input class="input" type="text" name="invnum" value="1" size="8" /></th>
				</tr>
			</table></div>
			<div style="text-align:center;margin-bottom:25px">
			<input class="btn" type="submit" value="購買邀請碼" /></div></form>
<!--
EOT;
}elseif($action=='pay'){print <<<EOT
-->
			<form action="$basename" method="post">
			<input type="hidden" name="action" value="pay" />
			<input type="hidden" name="step" value="3" />
			<div class="t" style="width:98%;margin-right:0">
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td class="h" colspan="2">購買邀請碼</td>
				</tr>
<!--
EOT;
if(!empty($_POST['step'])){print <<<EOT
-->
				<tr class="tr3">
					<td colspan="2">提示︰您輸入的郵箱中 ($email) 已經有一個生成訂單，您確定現在支付？</td>
					<input type="hidden" name="submit" value="1" />
				</tr>
<!--
EOT;
}print <<<EOT
-->
				<tr class="tr3">
					<th width="45%">請輸入要購買的個數</th>
					<th><input class="input" type="text" name="invnum" value="$num" size="8" /></th>
				</tr>
				<tr class="tr3">
					<td>請輸入您的郵箱(我們將發送邀請碼到您的郵箱)</td>
					<td><input class="input" type="text" name="email" value="$email" size="30" /></td>
				</tr>
				<tr class="tr3">
					<td>請選擇支付方式</td>
					<td>
<!--
EOT;
if($ol_payto){print <<<EOT
-->
					<input type="radio" name="method" value="2" checked /> 支付寶
<!--
EOT;
}if($ol_tenpay && $ol_tenpaycode){print <<<EOT
-->
					<input type="radio" name="method" value="4" /> 財付通
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
			</table></div>
			<div style="text-align:center;margin-bottom:25px">
			<input class="btn" type="submit" value="購買邀請碼" /></div></form>
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
</table></div>
<!--
EOT;
?>-->