<!--<?php
include_once PrintEot('left');
if($admintype == 'invite'){
print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li $nav><a href="$basename">基本設置</a></li>
        <li $nav[manager]><a href="$basename&action=manager">邀請碼管理</a></li>
        <li $nav[generator]><a href="$basename&action=generator">批量生成邀請碼</a></li>
    </ul>
</div>
<!--
EOT;
if(empty($action)){
print <<<EOT
-->

<form action="$basename" method="post">
<input type="hidden" name="step" value="2">
<h2 class="h1">基本設置</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">

	<tr class="tr1 vt">
		<td class="td1">有效期限[天]</td>
		<td class="td2"><input type="text" class="input input_wa" name="config[days]" value="$inv_days"></td>
        <td class="td2"><div class="help_a">設置邀請碼有效期限，如果購買後沒有在有效期內使用，則失效</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">購買時間間隔[天]</td>
		<td class="td2"><input type="text" class="input input_wa" name="config[limitdays]" value="$inv_limitdays"></td>
        <td class="td2"><div class="help_a">購買一次邀請碼後，需要相隔多久才可以再次購買,如果設置為0,則不限制</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">消耗積分</td>
		<td class="td2"><input type="text" class="input input_wa" name="config[costs]" value="$inv_costs"></td>
        <td class="td2"><div class="help_a">購買一個邀請碼需要消耗的積分數值</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">積分類型</td>
		<td class="td2">
        	<select name="config[credit]" class="select_wa">
<!--
EOT;
foreach($credit->cType as $key => $value){
$selected = $key == $inv_credit ? 'selected' : '';
print <<<EOT
-->
                <option value="$key" $selected>$value</option>
<!--
EOT;
}print <<<EOT
-->
			</select>
		</td>
        <td class="td2"><div class="help_a">指定購買邀請碼的積分類型</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">允許購買的用戶組</td>
		<td class="td2"><ul class="list_A list_120">$usergroup</ul></td>
        <td class="td2"><div class="help_a">設置允許哪些用戶組購買邀請碼</div></td>
	</tr>
    <tr class="tr1 vt">
		<td class="td1">發送邀請碼郵件內容</td>
		<td class="td2">
			
<!-- 
EOT;
	if(empty($inv_email)){
		print <<<EOT
-->
<textarea class="textarea" name="config[email]">
嗨！我是\$username，\$sitename是一個非常不錯的網站，推薦你注冊，下面是注冊邀請碼︰
\$invitecode

你也可以通過下面的鏈接進入我的個人空間
http://test.phpwind.com/{$db_userurl}\$uid
</textarea>
<!--
EOT;
	}else{
		print <<<EOT
-->
<textarea class="textarea" name="config[email]">
$inv_email
</textarea>
<!-- 
EOT;
}
print <<<EOT
-->
			</td>
        <td class="td2"><div class="help_a">設置通過電子郵箱發送邀請鏈接的默認郵件內容。\$username為用戶名，\$sitename為站點名稱，\$invitecode為邀請碼，\$uid為用戶id</div></td>
	</tr>	
	<tr class="tr1 vt">
		<td class="td1">邀請碼在線支付功能</td>
		<td class="td2">
        	<ul class="list_A list_80">
            	<li><input type="radio" value="1" $onlinesell_Y name="config[onlinesell]" />開啟</li>
                <li><input type="radio" value="0" $onlinesell_N name="config[onlinesell]" />關閉</li>
            </ul>
        </td>
        <td class="td2"><div class="help_a">此功能允許注冊者通過網上支付一定費用獲得邀請碼<br />開啟此功能需:<br />1. 系統已開啟網上支付功能<br />2. 系統已開啟郵件發送功能</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">支付金額[元]</td>
		<td class="td2"><input type="text" class="input input_wa" name="config[price]" value="$inv_price" /></td>
        <td class="td2"><div class="help_a"></div></td>
	</tr>
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit">提 交</button></span></span></div></form>
<!--
EOT;
}elseif($action=='manager'){print <<<EOT
-->
<form action="$basename&action=$action" method="post">
<h2 class="h1">
	<span class="mr10">搜索</span>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
	<td width="6%">狀態</td>
	<td width="22%"> 
	    <select name="type"  class="select_wa">
	    	<option value="0" $sel[0]>全部</option>
	        <option value="1" $sel[1]>未使用</option>
	        <option value="2" $sel[2]>已過期</option>
	        <option value="3" $sel[3]>已注冊</option>
	    </select>
	</td>
	<td width="11%">
		購買用戶	</td>
	<td width="22%">
		<input type="text" class="input input_wa" name="username" id="username" value="$username" />
	</td>
	<td width="11%">
		注冊用戶	</td>
	<td width="22%">
		<input type="text" class="input input_wa" name="receiver" id="receiver" value="$receiver" />
	</td>
	<td><button name="add" type="submit" >查找</button></td>
	</tr>
</table>
</div>
</form>
<br/>
<form action="$basename" method="post">
<input type="hidden" name="step" value="3">
<h2 class="h1">
	<span class="mr10">邀請碼管理</span>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td width="8%">序號</td>
		<td width="*">邀請碼</td>
		<td width="12%">購買用戶</td>
		<td width="20%">購買時間</td>
		<td width="20%">失效時間</td>
		<td width="8%">狀態</td>
		<td width="8%">類型</td>
		<td width="12%">注冊用戶</td>
<!--
EOT;
if($type!='1' &&  $type != '0'){
print <<<EOT
-->
		<td width="5%">&nbsp;</td>
<!--
EOT;
}
print <<<EOT
-->
	</tr>
<!--
EOT;
foreach($invdb as $key=>$value){
print <<<EOT
-->
	<tr class="tr1">
		<td class="td2">$value[num]</td>
		<td class="td2">$value[invcode]</td>
		<td class="td2">$value[username]</td>
		<td class="td2">$value[createtime]</td>
		<td class="td2">$value[overtime]</td>
		<td class="td2 gray">$value[used]</td>
		<td class="td2">$value[type]</td>
		<td class="td2"><a href="u.php?username={$value[receiver]}" target="blank">$value[receiver]</a></td>
<!--
EOT;
if($type!='1' && $type != '0'){
print <<<EOT
-->
		<td class="td2"><input type="checkbox" name="selid[]" value="$value[id]" /></td>
<!--
EOT;
}
print <<<EOT
-->
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="cc mb10">$pages</div>
<!--
EOT;
if($type!='1' && $type != '0'){
print <<<EOT
-->
<div class="tac mb10">
	<span class="btn"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 選</button></span></span>
	<span class="btn"><span><button type="submit">刪除所選項</button></span></span>
</div>
<!--
EOT;
}} elseif ($action == 'generator') {
print <<<EOT
-->
<div class="admin_info mb10">
	<h2 class="h1">提示信息</h2>
	<div class="legend">
    	<ol>
        	<li>批量生成邀請碼不會消耗生成者的積分</li>
            <li>批量生成的邀請碼會呈現在邀請碼管理的列表中，類型為批量生成</li>
        </ol>
    </div>
</div>
<form name="generator" action="$basename&action=generator" method="post">
<input type="hidden" name="step" value="2" />
<h2 class="h1">
	<span class="mr10">批量生成邀請碼</span>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">生成數量</td>
		<td class="td2"><input type="text" class="input input_wa" name="number" /></td>
        <td class="td2"><div class="help_a">批量生成邀請碼的個數，每次最多為100個</div></td>
	</tr>
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit">提 交</button></span></span></div>
<!--
EOT;
}
print <<<EOT
-->
</form>
<!--
EOT;
}elseif($admintype == 'propagateset'){print <<<EOT
-->

<div class="nav3 mb10">
    <ul class="cc">
        <li $nav><a href="$basename">宣傳設置</a></li>
        <li $nav[manager]><a href="$basename&action=statics">宣傳統計</a></li>
    </ul>
</div>
<!--
EOT;
if(empty($action)){
print <<<EOT
-->
<div class="admin_info mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
1.功能說明: 通過這個功能，可以鼓勵會員積極宣傳網站。只要用戶把帶UID的url推薦給其他朋友，引導其他人訪問網站，就可以獲得積分獎勵。<br />
2.使用方法: 在站點任意一動態頁面的 url 後加上 a=用戶名 或 u=用戶數字ID.比如以下方法均正確(用戶名 yuling 數字ID: 3558)<br />
&nbsp;&nbsp;http://www.phpwind.net/index.php?a=yuling<br />
&nbsp;&nbsp;http://www.phpwind.net/index.php?u=3558<br />
&nbsp;&nbsp;http://www.phpwind.net/read.php?tid=217205&a=yuling<br />
&nbsp;&nbsp;http://www.phpwind.net/read.php?tid=217205&u=3558<br />
</div></div>
<form action="$basename" method="post">
<input type="hidden" name="step" value="2">
<h2 class="h1">宣傳設置</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">宣傳鏈接</td>
		<td class="td2">
        	<ul class="list_A list_80">
            	<li><input type="radio" value="1" $linkopen_Y name="config[linkopen]" />開啟</li>
                <li><input type="radio" value="0" $linkopen_N name="config[linkopen]" />關閉</li>
            </ul>
        </td>
        <td class="td2"><div class="help_a">開啟後，用戶可以在個人中心-朋友-邀請好友中獲取宣傳鏈接</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">宣傳獎勵要求</td>
		<td class="td2">
        	<ul class="list_A list_80">
                <li><input type="radio" value="0" $linktype_N name="config[linktype]" />獨立ip訪問</li>
            	<li><input type="radio" value="1" $linktype_Y name="config[linktype]" />完成注冊</li>
            </ul>
        </td>
        <td class="td2">
        	<div class="help_a">
        		獨立IP訪問:表示只要引導其他用戶訪問網站，宣傳會員就會增加積分；<br/>完成注冊:表示被引導訪問的用戶需要注冊之後，宣傳會員才會增加積分
			</div>
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">獎勵積分類型</td>
		<td class="td2">
        	<select name="config[linkcredit]" class="select_wa">
<!--
EOT;
foreach($credit->cType as $key => $value){
$selected = $key == $inv_linkcredit ? 'selected' : '';
print <<<EOT
-->
                <option value="$key" $selected>$value</option>
<!--
EOT;
}print <<<EOT
-->
			</select>
		</td>
        <td class="td2"><div class="help_a"></div></td>
	</tr>
    <tr class="tr1 vt">
		<td class="td1">獎勵積分數量</td>
		<td class="td2"><input type="text" class="input input_wa" name="config[linkscore]" value="$inv_linkscore"></td>
        <td class="td2"><div class="help_a"></div></td>
	</tr>
    <!-- <tr class="tr1 vt">
		<td class="td1">宣傳鏈接默認內容</td>
		<td class="td2"><textarea class="textarea" name="config[linkcontent]">$inv_linkcontent</textarea></td>
        <td class="td2"><div class="help_a"></div></td>
	</tr> -->
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit">提 交</button></span></span></div></form>
<!--
EOT;
}elseif($action=='statics'){print <<<EOT
-->
<form action="$basename" method="post">
<input type="hidden" name="step" value="3">
<h2 class="h1">
	<span class="mr10">宣傳統計</span>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2">
		<td>用戶名</td>
		<td>累計訪問</td>
		<td>累計注冊</td>
		<td>獎勵</td>
		<td>時間</td>
		<td>描述</td>

	</tr>
<!--
EOT;
foreach($invdb as $key=>$value){
$value[visitnum] = $value[visitnum] ? $value[visitnum] : 0;
$value[registernum] = $value[registernum] ? $value[registernum] : 0;
print <<<EOT
-->
	<tr class="tr1">
		<td class="td2">$value[username]</td>
		<td class="td2">$value[visitnum]</td>
		<td class="td2">$value[registernum]</td>
		<td class="td2">$value[reward]</td>
		<td class="td2">$value[create_time]</td>
		<td class="td2">$value[type]</td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
</table>
</div>
<div class="cc mb10">$pages</div>
<!--
EOT;
}
print <<<EOT
-->
</form>

<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->