<!--<?php
require_once uTemplate::PrintEot('header');
print <<<EOT
-->
<!--
EOT;
require_once uTemplate::PrintEot('profile_left');
print <<<EOT
-->
	<div class="contUser">
        <div class="p15">
            <h4 class="site"><span>權限</span></h4>
            <div class="navC mb10">
                <ul>
					<li><a style="cursor:pointer" href="profile.php?action=permission" hidefocus="true">權限查看</a></li>
					<li class="current"><a style="cursor:pointer" hidefocus="true">特殊組購買</a></li>
                </ul>
            </div>
			<table width="100%" height="450">
				<tr><td class="vt"><div>
<!--
EOT;
if (!$job) {print<<<EOT
-->
						<table width="100%" class="mb10 tA">
							<tr class="s3">
								<td>用戶組頭餃</td>
								<td>日價格(積分)</td>
								<td>日價格(RMB)</td>
								<td>最短購買天數</td>
								<td>到期時間</td>
								<td>購買</td>
							</tr>
<!--
EOT;
foreach ($specialdb as $key => $val) {
	$strSellprice = !$val[sellprice] && !strlen($val[sellprice])? '-' : $val[sellprice] . $val[selltype] . '/天';
	$strRmbprice = !$val[rmbprice] && !strlen($val[rmbprice])? '-' : $val[rmbprice] . '/天';
	$strSelllimit = !$val[selllimit] && !strlen($val[selllimit])? '-' : $val[selllimit];
print <<<EOT
-->
							<tr>
								<td>$val[grouptitle]</td>
								<td>$strSellprice</td>
								<td>$strRmbprice</td>
								<td>$strSelllimit</td>
								<td>$val[enddate]</td>
								<td>
<!--
EOT;
if(!$val['startdate'] || $timestamp > $val['startdate'] + $val['days']*86400){print <<<EOT
-->
									<a href="profile.php?action=buy&job=buy&gid=$val[gid]">購買</a>
<!--
EOT;
}else{print <<<EOT
-->
									-
<!--
EOT;
}print <<<EOT
-->
								</td>
							</tr>
<!--
EOT;
}print <<<EOT
-->
						</table>
<!--
EOT;
} elseif ($job == 'buy') {print <<<EOT
-->
						<form method="post" action="profile.php?action=buy&">
						<input type="hidden" name="verify" value="$verifyhash" />
						<input type="hidden" name="job" value="buy" />
						<input type="hidden" name="step" value="2" />
						<input type="hidden" name="gid" value="$gid" />
						<div class="p_lr_10">
						<table width="100%" class="mb10 setTable">
							<tr>
								<th class="th" style="width:150px;">用戶組頭餃</th>
								<td class="td"><span class="mr20 s2">{$rt[grouptitle]}</span><span class="gray">{$rt[sright][sellinfo]}</span></td>
							</tr>
							<tr>
								<th class="th">購買方式</th>
								<td class="td" id="checkradio">
<!--
EOT;
if ($rt['sright']['sellprice'] > 0) {print <<<EOT
-->
									<label><input type="radio" name="buymethod" value="0" onclick="showpwd(this.value)" />積分購買 ({$rt[sright][sellprice]} {$rt[sright][selltype]}/天)</label>
<!--
EOT;
}if ($rt['sright']['rmbprice'] > 0) {print <<<EOT
-->
									<label><input type="radio" name="buymethod" value="1" onclick="showpwd(this.value)" />現金購買 ({$rt[sright][rmbprice]} RMB/天)</label>
<!--
EOT;
}print <<<EOT
-->
								</td>
							</tr>
							<tr>
								<th class="th">購買天數</th>
								<td class="td">
									<input class="input" type="text" name="days" size="20" />
									<span class="gray">最少 {$rt[sright][selllimit]} 天</span>
								</td>
							</tr>
							<tr id="showpwd" style="display:none">
								<th class="th">請輸入密碼</th>
								<td class="td"><input class="input" type="password" name="pwpwd" size="20" /></td>
							</tr>
							<tr>
								<th class="th" style="width:150px;">將該用戶組頭餃作為</th>
								<td class="td">
									<label class="mr10"><input type="radio" name="options" value="1" checked />站點顯示頭餃</label>
									<label><input type="radio" name="options" value="2" />附加頭餃</label>
								</td>
							</tr>
						</table>
						</div>
						<div class="tac" style="padding:1em">
							<span class="btn"><span><button type="submit">提 交</button></span></span>
						</div>
						</form>
<script>
function checkradio() {
	var radio = getObj('checkradio').getElementsByTagName('input');
	if (radio.length > 0) {
		radio[0].checked = true;
		showpwd(radio[0].value);
	}
}
function showpwd(v) {
	getObj('showpwd').style.display = v == 1 ? 'none' : '';
}
checkradio();
</script>
<!--
EOT;
}print<<<EOT
-->
					</div>
				</td></tr>
			</table>
		</div>
   
    </div>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->